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

Commit 4325c564 authored by Amit Mahajan's avatar Amit Mahajan Committed by Android (Google) Code Review
Browse files

Merge "Change to ignore onSubscriptionsChanged() in SST if active subId does...

Merge "Change to ignore onSubscriptionsChanged() in SST if active subId does not change." into lmp-mr1-dev
parents de224267 b41cbe42
Loading
Loading
Loading
Loading
+31 −27
Original line number Diff line number Diff line
@@ -226,6 +226,7 @@ public abstract class ServiceStateTracker extends Handler {
    protected SubscriptionManager mSubscriptionManager;
    protected final OnSubscriptionsChangedListener mOnSubscriptionsChangedListener =
            new OnSubscriptionsChangedListener() {
        private int lastActiveSubId = -1; // < 0 is invalid subId
        /**
         * Callback invoked when there is any change to any SubscriptionInfo. Typically
         * this method would invoke {@link SubscriptionManager#getActiveSubscriptionInfoList}
@@ -236,6 +237,8 @@ public abstract class ServiceStateTracker extends Handler {
            // Set the network type, in case the radio does not restore it.
            int subId = mPhoneBase.getSubId();
            if (SubscriptionManager.isValidSubscriptionId(subId)) {
                if (lastActiveSubId != subId) {
                    lastActiveSubId = subId;
                    int networkType = PhoneFactory.calculatePreferredNetworkType(
                            mPhoneBase.getContext(), subId);
                    mCi.setPreferredNetworkType(networkType, null);
@@ -270,6 +273,7 @@ public abstract class ServiceStateTracker extends Handler {
                        ServiceState.rilRadioTechnologyToString(mSS.getRilDataRadioTechnology()));
                }
            }
        }
    };

    protected ServiceStateTracker(PhoneBase phoneBase, CommandsInterface ci, CellInfo cellInfo) {