Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea66ca02 authored by Selim Cinek's avatar Selim Cinek
Browse files

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
parent c22fff6c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);