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

Commit 710a0b13 authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Block when fingerprint is already authenticated but waiting for goingToSleep to complete

Improves an issue where immediately triggering fingerprint after
the devices goes to sleep results in a lot of flickering.

There's still flicker however if the fingerprint authenticates after we've requested the AOD
display state, but before it has actually been applied.

Bug: 62887179
Test: Go to Home. Lock screen. Immediately unlock via fingerprint. Verify that the AOD screen does not even show.
Change-Id: Ib6425eee803a8c7e02f9621a571e562e825af57f
parent feb5dc3b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ public interface DozeHost {
    boolean isPowerSaveActive();
    boolean isPulsingBlocked();
    boolean isProvisioned();
    boolean isBlockingDoze();

    void startPendingIntentDismissingKeyguard(PendingIntent intent);
    void abortPulsing();
+1 −0
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ public class DozeTriggers implements DozeMachine.Part {
    private void checkTriggersAtInit() {
        if (mUiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR
                || mDozeHost.isPowerSaveActive()
                || mDozeHost.isBlockingDoze()
                || !mDozeHost.isProvisioned()) {
            mMachine.requestState(DozeMachine.State.FINISH);
        }
+6 −0
Original line number Diff line number Diff line
@@ -263,6 +263,12 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
        Trace.endSection();
    }

    public boolean hasPendingAuthentication() {
        return mPendingAuthenticatedUserId != -1
                && mUpdateMonitor.isUnlockingWithFingerprintAllowed()
                && mPendingAuthenticatedUserId == KeyguardUpdateMonitor.getCurrentUser();
    }

    public int getMode() {
        return mMode;
    }
+9 −0
Original line number Diff line number Diff line
@@ -5398,6 +5398,15 @@ public class StatusBar extends SystemUI implements DemoMode,
                    && mDeviceProvisionedController.isCurrentUserSetup();
        }

        @Override
        public boolean isBlockingDoze() {
            if (mFingerprintUnlockController.hasPendingAuthentication()) {
                Log.i(TAG, "Blocking AOD because fingerprint has authenticated");
                return true;
            }
            return false;
        }

        @Override
        public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
            StatusBar.this.startPendingIntentDismissingKeyguard(intent);
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ class DozeHostFake implements DozeHost {
        return false;
    }

    @Override
    public boolean isBlockingDoze() {
        return false;
    }

    @Override
    public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
        throw new RuntimeException("not implemented");