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

Commit e387af1c authored by Jason Monk's avatar Jason Monk Committed by android-build-merger
Browse files

am 87343eff: am 28fbe040: Merge "Fix missing subscription list changes" into lmp-mr1-dev

automerge: bce72316

* commit 'bce72316':
  Fix missing subscription list changes
parents 1e954772 bce72316
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -426,6 +426,9 @@ public class NetworkControllerImpl extends BroadcastReceiver
            return;
            return;
        }
        }
        List<SubscriptionInfo> subscriptions = mSubscriptionManager.getActiveSubscriptionInfoList();
        List<SubscriptionInfo> subscriptions = mSubscriptionManager.getActiveSubscriptionInfoList();
        if (subscriptions == null) {
            subscriptions = Collections.emptyList();
        }
        // If there have been no relevant changes to any of the subscriptions, we can leave as is.
        // If there have been no relevant changes to any of the subscriptions, we can leave as is.
        if (hasCorrectMobileControllers(subscriptions)) {
        if (hasCorrectMobileControllers(subscriptions)) {
            // Even if the controllers are correct, make sure we have the right no sims state.
            // Even if the controllers are correct, make sure we have the right no sims state.
@@ -500,10 +503,8 @@ public class NetworkControllerImpl extends BroadcastReceiver
    }
    }


    private boolean hasCorrectMobileControllers(List<SubscriptionInfo> allSubscriptions) {
    private boolean hasCorrectMobileControllers(List<SubscriptionInfo> allSubscriptions) {
        if (allSubscriptions == null) {
        if (allSubscriptions.size() != mMobileSignalControllers.size()) {
            // If null then the system doesn't know the subscriptions yet, instead just wait
            return false;
            // to update the MobileControllers until it knows the state.
            return true;
        }
        }
        for (SubscriptionInfo info : allSubscriptions) {
        for (SubscriptionInfo info : allSubscriptions) {
            if (!mMobileSignalControllers.containsKey(info.getSubscriptionId())) {
            if (!mMobileSignalControllers.containsKey(info.getSubscriptionId())) {
@@ -812,7 +813,8 @@ public class NetworkControllerImpl extends BroadcastReceiver


    private final OnSubscriptionsChangedListener mSubscriptionListener =
    private final OnSubscriptionsChangedListener mSubscriptionListener =
            new OnSubscriptionsChangedListener() {
            new OnSubscriptionsChangedListener() {
        public void onSubscriptionInfoChanged() {
        @Override
        public void onSubscriptionsChanged() {
            updateMobileControllers();
            updateMobileControllers();
        };
        };
    };
    };