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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user