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

Commit df4da372 authored by Pablo Gamito's avatar Pablo Gamito Committed by Automerger Merge Worker
Browse files

Merge "Start edge extension animations in sync" into tm-dev am: 7ecba896 am:...

Merge "Start edge extension animations in sync" into tm-dev am: 7ecba896 am: 288efbce am: c3cc63ae

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18176062



Change-Id: I4257078765c3f1aac16a2379b01f8256d6a8c52c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0c9bf3ff c3cc63ae
Loading
Loading
Loading
Loading
+12 −4
Original line number Original line Diff line number Diff line
@@ -158,7 +158,7 @@ class SurfaceAnimationRunner {
    void continueStartingAnimations() {
    void continueStartingAnimations() {
        synchronized (mLock) {
        synchronized (mLock) {
            mAnimationStartDeferred = false;
            mAnimationStartDeferred = false;
            if (!mPendingAnimations.isEmpty()) {
            if (!mPendingAnimations.isEmpty() && mPreProcessingAnimations.isEmpty()) {
                mChoreographer.postFrameCallback(this::startAnimations);
                mChoreographer.postFrameCallback(this::startAnimations);
            }
            }
        }
        }
@@ -204,7 +204,7 @@ class SurfaceAnimationRunner {


                            mPreProcessingAnimations.remove(animationLeash);
                            mPreProcessingAnimations.remove(animationLeash);
                            mPendingAnimations.put(animationLeash, runningAnim);
                            mPendingAnimations.put(animationLeash, runningAnim);
                            if (!mAnimationStartDeferred) {
                            if (!mAnimationStartDeferred && mPreProcessingAnimations.isEmpty()) {
                                mChoreographer.postFrameCallback(this::startAnimations);
                                mChoreographer.postFrameCallback(this::startAnimations);
                            }
                            }
                        }
                        }
@@ -214,7 +214,7 @@ class SurfaceAnimationRunner {


            if (!requiresEdgeExtension) {
            if (!requiresEdgeExtension) {
                mPendingAnimations.put(animationLeash, runningAnim);
                mPendingAnimations.put(animationLeash, runningAnim);
                if (!mAnimationStartDeferred) {
                if (!mAnimationStartDeferred && mPreProcessingAnimations.isEmpty()) {
                    mChoreographer.postFrameCallback(this::startAnimations);
                    mChoreographer.postFrameCallback(this::startAnimations);
                }
                }


@@ -330,6 +330,14 @@ class SurfaceAnimationRunner {


    private void startAnimations(long frameTimeNanos) {
    private void startAnimations(long frameTimeNanos) {
        synchronized (mLock) {
        synchronized (mLock) {
            if (!mPreProcessingAnimations.isEmpty()) {
                // We only want to start running animations once all mPreProcessingAnimations have
                // been processed to ensure preprocessed animations start in sync.
                // NOTE: This means we might delay running animations that require preprocessing if
                // new animations that also require preprocessing are requested before the previous
                // ones have finished (see b/227449117).
                return;
            }
            startPendingAnimationsLocked();
            startPendingAnimationsLocked();
        }
        }
        mPowerManagerInternal.setPowerBoost(Boost.INTERACTION, 0);
        mPowerManagerInternal.setPowerBoost(Boost.INTERACTION, 0);