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

Commit 635c115c authored by Jon Miranda's avatar Jon Miranda Committed by Jonathan Miranda
Browse files

Calls cancel on mDimAnimator to ensure that ref counts are accurate.

When we used cancelAnimationWithoutCallbacks on mDimAnimator,
the decrementOnAnimationEnd listener is removed. This created
a bug where the ReferenceCountedTrigger was not able to
flush its last decrement runnables.

ie. The Close icon was not always visible for the apps in Recents/Overview.

Bug: 37132803
Test: Manual testing.
Change-Id: Idbb1a1e42313db71328990577b3163b0d16b28d6
parent af4bfcdb
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -362,11 +362,17 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
     * Cancels any current transform animations.
     */
    public void cancelTransformAnimation() {
        cancelDimAnimationIfExists();
        Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation);
        Utilities.cancelAnimationWithoutCallbacks(mDimAnimator);
        Utilities.cancelAnimationWithoutCallbacks(mOutlineAnimator);
    }

    private void cancelDimAnimationIfExists() {
        if (mDimAnimator != null) {
            mDimAnimator.cancel();
        }
    }

    /** Enables/disables handling touch on this task view. */
    public void setTouchEnabled(boolean enabled) {
        setOnClickListener(enabled ? this : null);
@@ -546,7 +552,7 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
    @Override
    public void onStartLaunchTargetEnterAnimation(TaskViewTransform transform, int duration,
            boolean screenPinningEnabled, ReferenceCountedTrigger postAnimationTrigger) {
        Utilities.cancelAnimationWithoutCallbacks(mDimAnimator);
        cancelDimAnimationIfExists();

        // Dim the view after the app window transitions down into recents
        postAnimationTrigger.increment();