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

Commit b6ecf8d3 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Check if the SIM is secure before dispatching swipe to unlock." into...

Merge "Check if the SIM is secure before dispatching swipe to unlock." into sc-v2-dev am: bbfe4b8f am: c3106514

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16614131

Change-Id: Ia2a4f29459e698f0bfd1331d1482f55c7f9de827
parents 23d8300a c3106514
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1688,6 +1688,21 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
                || mUpdateMonitor.isSimPinSecure();
    }

    /**
     * Whether any of the SIMs on the device are secured with a PIN. If so, the keyguard should not
     * be dismissable until the PIN is entered, even if the device itself has no lock set.
     */
    public boolean isAnySimPinSecure() {
        for (int i = 0; i < mLastSimStates.size(); i++) {
            final int key = mLastSimStates.keyAt(i);
            if (KeyguardUpdateMonitor.isSimPinSecure(mLastSimStates.get(key))) {
                return true;
            }
        }

        return false;
    }

    public void setSwitchingUser(boolean switching) {
        mUpdateMonitor.setSwitchingUser(switching);
    }
+4 −0
Original line number Diff line number Diff line
@@ -1359,10 +1359,14 @@ public class StatusBar extends CoreStartable implements
        // Things that mean we're not dismissing the keyguard, and should ignore this expansion:
        // - Keyguard isn't even visible.
        // - Keyguard is visible, but can't be dismissed (swiping up will show PIN/password prompt).
        // - The SIM is locked, you can't swipe to unlock. If the SIM is locked but there is no
        //   device lock set, canDismissLockScreen returns true even though you should not be able
        //   to dismiss the lock screen until entering the SIM PIN.
        // - QS is expanded and we're swiping - swiping up now will hide QS, not dismiss the
        //   keyguard.
        if (!isKeyguardShowing()
                || !mKeyguardStateController.canDismissLockScreen()
                || mKeyguardViewMediator.isAnySimPinSecure()
                || (mNotificationPanelViewController.isQsExpanded() && trackingTouch)) {
            return;
        }