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

Commit b880afe7 authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Only force doze brightness when actually unlocking

Previously, we forced the doze brightness even if we acquired a bad fingerprint;
because the state got never reset, the keyguard can be stuck in a dark mode.

We do not need to force the brightness until we wake up though, so this can be
delayed until we know if the unlock is going to succeed.

Change-Id: I72f4a577134223831b1bb0baefdbc227d8e8bab4
Fixes: 63931486
Test: Set up fingerprint; go to AOD; tap wrong finger; press power button; verify screen is fully on and not dim.
parent aaf38609
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -163,14 +163,6 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
            }
            mHandler.postDelayed(mReleaseFingerprintWakeLockRunnable,
                    FINGERPRINT_WAKELOCK_TIMEOUT_MS);

            if (pulsingOrAod()) {
                // If we are waking the device up while we are pulsing the clock and the
                // notifications would light up first, creating an unpleasant animation.
                // Defer changing the screen brightness by forcing doze brightness on our window
                // until the clock and the notifications are faded out.
                mStatusBarWindowManager.setForceDozeBrightness(true);
            }
        }
        Trace.endSection();
    }
@@ -191,6 +183,13 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
        }
        boolean wasDeviceInteractive = mUpdateMonitor.isDeviceInteractive();
        mMode = calculateMode();
        if (mMode == MODE_WAKE_AND_UNLOCK_PULSING && pulsingOrAod()) {
            // If we are waking the device up while we are pulsing the clock and the
            // notifications would light up first, creating an unpleasant animation.
            // Defer changing the screen brightness by forcing doze brightness on our window
            // until the clock and the notifications are faded out.
            mStatusBarWindowManager.setForceDozeBrightness(true);
        }
        if (!wasDeviceInteractive) {
            if (DEBUG_FP_WAKELOCK) {
                Log.i(TAG, "fp wakelock: Authenticated, waking up...");
@@ -240,9 +239,6 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
            case MODE_NONE:
                break;
        }
        if (mMode != MODE_WAKE_AND_UNLOCK_PULSING) {
            mStatusBarWindowManager.setForceDozeBrightness(false);
        }
        mStatusBar.notifyFpAuthModeChanged();
        Trace.endSection();
    }