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

Commit 3ebb983f authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am e5c8dd51: am 40dc7774: Treat a SIM power cycle as first boot.

* commit 'e5c8dd51':
  Treat a SIM power cycle as first boot.
parents 3ac3e618 e5c8dd51
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import com.android.internal.telephony.dataconnection.DcTrackerBase;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
@@ -236,9 +237,11 @@ public abstract class ServiceStateTracker extends Handler {

    protected SubscriptionManager mSubscriptionManager;
    protected SubscriptionController mSubscriptionController;
    protected final OnSubscriptionsChangedListener mOnSubscriptionsChangedListener =
            new OnSubscriptionsChangedListener() {
        private int previousSubId = -1; // < 0 is invalid subId
    protected final SstSubscriptionsChangedListener mOnSubscriptionsChangedListener =
        new SstSubscriptionsChangedListener();

    protected class SstSubscriptionsChangedListener extends OnSubscriptionsChangedListener {
        public final AtomicInteger mPreviousSubId = new AtomicInteger(-1); // < 0 is invalid subId
        /**
         * Callback invoked when there is any change to any SubscriptionInfo. Typically
         * this method would invoke {@link SubscriptionManager#getActiveSubscriptionInfoList}
@@ -248,8 +251,7 @@ public abstract class ServiceStateTracker extends Handler {
            if (DBG) log("SubscriptionListener.onSubscriptionInfoChanged");
            // Set the network type, in case the radio does not restore it.
            int subId = mPhoneBase.getSubId();
            if (previousSubId != subId) {
                previousSubId = subId;
            if (mPreviousSubId.getAndSet(subId) != subId) {
                if (SubscriptionManager.isValidSubscriptionId(subId)) {
                    Context context = mPhoneBase.getContext();
                    int networkType = PhoneFactory.calculatePreferredNetworkType(context, subId);
+3 −0
Original line number Diff line number Diff line
@@ -315,6 +315,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                break;

            case EVENT_SIM_READY:
                // Reset the mPreviousSubId so we treat a SIM power bounce
                // as a first boot.  See b/19194287
                mOnSubscriptionsChangedListener.mPreviousSubId.set(-1);
                pollState();
                // Signal strength polling stops when radio is off
                queueNextSignalStrengthPoll();