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

Commit 28592bf4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5409551 from 9de2e2a3 to qt-release

Change-Id: I10ee0a8276c0081d00ee933c452db621383d7005
parents b918dea9 9de2e2a3
Loading
Loading
Loading
Loading
+139 −0
Original line number Diff line number Diff line
@@ -1775,6 +1775,9 @@ message TelephonyCallSession {

      // Change of audio codec
      AUDIO_CODEC = 22;

      // Notification that the call quality has changed
      CALL_QUALITY_CHANGED = 23;
    }

    enum RilRequest {
@@ -1959,6 +1962,135 @@ message TelephonyCallSession {
      HANDOVER_CANCELED = 4;
    }

    message SignalStrength {

      // signal to noise ratio for LTE signal strength
      optional int32 lte_snr = 1;

      // in the future we may include more measures of signal strength, or
      // measurements for other RATs
    }

    // CallQuality information. (This proto class corresponds to
    // android.telephony.CallQuality)
    message CallQuality {

      enum CallQualityLevel {

        // leaving the first value explicitly as unspecified avoids breaking
        // clients if the desired default behavior changes
        UNDEFINED = 0;

        EXCELLENT = 1;

        GOOD = 2;

        FAIR = 3;

        POOR = 4;

        BAD = 5;

        // this typically indicates a failure in the modem
        NOT_AVAILABLE = 6;
      }

      // the downlink CallQualityLevel for a given ongoing call
      optional CallQualityLevel downlink_level = 1;

      // the uplink CallQualityLevel for a given ongoing call
      optional CallQualityLevel uplink_level = 2;

      // the duration of the call, in seconds
      optional int32 duration_in_seconds = 3;

      // the total number of RTP packets transmitted by this device for an
      // ongoing call
      optional int32 rtp_packets_transmitted = 4;

      // the total number of RTP packets received by this device for an ongoing
      // call
      optional int32 rtp_packets_received = 5;

      // the number of RTP packets which were sent by this device but were lost
      // in the network before reaching the other party
      optional int32 rtp_packets_transmitted_lost = 6;

      // the number of RTP packets which were sent by the other party but were
      // lost in the network before reaching this device
      optional int32 rtp_packets_not_received = 7;

      // the average relative jitter in milliseconds. Jitter represents the
      // amount of variance in interarrival time of packets, for example, if two
      // packets are sent 2 milliseconds apart but received 3 milliseconds
      // apart, the relative jitter between those packets is 1 millisecond.
      //
      // See RFC 3550 for more information on jitter calculations
      optional int32 average_relative_jitter_millis = 8;

      // the maximum relative jitter for a given ongoing call. Jitter represents
      // the amount of variance in interarrival time of packets, for example, if
      // two packets are sent 2 milliseconds apart but received 3 milliseconds
      // apart, the relative jitter between those packets is 1 millisecond.
      //
      // See RFC 3550 for more information on jitter calculations.
      optional int32 max_relative_jitter_millis = 9;

      // the average round trip time of RTP packets in an ongoing call, in milliseconds
      optional int32 average_round_trip_time = 10;

      // the codec type of an ongoing call
      optional AudioCodec codec_type = 11;
    }

    message CallQualitySummary {

      // Total duration of good call quality reported at the end of a call
      optional int32 total_good_quality_duration_in_seconds = 1;

      // Total duration of bad call quality reported at the end of a call
      optional int32 total_bad_quality_duration_in_seconds = 2;

      // Total duration of the call for which we have call quality
      // information, reported at the end of a call. For example, if an IMS call
      // is converted to a CS call, which doesn't report call quality information,
      // this value is the duration of the IMS component.
      optional int32 total_duration_with_quality_information_in_seconds = 3;

      // Snapshot of the CallQuality when signal strength is worst within good
      // quality section
      optional CallQuality snapshot_of_worst_ss_with_good_quality = 4;

      // Snapshot of the CallQuality when signal strength is best within good
      // quality section
      optional CallQuality snapshot_of_best_ss_with_good_quality = 5;

      // Snapshot of the CallQuality when signal strength is worst within bad
      // quality section
      optional CallQuality snapshot_of_worst_ss_with_bad_quality = 6;

      // Snapshot of the CallQuality when signal strength is best within bad
      // quality section
      optional CallQuality snapshot_of_best_ss_with_bad_quality = 7;

      // The worst SignalStrength in any good quality section
      optional SignalStrength worst_ss_with_good_quality = 8;

      // The best SignalStrength in any good quality section
      optional SignalStrength best_ss_with_good_quality = 9;

      // The worst SignalStrength in any bad quality section
      optional SignalStrength worst_ss_with_bad_quality = 10;

      // The best SignalStrength in any bad quality section
      optional SignalStrength best_ss_with_bad_quality = 11;

      // Snapshot of the CallQuality at the end of a call. This includes
      // cumulative statistics like total duration and total RTP packets.
      optional CallQuality snapshot_of_end = 12;

    }

    // Event type
    optional Type type = 1;

@@ -2024,6 +2156,13 @@ message TelephonyCallSession {

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

    // Call quality when changed
    optional CallQuality call_quality = 23;

    // Call quality summary at the end of a call
    optional CallQualitySummary call_quality_summary = 24;

  }

  // Time when call has started, in minutes since epoch,
+7 −5
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@ package com.android.internal.telephony;

import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
import static android.telephony.TelephonyManager.ACTION_PRIMARY_SUBSCRIPTION_LIST_CHANGED;
import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_ID;
import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_FOR_ALL_TYPES;
import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE;
import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL;
import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DATA;
import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_NONE;
import static android.telephony.TelephonyManager.EXTRA_SUBSCRIPTION_ID;

import android.content.Context;
import android.content.Intent;
@@ -31,6 +31,7 @@ import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;
@@ -246,6 +247,7 @@ public class MultiSimSettingController {

    private void showSimSelectDialogIfNeeded(List<SubscriptionInfo> prevPrimarySubs,
            boolean dataSelected, boolean voiceSelected, boolean smsSelected) {
        @TelephonyManager.DefaultSubscriptionSelectType
        int dialogType = EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_NONE;
        int preferredSubId = INVALID_SUBSCRIPTION_ID;
        boolean primarySubRemoved = prevPrimarySubs != null
@@ -259,7 +261,7 @@ public class MultiSimSettingController {
        // user to select default for data as it's most important.
        if (mPrimarySubList.size() == 1 && primarySubRemoved
                && (!dataSelected || !smsSelected || !voiceSelected)) {
            dialogType = EXTRA_DEFAULT_SUBSCRIPTION_SELECT_FOR_ALL_TYPES;
            dialogType = EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL;
            preferredSubId = mPrimarySubList.get(0).getSubscriptionId();
        } else if (mPrimarySubList.size() > 1 && (!dataSelected || primarySubAdded)) {
            dialogType = EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DATA;
@@ -272,8 +274,8 @@ public class MultiSimSettingController {
                    "com.android.settings.sim.SimSelectNotification");
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.putExtra(EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE, dialogType);
            if (dialogType == EXTRA_DEFAULT_SUBSCRIPTION_SELECT_FOR_ALL_TYPES) {
                intent.putExtra(EXTRA_DEFAULT_SUBSCRIPTION_ID, preferredSubId);
            if (dialogType == EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL) {
                intent.putExtra(EXTRA_SUBSCRIPTION_ID, preferredSubId);
            }
            mContext.sendBroadcast(intent);
        }
+78 −62
Original line number Diff line number Diff line
@@ -105,31 +105,40 @@ public class PhoneSwitcher extends Handler {
    private int mMaxActivePhones;
    private static PhoneSwitcher sPhoneSwitcher = null;

    // Default subscription ID from user setting.
    private int mDefaultDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    // Which non-opportunistic subscription is set as data subscription among all non-oppt
    // subscriptions. This value usually comes from user setting, and it's the subscription used for
    // Internet data if mOpptDataSubId is not set.
    private int mNonOpptDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;

    // If mPreferredDataSubId is an active subscription, it overrides
    // mDefaultDataSubId and decides:
    // 1. In modem layer, which subscription is preferred to have data traffic on.
    // 2. In TelephonyNetworkFactory, which subscription will apply default network requests, which
    //    are requests without specifying a subId.
    private int mPreferredDataSubId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
    // mOpptDataSubId must be an active subscription. If it's set, it overrides mNonOpptDataSubId
    // to be used for Internet data.
    private int mOpptDataSubId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;

    // The phone ID that has an active voice call. If set, and its mobile data setting is on,
    // it will become the mPreferredDataPhoneId.
    private int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX;

    @VisibleForTesting
    // Corresponding phoneId after considering mPreferredDataSubId and mDefaultDataSubId above.
    // It decides:
    // 1. In modem layer, which modem is DDS (preferred to have data traffic on)
    // 2. In TelephonyNetworkFactory, which subscription will apply default network requests, which
    //    are requests without specifying a subId.
    // Corresponding phoneId after considering mOpptDataSubId, mNonOpptDataSubId and
    // mPhoneIdInVoiceCall above.
    protected int mPreferredDataPhoneId = SubscriptionManager.INVALID_PHONE_INDEX;

    private int mPhoneIdInCall = SubscriptionManager.INVALID_PHONE_INDEX;
    // Subscription ID corresponds to mPreferredDataPhoneId.
    private int mPreferredDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;

    private ISetOpportunisticDataCallback mSetOpptSubCallback;

    private static final int EVENT_DEFAULT_SUBSCRIPTION_CHANGED   = 101;
    private static final int EVENT_NON_OPPT_SUBSCRIPTION_CHANGED  = 101;
    private static final int EVENT_SUBSCRIPTION_CHANGED           = 102;
    private static final int EVENT_REQUEST_NETWORK                = 103;
    private static final int EVENT_RELEASE_NETWORK                = 104;
    private static final int EVENT_EMERGENCY_TOGGLE               = 105;
    private static final int EVENT_RADIO_CAPABILITY_CHANGED       = 106;
    private static final int EVENT_CHANGE_PREFERRED_SUBSCRIPTION  = 107;
    private static final int EVENT_OPPT_SUBSCRIPTION_CHANGED      = 107;
    private static final int EVENT_RADIO_AVAILABLE                = 108;
    private static final int EVENT_PHONE_IN_CALL_CHANGED          = 109;
    private static final int EVENT_NETWORK_VALIDATION_DONE        = 110;
@@ -161,7 +170,7 @@ public class PhoneSwitcher extends Handler {
                    if (mConnectivityManager.getNetworkCapabilities(network)
                            .hasTransport(TRANSPORT_CELLULAR)) {
                        logDataSwitchEvent(
                                mPreferredDataSubId,
                                mOpptDataSubId,
                                TelephonyEvent.EventState.EVENT_STATE_END,
                                TelephonyEvent.DataSwitch.Reason.DATA_SWITCH_REASON_UNKNOWN);
                    }
@@ -236,21 +245,21 @@ public class PhoneSwitcher extends Handler {

            @Override
            public void onPreciseCallStateChanged(PreciseCallState callState) {
                int oldPhoneIdInCall = mPhoneIdInCall;
                int oldPhoneIdInVoiceCall = mPhoneIdInVoiceCall;
                // If there's no active call, the value will become INVALID_PHONE_INDEX
                // and internet data will be switched back to system selected or user selected
                // subscription.
                mPhoneIdInCall = SubscriptionManager.INVALID_PHONE_INDEX;
                mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX;
                for (Phone phone : mPhones) {
                    if (isCallActive(phone) || isCallActive(phone.getImsPhone())) {
                        mPhoneIdInCall = phone.getPhoneId();
                        mPhoneIdInVoiceCall = phone.getPhoneId();
                        break;
                    }
                }

                if (mPhoneIdInCall != oldPhoneIdInCall) {
                    log("mPhoneIdInCall changed from" + oldPhoneIdInCall
                            + " to " + mPhoneIdInCall);
                if (mPhoneIdInVoiceCall != oldPhoneIdInVoiceCall) {
                    log("mPhoneIdInVoiceCall changed from" + oldPhoneIdInVoiceCall
                            + " to " + mPhoneIdInVoiceCall);
                    Message msg = PhoneSwitcher.this.obtainMessage(EVENT_PHONE_IN_CALL_CHANGED);
                    msg.sendToTarget();
                }
@@ -317,7 +326,7 @@ public class PhoneSwitcher extends Handler {
    private final BroadcastReceiver mDefaultDataChangedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            Message msg = PhoneSwitcher.this.obtainMessage(EVENT_DEFAULT_SUBSCRIPTION_CHANGED);
            Message msg = PhoneSwitcher.this.obtainMessage(EVENT_NON_OPPT_SUBSCRIPTION_CHANGED);
            msg.sendToTarget();
        }
    };
@@ -338,9 +347,9 @@ public class PhoneSwitcher extends Handler {
                onEvaluate(REQUESTS_UNCHANGED, "subChanged");
                break;
            }
            case EVENT_DEFAULT_SUBSCRIPTION_CHANGED: {
                if (onEvaluate(REQUESTS_UNCHANGED, "defaultChanged")) {
                    logDataSwitchEvent(mPreferredDataSubId,
            case EVENT_NON_OPPT_SUBSCRIPTION_CHANGED: {
                if (onEvaluate(REQUESTS_UNCHANGED, "non-oppt data subId changed")) {
                    logDataSwitchEvent(mOpptDataSubId,
                            TelephonyEvent.EventState.EVENT_STATE_START,
                            DataSwitch.Reason.DATA_SWITCH_REASON_MANUAL);
                    registerDefaultNetworkChangeCallback();
@@ -363,7 +372,7 @@ public class PhoneSwitcher extends Handler {
                resendRilCommands(msg);
                break;
            }
            case EVENT_CHANGE_PREFERRED_SUBSCRIPTION: {
            case EVENT_OPPT_SUBSCRIPTION_CHANGED: {
                int subId = msg.arg1;
                boolean needValidation = (msg.arg2 == 1);
                ISetOpportunisticDataCallback callback =
@@ -382,7 +391,7 @@ public class PhoneSwitcher extends Handler {
            }
            case EVENT_PHONE_IN_CALL_CHANGED: {
                if (onEvaluate(REQUESTS_UNCHANGED, "EVENT_PHONE_IN_CALL_CHANGED")) {
                    logDataSwitchEvent(mPreferredDataSubId,
                    logDataSwitchEvent(mOpptDataSubId,
                            TelephonyEvent.EventState.EVENT_STATE_START,
                            DataSwitch.Reason.DATA_SWITCH_REASON_IN_CALL);
                    registerDefaultNetworkChangeCallback();
@@ -521,11 +530,12 @@ public class PhoneSwitcher extends Handler {
        // If we use HAL_COMMAND_PREFERRED_DATA,
        boolean diffDetected = mHalCommandToUse != HAL_COMMAND_PREFERRED_DATA && requestsChanged;

        // Check if user setting of default data sub is changed.
        final int dataSub = mSubscriptionController.getDefaultDataSubId();
        if (dataSub != mDefaultDataSubId) {
            sb.append(" default ").append(mDefaultDataSubId).append("->").append(dataSub);
            mDefaultDataSubId = dataSub;
        // Check if user setting of default non-opportunistic data sub is changed.
        final int nonOpptDataSubId = mSubscriptionController.getDefaultDataSubId();
        if (nonOpptDataSubId != mNonOpptDataSubId) {
            sb.append(" mNonOpptDataSubId ").append(mNonOpptDataSubId).append("->")
                .append(nonOpptDataSubId);
            mNonOpptDataSubId = nonOpptDataSubId;
        }

        // Check if phoneId to subId mapping is changed.
@@ -541,7 +551,7 @@ public class PhoneSwitcher extends Handler {

        // Check if phoneId for preferred data is changed.
        int oldPreferredDataPhoneId = mPreferredDataPhoneId;
        updatePhoneIdForDefaultNetworkRequests();
        updatePreferredDataPhoneId();
        if (oldPreferredDataPhoneId != mPreferredDataPhoneId) {
            sb.append(" preferred phoneId ").append(oldPreferredDataPhoneId)
                    .append("->").append(mPreferredDataPhoneId);
@@ -588,8 +598,8 @@ public class PhoneSwitcher extends Handler {
                }

                if (VDBG) {
                    log("default subId = " + mDefaultDataSubId);
                    log("preferred subId = " + mPreferredDataSubId);
                    log("mNonOpptDataSubId = " + mNonOpptDataSubId);
                    log("mOpptDataSubId = " + mOpptDataSubId);
                    for (int i = 0; i < mNumPhones; i++) {
                        log(" phone[" + i + "] using sub[" + mPhoneSubscriptions[i] + "]");
                    }
@@ -609,8 +619,7 @@ public class PhoneSwitcher extends Handler {
                }
            }

            notifyActiveDataSubIdChanged(mSubscriptionController.getSubIdUsingPhoneId(
                    mPreferredDataPhoneId));
            notifyPreferredDataSubIdChanged();

            // Notify all registrants.
            mActivePhoneRegistrants.notifyRegistrants();
@@ -734,23 +743,23 @@ public class PhoneSwitcher extends Handler {
    }

    private int getSubIdForDefaultNetworkRequests() {
        if (mSubscriptionController.isActiveSubId(mPreferredDataSubId)) {
            return mPreferredDataSubId;
        if (mSubscriptionController.isActiveSubId(mOpptDataSubId)) {
            return mOpptDataSubId;
        } else {
            return mDefaultDataSubId;
            return mNonOpptDataSubId;
        }
    }

    // This updates mPreferredDataPhoneId which decides which phone should
    // handle default network requests.
    private void updatePhoneIdForDefaultNetworkRequests() {
        if (SubscriptionManager.isValidPhoneId(mPhoneIdInCall)) {
    private void updatePreferredDataPhoneId() {
        if (SubscriptionManager.isValidPhoneId(mPhoneIdInVoiceCall)) {
            // If a phone is in call and user enabled its mobile data, we
            // should switch internet connection to it. Because the other modem
            // will lose data connection anyway.
            // TODO: validate network first.

            mPreferredDataPhoneId = mPhoneIdInCall;
            mPreferredDataPhoneId = mPhoneIdInVoiceCall;
        } else {
            int subId = getSubIdForDefaultNetworkRequests();
            int phoneId = SubscriptionManager.INVALID_PHONE_INDEX;
@@ -766,6 +775,8 @@ public class PhoneSwitcher extends Handler {

            mPreferredDataPhoneId = phoneId;
        }

        mPreferredDataSubId = mSubscriptionController.getSubIdUsingPhoneId(mPreferredDataPhoneId);
    }

    public boolean shouldApplyNetworkRequest(NetworkRequest networkRequest, int phoneId) {
@@ -823,7 +834,7 @@ public class PhoneSwitcher extends Handler {
            mValidator.stopValidation();
        }

        if (subId == mPreferredDataSubId) {
        if (subId == mOpptDataSubId) {
            sendSetOpptCallbackHelper(callback, SET_OPPORTUNISTIC_SUB_SUCCESS);
            return;
        }
@@ -837,7 +848,7 @@ public class PhoneSwitcher extends Handler {
            mValidator.validate(subId, DEFAULT_VALIDATION_EXPIRATION_TIME,
                    false, mValidationCallback);
        } else {
            setPreferredSubscription(subId);
            setOpportunisticSubscriptionInternal(subId);
            sendSetOpptCallbackHelper(callback, SET_OPPORTUNISTIC_SUB_SUCCESS);
        }
    }
@@ -851,9 +862,9 @@ public class PhoneSwitcher extends Handler {
            mValidator.stopValidation();
        }

        // Set mPreferredDataSubId back to DEFAULT_SUBSCRIPTION_ID. This will trigger
        // data switch to mDefaultDataSubId.
        setPreferredSubscription(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
        // Set mOpptDataSubId back to DEFAULT_SUBSCRIPTION_ID. This will trigger
        // data switch to mNonOpptDataSubId.
        setOpportunisticSubscriptionInternal(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
        sendSetOpptCallbackHelper(callback, SET_OPPORTUNISTIC_SUB_SUCCESS);
    }

@@ -869,11 +880,11 @@ public class PhoneSwitcher extends Handler {
    /**
     * Set opportunistic data subscription.
     */
    private void setPreferredSubscription(int subId) {
        if (mPreferredDataSubId != subId) {
            mPreferredDataSubId = subId;
            if (onEvaluate(REQUESTS_UNCHANGED, "preferredDataSubscriptionIdChanged")) {
                logDataSwitchEvent(mPreferredDataSubId,
    private void setOpportunisticSubscriptionInternal(int subId) {
        if (mOpptDataSubId != subId) {
            mOpptDataSubId = subId;
            if (onEvaluate(REQUESTS_UNCHANGED, "oppt data subId changed")) {
                logDataSwitchEvent(mOpptDataSubId,
                        TelephonyEvent.EventState.EVENT_STATE_START,
                        DataSwitch.Reason.DATA_SWITCH_REASON_CBRS);
                registerDefaultNetworkChangeCallback();
@@ -884,7 +895,7 @@ public class PhoneSwitcher extends Handler {
    private void onValidationDone(int subId, boolean passed) {
        log("Network validation " + (passed ? "passed" : "failed")
                + " on subId " + subId);
        if (passed) setPreferredSubscription(subId);
        if (passed) setOpportunisticSubscriptionInternal(subId);

        // Trigger callback if needed
        sendSetOpptCallbackHelper(mSetOpptSubCallback, passed ? SET_OPPORTUNISTIC_SUB_SUCCESS
@@ -892,12 +903,14 @@ public class PhoneSwitcher extends Handler {
        mSetOpptSubCallback = null;
    }

    // TODO b/123598154: rename preferredDataSub to opportunisticSubId.
    public void trySetPreferredSubscription(int subId, boolean needValidation,
    /**
     * Notify PhoneSwitcher to try to switch data to an opportunistic subscription.
     */
    public void trySetOpportunisticDataSubscription(int subId, boolean needValidation,
            ISetOpportunisticDataCallback callback) {
        log("Try set preferred subscription to subId " + subId
        log("Try set opportunistic data subscription to subId " + subId
                + (needValidation ? " with " : " without ") + "validation");
        PhoneSwitcher.this.obtainMessage(EVENT_CHANGE_PREFERRED_SUBSCRIPTION,
        PhoneSwitcher.this.obtainMessage(EVENT_OPPT_SUBSCRIPTION_CHANGED,
                subId, needValidation ? 1 : 0, callback).sendToTarget();
    }

@@ -915,8 +928,8 @@ public class PhoneSwitcher extends Handler {
                ? HAL_COMMAND_PREFERRED_DATA : HAL_COMMAND_ALLOW_DATA;
    }

    public int getPreferredDataSubscriptionId() {
        return mPreferredDataSubId;
    public int getOpportunisticDataSubscriptionId() {
        return mOpptDataSubId;
    }

    public int getPreferredDataPhoneId() {
@@ -930,19 +943,22 @@ public class PhoneSwitcher extends Handler {
    }

    private void logDataSwitchEvent(int subId, int state, int reason) {
        subId = subId == DEFAULT_SUBSCRIPTION_ID ? mDefaultDataSubId : subId;
        subId = subId == DEFAULT_SUBSCRIPTION_ID ? mNonOpptDataSubId : subId;
        DataSwitch dataSwitch = new DataSwitch();
        dataSwitch.state = state;
        dataSwitch.reason = reason;
        TelephonyMetrics.getInstance().writeDataSwitch(subId, dataSwitch);
    }

    private void notifyActiveDataSubIdChanged(int activeDataSubId) {
    /**
     * See {@link PhoneStateListener#LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE}.
     */
    private void notifyPreferredDataSubIdChanged() {
        ITelephonyRegistry tr = ITelephonyRegistry.Stub.asInterface(ServiceManager.getService(
                "telephony.registry"));
        try {
            log("notifyActiveDataSubIdChanged to " + activeDataSubId);
            tr.notifyActiveDataSubIdChanged(activeDataSubId);
            log("notifyPreferredDataSubIdChanged to " + mPreferredDataSubId);
            tr.notifyActiveDataSubIdChanged(mPreferredDataSubId);
        } catch (RemoteException ex) {
            // Should never happen because its always available.
        }
+6 −1
Original line number Diff line number Diff line
@@ -5110,7 +5110,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
            sb = new StringBuilder("{");
            if (length > 0) {
                int i = 0;
                // position 0 is IMEI in RIL_REQUEST_DEVICE_IDENTITY
                if (req == RIL_REQUEST_DEVICE_IDENTITY) {
                    sb.append(Rlog.pii(RILJ_LOG_TAG, strings[i++]));
                } else {
                    sb.append(strings[i++]);
                }
                while (i < length) {
                    sb.append(", ").append(strings[i++]);
                }
+5 −5

File changed.

Preview size limit exceeded, changes collapsed.

Loading