Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35dfc2b3 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5450365 from 4ea01903 to pi-platform-release

Change-Id: I837a785109be1555a6787f5b04addb3314323eb1
parents 867980ed 4ea01903
Loading
Loading
Loading
Loading
+77 −4
Original line number Diff line number Diff line
@@ -571,6 +571,21 @@ enum RilErrno {
  RIL_E_INVALID_RESPONSE = 67;
}

// Errors returned by ImsService
enum ImsServiceErrno {

  // The operation error is unknown
  IMS_E_UNKNOWN = 0;
  // The operation has succeeded
  IMS_E_SUCCESS = 1;
  // Sending SMS over IMS failed. Do not retry over IMS again or fallback to CS.
  IMS_E_SMS_SEND_STATUS_ERROR = 2;
  // Sending SMS over IMS failed. Retry over IMS again.
  IMS_E_SMS_SEND_STATUS_ERROR_RETRY = 3;
  // Sending SMS over IMS failed. Fallback to sending the SMS over CS.
  IMS_E_SMS_SEND_STATUS_ERROR_FALLBACK = 4;
}

// PDP_type values in TS 27.007 section 10.1.1.
enum PdpType {

@@ -1070,6 +1085,9 @@ message TelephonyCallSession {

      // System time overwritten by NITZ (Network time)
      NITZ_TIME = 21;

      // Change of audio codec
      AUDIO_CODEC = 22;
    }

    enum RilRequest {
@@ -1162,6 +1180,53 @@ message TelephonyCallSession {
      CALL_DISCONNECTING = 9;
    }

    // Audio codecs
    enum AudioCodec {

      // Unknown codec
      AUDIO_CODEC_UNKNOWN = 0;

      AUDIO_CODEC_AMR = 1;

      AUDIO_CODEC_AMR_WB = 2;

      AUDIO_CODEC_QCELP13K = 3;

      AUDIO_CODEC_EVRC = 4;

      AUDIO_CODEC_EVRC_B = 5;

      AUDIO_CODEC_EVRC_WB = 6;

      AUDIO_CODEC_EVRC_NW = 7;

      AUDIO_CODEC_GSM_EFR = 8;

      AUDIO_CODEC_GSM_FR = 9;

      AUDIO_CODEC_GSM_HR = 10;

      AUDIO_CODEC_G711U = 11;

      AUDIO_CODEC_G723 = 12;

      AUDIO_CODEC_G711A = 13;

      AUDIO_CODEC_G722 = 14;

      AUDIO_CODEC_G711AB = 15;

      AUDIO_CODEC_G729 = 16;

      AUDIO_CODEC_EVS_NB = 17;

      AUDIO_CODEC_EVS_WB = 18;

      AUDIO_CODEC_EVS_SWB = 19;

      AUDIO_CODEC_EVS_FB = 20;
    }

    // The information about a voice call
    message RilCall {

@@ -1269,6 +1334,9 @@ message TelephonyCallSession {

    // NITZ time in milliseconds
    optional int64 nitz_timestamp_millis = 21;

    // Audio codec at the beginning of the session or when changed
    optional AudioCodec audio_codec = 22;
  }

  // Time when call has started, in minutes since epoch,
@@ -1310,13 +1378,13 @@ message SmsSession {
      // or old data call has removed.
      DATA_CALL_LIST_CHANGED = 5;

      // Send a SMS message
      // Send a SMS message over RIL
      SMS_SEND = 6;

      // Message has been sent to network
      // Message has been sent to network using RIL
      SMS_SEND_RESULT = 7;

      // Notification about received SMS
      // Notification about received SMS using RIL
      SMS_RECEIVED = 8;

      // CB message received
@@ -1426,7 +1494,9 @@ message SmsSession {

    // See 3GPP 27.005, 3.2.5 for GSM/UMTS,
    // 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
    // -1 if unknown or not applicable
    // Will map to a SmsManager.RESULT_* code if ims_error is populated
    // SmsManager can be accessed from
    // frameworks/base/telephony/java/android/telephony/SmsManager.java
    optional int32 error_code = 10;

    // RIL error code
@@ -1437,6 +1507,9 @@ message SmsSession {

    // Cellbroadcast message content
    optional CBMessage cell_broadcast_message = 13;

    // ImsService error code.
    optional ImsServiceErrno ims_error = 14;
  }

  // Time when session has started, in minutes since epoch,
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ public class CarrierActionAgent extends Handler {
        sendMessage(obtainMessage(CARRIER_ACTION_REPORT_DEFAULT_NETWORK_STATUS, report));
    }

    private void carrierActionReset() {
    public void carrierActionReset() {
        carrierActionReportDefaultNetworkStatus(false);
        carrierActionSetMeteredApnsEnabled(true);
        carrierActionSetRadioEnabled(true);
+12 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.text.TextUtils;

import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager;
import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
import com.android.internal.telephony.uicc.UiccCardApplication;

@@ -75,6 +76,11 @@ public class GsmCdmaConnection extends Connection {
    // The cached delay to be used between DTMF tones fetched from carrier config.
    private int mDtmfToneDelay = 0;

    // Store the current audio codec
    private int mAudioCodec = DriverCall.AUDIO_QUALITY_UNSPECIFIED;

    private TelephonyMetrics mMetrics = TelephonyMetrics.getInstance();

    //***** Event Constants
    static final int EVENT_DTMF_DONE = 1;
    static final int EVENT_PAUSE_DONE = 2;
@@ -654,6 +660,12 @@ public class GsmCdmaConnection extends Connection {
            changed = true;
        }

        // Metrics for audio codec
        if (dc.audioQuality != mAudioCodec) {
            mAudioCodec = dc.audioQuality;
            mMetrics.writeAudioCodecGsmCdma(mOwner.getPhone().getPhoneId(), dc.audioQuality);
        }

        // A null cnapName should be the same as ""
        if (TextUtils.isEmpty(dc.name)) {
            if (!TextUtils.isEmpty(mCnapName)) {
+15 −3
Original line number Diff line number Diff line
@@ -641,11 +641,16 @@ public class GsmCdmaPhone extends Phone {
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, isInEcm());
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
        if (DBG) logd("sendEmergencyCallbackModeChange");
        logi("sendEmergencyCallbackModeChange");
    }

    @Override
    public void sendEmergencyCallStateChange(boolean callActive) {
        if (!isPhoneTypeCdma()) {
            // It possible that this method got called from ImsPhoneCallTracker#
            logi("sendEmergencyCallbackModeChange - skip for non-cdma");
            return;
        }
        if (mBroadcastEmergencyCallStateChanges) {
            Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALL_STATE_CHANGED);
            intent.putExtra(PhoneConstants.PHONE_IN_EMERGENCY_CALL, callActive);
@@ -1400,7 +1405,7 @@ public class GsmCdmaPhone extends Phone {
            }
        }

        if (!isPhoneTypeGsm() && TextUtils.isEmpty(number)) {
        if (TextUtils.isEmpty(number)) {
            // Read platform settings for dynamic voicemail number
            CarrierConfigManager configManager = (CarrierConfigManager)
                    getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
@@ -1408,7 +1413,7 @@ public class GsmCdmaPhone extends Phone {
            if (b != null && b.getBoolean(
                    CarrierConfigManager.KEY_CONFIG_TELEPHONY_USE_OWN_NUMBER_FOR_VOICEMAIL_BOOL)) {
                number = getLine1Number();
            } else {
            } else if (!isPhoneTypeGsm()) {
                number = "*86";
            }
        }
@@ -1605,6 +1610,13 @@ public class GsmCdmaPhone extends Phone {
            IccRecords r = mIccRecords.get();
            return (r != null) ? r.getMsisdnNumber() : null;
        } else {
            CarrierConfigManager configManager = (CarrierConfigManager)
                    mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
            boolean use_usim = configManager.getConfigForSubId(getSubId()).getBoolean(
                    CarrierConfigManager.KEY_USE_USIM_BOOL);
            if (use_usim) {
                return (mSimRecords != null) ? mSimRecords.getMsisdnNumber() : null;
            }
            return mSST.getMdnNumber();
        }
    }
+17 −5
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import com.android.ims.ImsException;
import com.android.ims.ImsManager;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.GsmAlphabet.TextEncodingDetails;
import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.internal.telephony.util.SMSDispatcherUtil;

import java.util.HashMap;
@@ -57,6 +58,9 @@ public class ImsSmsDispatcher extends SMSDispatcher {
    private volatile boolean mIsImsServiceUp;
    private volatile boolean mIsRegistered;
    private final ImsManager.Connector mImsManagerConnector;
    /** Telephony metrics instance for logging metrics event */
    private TelephonyMetrics mMetrics = TelephonyMetrics.getInstance();

    /**
     * Listen to the IMS service state change
     *
@@ -107,6 +111,7 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                int reason) throws RemoteException {
            Rlog.d(TAG, "onSendSmsResult token=" + token + " messageRef=" + messageRef
                    + " status=" + status + " reason=" + reason);
            mMetrics.writeOnImsServiceSmsSolicitedResponse(mPhone.getPhoneId(), status, reason);
            SmsTracker tracker = mTrackers.get(token);
            if (tracker == null) {
                throw new IllegalArgumentException("Invalid token.");
@@ -159,8 +164,7 @@ public class ImsSmsDispatcher extends SMSDispatcher {
        }

        @Override
        public void onSmsReceived(int token, String format, byte[] pdu)
                throws RemoteException {
        public void onSmsReceived(int token, String format, byte[] pdu) {
            Rlog.d(TAG, "SMS received.");
            android.telephony.SmsMessage message =
                    android.telephony.SmsMessage.createFromPdu(pdu, format);
@@ -169,7 +173,7 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                int mappedResult;
                switch (result) {
                    case Intents.RESULT_SMS_HANDLED:
                        mappedResult = ImsSmsImplBase.STATUS_REPORT_STATUS_OK;
                        mappedResult = ImsSmsImplBase.DELIVER_STATUS_OK;
                        break;
                    case Intents.RESULT_SMS_OUT_OF_MEMORY:
                        mappedResult = ImsSmsImplBase.DELIVER_STATUS_ERROR_NO_MEMORY;
@@ -189,8 +193,11 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                        Rlog.w(TAG, "SMS Received with a PDU that could not be parsed.");
                        getImsManager().acknowledgeSms(token, 0, mappedResult);
                    }
                    mMetrics.writeImsServiceNewSms(mPhone.getPhoneId(), format, mappedResult);
                } catch (ImsException e) {
                    Rlog.e(TAG, "Failed to acknowledgeSms(). Error: " + e.getMessage());
                    mMetrics.writeImsServiceNewSms(mPhone.getPhoneId(), format,
                            ImsSmsImplBase.DELIVER_STATUS_ERROR_GENERIC);
                }
            }, true);
        }
@@ -289,8 +296,9 @@ public class ImsSmsDispatcher extends SMSDispatcher {
        byte[] pdu = (byte[]) map.get(MAP_KEY_PDU);
        byte smsc[] = (byte[]) map.get(MAP_KEY_SMSC);
        boolean isRetry = tracker.mRetryCount > 0;
        String format = getFormat();

        if (SmsConstants.FORMAT_3GPP.equals(getFormat()) && tracker.mRetryCount > 0) {
        if (SmsConstants.FORMAT_3GPP.equals(format) && tracker.mRetryCount > 0) {
            // per TS 23.040 Section 9.2.3.6:  If TP-MTI SMS-SUBMIT (0x01) type
            //   TP-RD (bit 2) is 1 for retry
            //   and TP-MR is set to previously failed sms TP-MR
@@ -306,13 +314,17 @@ public class ImsSmsDispatcher extends SMSDispatcher {
            getImsManager().sendSms(
                    token,
                    tracker.mMessageRef,
                    getFormat(),
                    format,
                    smsc != null ? new String(smsc) : null,
                    isRetry,
                    pdu);
            mMetrics.writeImsServiceSendSms(mPhone.getPhoneId(), format,
                    ImsSmsImplBase.SEND_STATUS_OK);
        } catch (ImsException e) {
            Rlog.e(TAG, "sendSms failed. Falling back to PSTN. Error: " + e.getMessage());
            fallbackToPstn(token, tracker);
            mMetrics.writeImsServiceSendSms(mPhone.getPhoneId(), format,
                    ImsSmsImplBase.SEND_STATUS_ERROR_FALLBACK);
        }
    }

Loading