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

Commit 078f5919 authored by Brian Colonna's avatar Brian Colonna
Browse files

FUL being unsuppressed when screen turns off fixes b/7453702

We suppress FUL when the device first boots because with all of the
things happening at boot, we don't want to interact with the camera.
We also suppress it immediately after a user switch for the same
reasons.  However, once the user turns the screen off, we want to
show FUL when they turn it back on.  Prior to this fix it was only
being unsuppressed on login.

Note that this CL also removes the isFirstBoot flag.  It was only
being set/checked when the suppress flag was set/checked, so it was
redundant.

This also addresses bug b/7450665, which is regarding the
user-switch case.

Change-Id: I2b39e85e21c08ef7629398521ab1159f5a6c7547
parent 1b33342b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -421,8 +421,8 @@ public class KeyguardHostView extends KeyguardViewBase {
    void showPrimarySecurityScreen(boolean turningOff) {
        SecurityMode securityMode = mSecurityModel.getSecurityMode();
        if (DEBUG) Log.v(TAG, "showPrimarySecurityScreen(turningOff=" + turningOff + ")");
        if (!turningOff && KeyguardUpdateMonitor.getInstance(mContext).isAlternateUnlockEnabled()
                && !KeyguardUpdateMonitor.getInstance(mContext).getIsFirstBoot()) {
        if (!turningOff &&
                KeyguardUpdateMonitor.getInstance(mContext).isAlternateUnlockEnabled()) {
            // If we're not turning off, then allow biometric alternate.
            // We'll reload it when the device comes back on.
            securityMode = mSecurityModel.getAlternateFor(securityMode);
@@ -498,7 +498,6 @@ public class KeyguardHostView extends KeyguardViewBase {
            // If the alternate unlock was suppressed, it can now be safely
            // enabled because the user has left keyguard.
            KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
            KeyguardUpdateMonitor.getInstance(mContext).setIsFirstBoot(false);

            // If there's a pending runnable because the user interacted with a widget
            // and we're leaving keyguard, then run it.
@@ -710,6 +709,9 @@ public class KeyguardHostView extends KeyguardViewBase {
    @Override
    public void onScreenTurnedOff() {
        if (DEBUG) Log.d(TAG, "screen off, instance " + Integer.toHexString(hashCode()));
        // Once the screen turns off, we no longer consider this to be first boot and we want the
        // biometric unlock to start next time keyguard is shown.
        KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
        saveStickyWidgetIndex();
        showPrimarySecurityScreen(true);
        getSecurityView(mCurrentSecuritySelection).onPause();
+0 −9
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ public class KeyguardUpdateMonitor {
            }
        }
    };
    private boolean mIsFirstBoot;

    /**
     * When we receive a
@@ -778,12 +777,4 @@ public class KeyguardUpdateMonitor {
                || simState == IccCardConstants.State.PUK_REQUIRED
                || simState == IccCardConstants.State.PERM_DISABLED);
    }

    public void setIsFirstBoot(boolean b) {
        mIsFirstBoot = b;
    }
    
    public boolean getIsFirstBoot() {
        return mIsFirstBoot;
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -522,7 +522,6 @@ public class KeyguardViewMediator {

            // Disable alternate unlock right after boot until things have settled.
            mUpdateMonitor.setAlternateUnlockEnabled(false);
            mUpdateMonitor.setIsFirstBoot(true);

            doKeyguardLocked();
        }