summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2016-05-24 13:33:47 -0700
committer Selim Cinek <cinek@google.com> 2016-05-24 14:22:21 -0700
commitea66ca02251e35c719822639cb2baf9ab4ba76e4 (patch)
tree9b71fcb0a4ac1591b312e2e5907d5f4621e97141
parentc22fff6cf6cc030838b6c0435c5a2bc011653291 (diff)
Fixed a few battery issues in SystemUI
Fixed a bug where animators could run forever because of a negative start delay. Also fixed a bug where the shadow would continuously update when it shouldn't. Change-Id: Id115d179d99fecf72c5f2b3be1a4c8590361469e Fixes: 28930837
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 439a6308a761..5a593d4004ac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -2494,9 +2494,9 @@ public class NotificationStackScrollLayout extends ViewGroup
mNeedsAnimation = false;
}
if (!mAnimationEvents.isEmpty() || isCurrentlyAnimating()) {
+ setAnimationRunning(true);
mStateAnimator.startAnimationForEvents(mAnimationEvents, mCurrentStackScrollState,
mGoToFullShadeDelay);
- setAnimationRunning(true);
mAnimationEvents.clear();
updateBackground();
updateViewShadows();
@@ -3124,6 +3124,7 @@ public class NotificationStackScrollLayout extends ViewGroup
mListener.onChildLocationsChanged(this);
}
runAnimationFinishedRunnables();
+ setAnimationRunning(false);
updateBackground();
updateViewShadows();
}
@@ -3239,6 +3240,7 @@ public class NotificationStackScrollLayout extends ViewGroup
maxLength = Math.max(mDarkAnimationOriginIndex,
getNotGoneChildCount() - mDarkAnimationOriginIndex - 1);
}
+ maxLength = Math.max(0, maxLength);
long delay = maxLength * StackStateAnimator.ANIMATION_DELAY_PER_ELEMENT_DARK;
fadeAnimator.setStartDelay(delay);
fadeAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);