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

Commit b41cbe42 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Change to ignore onSubscriptionsChanged() in SST if active subId does not

change.

Bug: 18718732
Change-Id: Ib08b62e860d0b6286272836e649cd2c171adc37e
parent c6cbdea1
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) {