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

Commit 4c507046 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Isolate DPM and SIM PIN states from UX

User should still be able to swipe up to retry or still see
the bypass lock screen when face auth is disabled or sim
card is locked. Having different UX on those cases is
confusing.

Bug: 138125943
Change-Id: Iece4d28e7a988af846c9e8aa9eb0fff5a1d74249
parent 2738aa3f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -269,7 +269,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
     */
     */
    private void updateBiometricRetry() {
    private void updateBiometricRetry() {
        SecurityMode securityMode = getSecurityMode();
        SecurityMode securityMode = getSecurityMode();
        mSwipeUpToRetry = mUnlockMethodCache.isUnlockingWithFacePossible()
        mSwipeUpToRetry = mUnlockMethodCache.isFaceAuthEnabled()
                && securityMode != SecurityMode.SimPin
                && securityMode != SecurityMode.SimPin
                && securityMode != SecurityMode.SimPuk
                && securityMode != SecurityMode.SimPuk
                && securityMode != SecurityMode.None;
                && securityMode != SecurityMode.None;
+5 −3
Original line number Original line Diff line number Diff line
@@ -1783,13 +1783,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                && mFpm.getEnrolledFingerprints(userId).size() > 0;
                && mFpm.getEnrolledFingerprints(userId).size() > 0;
    }
    }


    private boolean isUnlockWithFacePossible(int userId) {
        return isFaceAuthEnabledForUser(userId) && !isFaceDisabled(userId);
    }

    /**
    /**
     * If face hardware is available, user has enrolled and enabled auth via setting.
     * If face hardware is available, user has enrolled and enabled auth via setting.
     * Not considering encryption or lock down state.
     */
     */
    public boolean isUnlockWithFacePossible(int userId) {
    public boolean isFaceAuthEnabledForUser(int userId) {
        return mFaceManager != null && mFaceManager.isHardwareDetected()
        return mFaceManager != null && mFaceManager.isHardwareDetected()
                && !isFaceDisabled(userId)
                && mFaceManager.hasEnrolledTemplates(userId)
                && mFaceManager.hasEnrolledTemplates(userId)
                && mFaceSettingEnabledForUser.get(userId);
                && mFaceSettingEnabledForUser.get(userId);
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -170,7 +170,7 @@ public class KeyguardBouncer {


        // Split up the work over multiple frames.
        // Split up the work over multiple frames.
        DejankUtils.removeCallbacks(mResetRunnable);
        DejankUtils.removeCallbacks(mResetRunnable);
        if (mUnlockMethodCache.isUnlockingWithFacePossible() && !needsFullscreenBouncer()
        if (mUnlockMethodCache.isFaceAuthEnabled() && !needsFullscreenBouncer()
                && !mKeyguardUpdateMonitor.userNeedsStrongAuth()) {
                && !mKeyguardUpdateMonitor.userNeedsStrongAuth()) {
            mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY);
            mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY);
        } else {
        } else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -47,7 +47,7 @@ class KeyguardBypassController {
     * If face unlock dismisses the lock screen or keeps user on keyguard for the current user.
     * If face unlock dismisses the lock screen or keeps user on keyguard for the current user.
     */
     */
    var bypassEnabled: Boolean = false
    var bypassEnabled: Boolean = false
        get() = field && unlockMethodCache.isUnlockingWithFacePossible
        get() = field && unlockMethodCache.isFaceAuthEnabled
        private set
        private set


    var bouncerShowing: Boolean = false
    var bouncerShowing: Boolean = false
+4 −0
Original line number Original line Diff line number Diff line
@@ -2388,6 +2388,10 @@ public class StatusBar extends SystemUI implements DemoMode,
            mLightBarController.dump(fd, pw, args);
            mLightBarController.dump(fd, pw, args);
        }
        }


        if (mUnlockMethodCache != null) {
            mUnlockMethodCache.dump(pw);
        }

        if (mKeyguardBypassController != null) {
        if (mKeyguardBypassController != null) {
            mKeyguardBypassController.dump(pw);
            mKeyguardBypassController.dump(pw);
        }
        }
Loading