OSDN Git Service

AOD: Fix shelf animating when it should not
authorAdrian Roos <roosa@google.com>
Mon, 7 Aug 2017 13:52:26 +0000 (15:52 +0200)
committerAdrian Roos <roosa@google.com>
Mon, 7 Aug 2017 13:52:26 +0000 (15:52 +0200)
Fixes an issue where the shelf would animate downwards when going to AOD.

The issue is that setDark gets called in updateIsKeyguard even though nothing changed,
yet it still re-requests the dark transition. Consequently, when the keyguard goes dark
later, the requested transition executes and moves the shelf downwards.

Change-Id: I8c590aeb4f330d8c3c1b51285d899d5f6db36323
Fixes: 64412244
Test: Double tap on notification on AOD2; press power; verify shelf does not move downwards

packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java

index 4bbe895..291ec1a 100644 (file)
@@ -3714,6 +3714,9 @@ public class NotificationStackScrollLayout extends ViewGroup
      * See {@link AmbientState#setDark}.
      */
     public void setDark(boolean dark, boolean animate, @Nullable PointF touchWakeUpScreenLocation) {
+        if (mAmbientState.isDark() == dark) {
+            return;
+        }
         mAmbientState.setDark(dark);
         if (animate && mAnimationsEnabled) {
             mDarkNeedsAnimation = true;