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

Commit 7cc7b08a authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Make sure callback is only called once

Because we set it already in the future, it was called already
when we fetched the contents of the future, because it looked
like we overrided the callback. Instead, don't do callbacks
when calling the future, and save the callback in a separate
field.

Bug: 25568693
Change-Id: I8b7fd4248a2336470f8b7e12b64b0577dee96f6f
parent 68ce6dc1
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ public class AppTransition implements Dump {
    // Used for thumbnail transitions. True if we're scaling up, false if scaling down
    private boolean mNextAppTransitionScaleUp;
    private IRemoteCallback mNextAppTransitionCallback;
    private IRemoteCallback mNextAppTransitionFutureCallback;
    private IRemoteCallback mAnimationFinishedCallback;
    private int mNextAppTransitionEnter;
    private int mNextAppTransitionExit;
@@ -1448,10 +1449,7 @@ public class AppTransition implements Dump {
            mNextAppTransitionAnimationsSpecs.clear();
            mNextAppTransitionAnimationsSpecsFuture = specsFuture;
            mNextAppTransitionScaleUp = scaleUp;
            postAnimationCallback();
            mNextAppTransitionCallback = callback;
        } else {
            postAnimationCallback();
            mNextAppTransitionFutureCallback = callback;
        }
    }

@@ -1486,8 +1484,10 @@ public class AppTransition implements Dump {
                    }
                    synchronized (mServiceLock) {
                        mNextAppTransitionAnimationsSpecsPending = false;
                        overridePendingAppTransitionMultiThumb(specs, mNextAppTransitionCallback,
                                null /* finishedCallback */, mNextAppTransitionScaleUp);
                        overridePendingAppTransitionMultiThumb(specs,
                                mNextAppTransitionFutureCallback, null /* finishedCallback */,
                                mNextAppTransitionScaleUp);
                        mNextAppTransitionFutureCallback = null;
                        mWindowSurfacePlacer.requestTraversal();
                    }
                }