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
This commit is contained in:
Selim Cinek
2016-05-24 13:33:47 -07:00
parent c22fff6cf6
commit ea66ca0225

View File

@@ -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);