summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2018-07-03 19:45:44 -0700
committer android-build-merger <android-build-merger@google.com> 2018-07-03 19:45:44 -0700
commit5d8e53ce889bb7ff8965265e33124ae64dcf30cc (patch)
treefa9f9ee921c0b26c824020b37a9358e0abc3cd7c
parent98138a28371965c2f260e33d024ad6e88a66d8af (diff)
parent0937d1807b4444eec50b18ad47fdbba5a94c34bd (diff)
Merge "DO NOT MERGE: Delay brightness change" into pi-dev
am: 0937d1807b Change-Id: Ib280983ca722add1f89f7a640a4f19c761239de9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java33
1 files changed, 25 insertions, 8 deletions
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 f0b1a82cfc2f..7cb6a192c64a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java
@@ -210,15 +210,28 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
// 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...");
+ // During wake and unlock, we need to draw black before waking up to avoid abrupt
+ // brightness changes due to display state transitions.
+ boolean alwaysOnEnabled = DozeParameters.getInstance(mContext).getAlwaysOn();
+ boolean delayWakeUp = mode == MODE_WAKE_AND_UNLOCK && alwaysOnEnabled;
+ Runnable wakeUp = ()-> {
+ if (!wasDeviceInteractive) {
+ if (DEBUG_FP_WAKELOCK) {
+ Log.i(TAG, "fp wakelock: Authenticated, waking up...");
+ }
+ mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.policy:FINGERPRINT");
+ }
+ if (delayWakeUp) {
+ mKeyguardViewMediator.onWakeAndUnlocking();
}
- mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.policy:FINGERPRINT");
+ Trace.beginSection("release wake-and-unlock");
+ releaseFingerprintWakeLock();
+ Trace.endSection();
+ };
+
+ if (!delayWakeUp) {
+ wakeUp.run();
}
- Trace.beginSection("release wake-and-unlock");
- releaseFingerprintWakeLock();
- Trace.endSection();
switch (mMode) {
case MODE_DISMISS_BOUNCER:
Trace.beginSection("MODE_DISMISS");
@@ -251,7 +264,11 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
mUpdateMonitor.awakenFromDream();
}
mStatusBarWindowManager.setStatusBarFocusable(false);
- mKeyguardViewMediator.onWakeAndUnlocking();
+ if (delayWakeUp) {
+ mHandler.postDelayed(wakeUp, 50);
+ } else {
+ mKeyguardViewMediator.onWakeAndUnlocking();
+ }
if (mStatusBar.getNavigationBarView() != null) {
mStatusBar.getNavigationBarView().setWakeAndUnlocking(true);
}