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

Commit 29deb334 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Reset mAppTransitionAnimationSpecs so they are only used once

Because we didn't reset it after sending it to window manager,
they were used again in the next transition, leading to a
wrong animation.

Also fix a bug where we waited forever because
getAppTransitionAnimationSpecs returned null.

Bug: 25583739
Change-Id: Ifcccf2d3cee649f66b4ded1d92c059acfa02ba5b
parent 7af8ea8a
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -79,6 +79,13 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
    private static final boolean DEBUG = false;

    private static final boolean ADD_HEADER_BITMAP = true;

    /**
     * Special value for {@link #mAppTransitionAnimationSpecs}: Indicate that we are currently
     * waiting for the specs to be retrieved.
     */
    private static final List<AppTransitionAnimationSpec> SPECS_WAITING = new ArrayList<>();

    private int mStackViewVisibility = View.VISIBLE;

    /** The RecentsView callbacks */
@@ -109,7 +116,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV


    @GuardedBy("this")
    List<AppTransitionAnimationSpec> mAppTransitionAnimationSpecs;
    List<AppTransitionAnimationSpec> mAppTransitionAnimationSpecs = SPECS_WAITING;

    public RecentsView(Context context) {
        super(context);
@@ -439,7 +446,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
                    }
                });
                synchronized (RecentsView.this) {
                    while (mAppTransitionAnimationSpecs == null) {
                    while (mAppTransitionAnimationSpecs == SPECS_WAITING) {
                        try {
                            RecentsView.this.wait();
                        } catch (InterruptedException e) {}
@@ -449,7 +456,9 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
                    }
                    AppTransitionAnimationSpec[] specs
                            = new AppTransitionAnimationSpec[mAppTransitionAnimationSpecs.size()];
                    return mAppTransitionAnimationSpecs.toArray(specs);
                    mAppTransitionAnimationSpecs.toArray(specs);
                    mAppTransitionAnimationSpecs = SPECS_WAITING;
                    return specs;
                }
            }
        };