diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java index 180b3caab65be..b39304e5de1d9 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java @@ -32,6 +32,7 @@ public interface DozeHost { boolean isPowerSaveActive(); boolean isPulsingBlocked(); boolean isProvisioned(); + boolean isBlockingDoze(); void startPendingIntentDismissingKeyguard(PendingIntent intent); void abortPulsing(); diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java index 179f5b8858ae0..ec6caf183c49d 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java @@ -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); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java index 3dd20b1beb491..a73f4b0dbdf12 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java @@ -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; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 877c3d2d1afed..9c0b0dce45ce3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -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); diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java index 8ff9fa9fe6f36..1d4b7e9434ba6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java +++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java @@ -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");