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

Commit 8c21b496 authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Cherry-picked "Hide bouncer after unlocking SIM card" to pi-dev

am: 2508afec

Change-Id: I7198fe06dff3ec6ed8fea8ee5dbdc91ac4746f39
parents 806e8cdc 2508afec
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
import static android.view.Display.INVALID_DISPLAY;

import static com.android.internal.telephony.IccCardConstants.State.ABSENT;
import static com.android.internal.telephony.IccCardConstants.State.PIN_REQUIRED;
import static com.android.internal.telephony.IccCardConstants.State.PUK_REQUIRED;
import static com.android.internal.telephony.IccCardConstants.State.READY;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_USER_REQUEST;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT;
@@ -56,6 +59,7 @@ import android.telephony.TelephonyManager;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
import android.view.ViewGroup;
import android.view.WindowManagerPolicyConstants;
import android.view.animation.Animation;
@@ -68,13 +72,13 @@ import com.android.internal.policy.IKeyguardDrawnCallback;
import com.android.internal.policy.IKeyguardExitCallback;
import com.android.internal.policy.IKeyguardStateCallback;
import com.android.internal.telephony.IccCardConstants;
import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardConstants;
import com.android.keyguard.KeyguardDisplayManager;
import com.android.keyguard.KeyguardSecurityView;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.internal.util.LatencyTracker;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.Dependency;
import com.android.systemui.SystemUI;
@@ -272,6 +276,12 @@ public class KeyguardViewMediator extends SystemUI {

    private KeyguardUpdateMonitor mUpdateMonitor;

    /**
     * Last SIM state reported by the telephony system.
     * Index is the slotId - in case of multiple SIM cards.
     */
    private final SparseArray<IccCardConstants.State> mLastSimStates = new SparseArray<>();

    private boolean mDeviceInteractive;
    private boolean mGoingToSleep;

@@ -448,6 +458,14 @@ public class KeyguardViewMediator extends SystemUI {
                }
            }

            boolean simWasLocked;
            synchronized (KeyguardViewMediator.this) {
                IccCardConstants.State lastState = mLastSimStates.get(slotId);
                simWasLocked = (lastState == PIN_REQUIRED || lastState == PUK_REQUIRED)
                    && simState == READY;
                mLastSimStates.append(slotId, simState);
            }

            switch (simState) {
                case NOT_READY:
                case ABSENT:
@@ -503,7 +521,8 @@ public class KeyguardViewMediator extends SystemUI {
                    break;
                case READY:
                    synchronized (KeyguardViewMediator.this) {
                        if (mShowing) {
                        if (DEBUG_SIM_STATES) Log.d(TAG, "READY, reset state? " + mShowing);
                        if (mShowing && simWasLocked) {
                            resetStateLocked();
                        }
                        mLockWhenSimRemoved = true;