diff options
| author | 2017-07-07 19:17:27 +0000 | |
|---|---|---|
| committer | 2017-07-07 19:17:27 +0000 | |
| commit | ab78a4707b276a58c758e5a7122a21d75403497b (patch) | |
| tree | ffceac9370ccbfc06c1e72ed9ba0683abcb7878b | |
| parent | eeae0c3253f69cc21ef7c331264a0e3b7fabec7e (diff) | |
| parent | f53f45e06f893d859b2596462fba66a17cb77d99 (diff) | |
Merge "AOD: Block when fingerprint is already authenticated but waiting for goingToSleep to complete" into oc-dr1-dev am: eacef7a03a
am: f53f45e06f
Change-Id: I58f11a9e583a4af800868b47e90636c342425745
5 files changed, 22 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java index 4aff5c630e5f..57fb14e50249 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 179f5b8858ae..ec6caf183c49 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 a5ea967e93be..5af80f546f48 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java @@ -269,6 +269,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 d2371eeb5237..fe3be79ed146 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -5412,6 +5412,15 @@ public class StatusBar extends SystemUI implements DemoMode, } @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 c164a31a6b84..641f2636c6ae 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java +++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java @@ -77,6 +77,11 @@ class DozeHostFake implements DozeHost { } @Override + public boolean isBlockingDoze() { + return false; + } + + @Override public void startPendingIntentDismissingKeyguard(PendingIntent intent) { throw new RuntimeException("not implemented"); } |