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

Commit 7131f1a9 authored by Sanket Padawe's avatar Sanket Padawe Committed by Android (Google) Code Review
Browse files

Merge "Prevent sim notify popup after upgrade from k to LMR1." into lmp-mr1-dev

parents d0591276 9b566a09
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class SimBootReceiver extends BroadcastReceiver {
    private static final int NOTIFICATION_ID = 1;
    private static final String SHARED_PREFERENCES_NAME = "sim_state";
    private static final String SLOT_PREFIX = "sim_slot_";
    private static final int INVALID_SLOT = -2; // Used when upgrading from K to LMR1

    private SharedPreferences mSharedPreferences = null;
    private TelephonyManager mTelephonyManager;
@@ -91,7 +92,9 @@ public class SimBootReceiver extends BroadcastReceiver {
            if (sir != null) {
                numSIMsDetected++;
                final int currentSubId = sir.getSubscriptionId();
                if (lastSubId != currentSubId) {
                if (lastSubId == INVALID_SLOT) {
                    setLastSubId(key, currentSubId);
                } else if (lastSubId != currentSubId) {
                    createNotification(mContext);
                    setLastSubId(key, currentSubId);
                    notificationSent = true;
@@ -118,7 +121,7 @@ public class SimBootReceiver extends BroadcastReceiver {
    }

    private int getLastSubId(String strSlotId) {
        return mSharedPreferences.getInt(strSlotId, SLOT_EMPTY);
        return mSharedPreferences.getInt(strSlotId, INVALID_SLOT);
    }

    private void setLastSubId(String strSlotId, int value) {