OSDN Git Service

Fix issue where pulse callback would be delayed
authorLucas Dupin <dupin@google.com>
Tue, 6 Feb 2018 05:16:39 +0000 (21:16 -0800)
committerLucas Dupin <dupin@google.com>
Tue, 6 Feb 2018 06:30:43 +0000 (22:30 -0800)
Test: double tap device with LCD display, press power, repeat
Test: double tap device with OLED display, press power, repeat
Fixes: 69935953
Fixes: 72959137
Change-Id: I12f53bfc4646f6a247c66771d2a4a24675430057

packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java

index 44e0c25..59c44ed 100644 (file)
@@ -276,13 +276,18 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
             mWallpaperVisibilityTimedOut = false;
         }
 
-        if (!mKeyguardUpdateMonitor.needsSlowUnlockTransition()) {
-            scheduleUpdate();
-        } else {
+        if (mKeyguardUpdateMonitor.needsSlowUnlockTransition() && mState == ScrimState.UNLOCKED) {
             // In case the user isn't unlocked, make sure to delay a bit because the system is hosed
             // with too many things at this case, in order to not skip the initial frames.
             mScrimInFront.postOnAnimationDelayed(this::scheduleUpdate, 16);
             mAnimationDelay = StatusBar.FADE_KEYGUARD_START_DELAY;
+        } else if (!mDozeParameters.getAlwaysOn() && oldState == ScrimState.AOD) {
+            // Execute first frame immediately when display was completely off.
+            // Scheduling a frame isn't enough because the system may aggressively enter doze,
+            // delaying callbacks or never triggering them until the power button is pressed.
+            onPreDraw();
+        } else {
+            scheduleUpdate();
         }
     }