Example #1
0
 /**
  * Get the call arguments when CallWaiting reject for CDMA.
  *
  * @param ci The caller information for the call being logged.
  * @param number The number for the call being logged.
  * @param presentation The presentation to use in the logs.
  * @param callType The type of call log entry.
  * @param start The start time of call being logged.
  * @param duration The duration for call being logged.
  * @param slotId The slot id for the call being logged.
  * @return CallLogAsync.AddCallArgs related args for the call being logged.
  */
 private CallLogAsync.AddCallArgs getCallArgsForCdmaCallWaitingReject(
     CallerInfo ci,
     String number,
     int presentation,
     int callType,
     long start,
     long duration,
     int slotId) {
   if (DBG) {
     log("getCallArgsForCdmaCallWaitingReject");
   }
   CallLogAsync.AddCallArgs cdmaArgs;
   if (GeminiUtils.isGeminiSupport()) {
     if (DBG) {
       log("getCallArgsForCdmaCallWaitingReject, support gemini.");
     }
     int cdmaSimId = 0;
     if (ITelephonyWrapper.hasIccCard(slotId)) {
       SimInfoRecord si = SimInfoManager.getSimInfoBySlot(PhoneGlobals.getInstance(), slotId);
       if (si != null) {
         cdmaSimId = (int) si.mSimInfoId;
       }
     }
     cdmaArgs =
         new CallLogAsync.AddCallArgs(
             mApplication, ci, number, presentation, callType, start, duration, cdmaSimId);
   } else {
     cdmaArgs =
         new CallLogAsync.AddCallArgs(
             mApplication, ci, number, presentation, callType, start, duration);
   }
   return cdmaArgs;
 }
Example #2
0
  /**
   * Get the call arguments when disconnected.
   *
   * @param ci The caller information for the call being logged.
   * @param number The number for the call being logged.
   * @param presentation The presentation to use in the logs.
   * @param callType The type of call log entry.
   * @param start The start time of call being logged.
   * @param duration The duration of call being logged.
   * @param slotId The slot id for the call being logged.
   * @return CallLogAsync.AddCallArgs related args for the call being logged.
   */
  private CallLogAsync.AddCallArgs getCallArgs(
      CallerInfo ci,
      String number,
      int presentation,
      int callType,
      long start,
      long duration,
      int slotId) {
    CallLogAsync.AddCallArgs args;
    int simIdEx = CallNotifier.CALL_TYPE_NONE;
    // Get the phone type for sip
    boolean isSipCall = false;
    if (mPhoneType == PhoneConstants.PHONE_TYPE_SIP) {
      isSipCall = true;
    }
    if (!GeminiUtils.isGeminiSupport() || isSipCall) {
      // Single Card
      if (isSipCall) {
        simIdEx = CallNotifier.CALL_TYPE_SIP;
      } else {
        simIdEx = CallNotifier.CALL_TYPE_NONE;
        if (ITelephonyWrapper.hasIccCard(PhoneConstants.GEMINI_SIM_1)) {
          SimInfoRecord info = SIMInfoWrapper.getDefault().getSimInfoBySlot(0);
          if (info != null) {
            simIdEx = (int) info.mSimInfoId;
          } else {
            // Give an default simId, in most case, this is invalid
            simIdEx = 1;
          }
        }
        if (DBG) {
          log("for single card, simIdEx = " + simIdEx);
        }
      }
    } else {
      // dual SIM
      // Geminni Enhancement: change call log to sim id;
      SimInfoRecord si;
      if (ITelephonyWrapper.hasIccCard(slotId)) {
        si = SimInfoManager.getSimInfoBySlot(PhoneGlobals.getInstance(), slotId);
        if (si != null) {
          simIdEx = (int) si.mSimInfoId;
        }
      }
      if (DBG) {
        log("for dual SIM, simIdEx = " + simIdEx);
      }
    }

    if (FeatureOption.MTK_VT3G324M_SUPPORT) {
      args =
          new CallLogAsync.AddCallArgs(
              mApplication, ci, number, presentation, callType, start, duration, simIdEx, mVtCall);
    } else {
      args =
          new CallLogAsync.AddCallArgs(
              mApplication, ci, number, presentation, callType, start, duration, simIdEx);
    }

    addCallHistoryAsync(number, start, duration, isSipCall, slotId);
    return args;
  }