Пример #1
0
  /**
   * Logs a call to the call log based on the connection object passed in.
   *
   * @param c The connection object for the call being logged.
   * @param callLogType The type of call log entry.
   * @param slotId The slot id for the call being logged.
   */
  public void logCall(Connection c, int callLogType, int slotId) {
    final String number = c.getAddress();
    final long date = c.getCreateTime();
    final long duration = c.getDurationMillis();
    final Phone phone = c.getCall().getPhone();

    final CallerInfo ci = getCallerInfoFromConnection(c); // May be null.
    final String logNumber = getLogNumber(c, ci);

    if (DBG) {
      log(
          "- onDisconnect(): logNumber set to:"
              + PhoneUtils.toLogSafePhoneNumber(logNumber)
              + ", number set to: "
              + PhoneUtils.toLogSafePhoneNumber(number));
    }

    /// M: @{
    mPhoneType = phone.getPhoneType();
    mIsComing = c.isIncoming();
    if (FeatureOption.MTK_VT3G324M_SUPPORT) {
      mVtCall = c.isVideo() ? 1 : 0;
    }
    PhoneLog.d(LOG_TAG, "number=" + number + ", duration=" + duration + ", isVT=" + mVtCall);
    /// @}

    /// M: For ALPS00114062 @{
    // show every connection's last time of conference call.
    if (needToShowCallTime(c, duration)) {
      Toast.makeText(
              mApplication.getApplicationContext(),
              formatDuration((int) (duration / 1000)),
              Toast.LENGTH_SHORT)
          .show();
    }
    /// @}

    // TODO: In getLogNumber we use the presentation from
    // the connection for the CNAP. Should we use the one
    // below instead? (comes from caller info)

    // For international calls, 011 needs to be logged as +
    final int presentation = getPresentation(c, ci);

    final boolean isOtaspNumber =
        TelephonyCapabilities.supportsOtasp(phone) && phone.isOtaSpNumber(number);

    // Don't log OTASP calls.
    if (!isOtaspNumber) {
      logCall(ci, logNumber, presentation, callLogType, date, duration, slotId);
    }
  }
 private static void showDeviceIdPanel(Context context) {
   Phone phone = PhoneGlobals.getPhone();
   int i = TelephonyCapabilities.getDeviceIdLabel(phone);
   String s = phone.getDeviceId();
   AlertDialog alertdialog =
       (new android.app.AlertDialog.Builder(context))
           .setTitle(i)
           .setMessage(s)
           .setPositiveButton(0x7f0d0192, null)
           .setCancelable(false)
           .create();
   alertdialog.getWindow().setType(2007);
   alertdialog.show();
 }