Launcher3: Do not attach cleanupScreenshot() to frame update event
When the animation get canceled, cleanupScreenshot() should be run instantly because it does something like removing pending animations. The switchToScreenshot() attaches it to RtFrameCallback which only be called on frame update. This is leading to problems as the next frame update may only happened when the next gesture starts, which means all the pending animations will be removed on next gesture. And then the next gesture freezed. Fixes randomly gesture freeze since 12L. Change-Id: I10247294a2dcae467706c434685b299f8b525888 Signed-off-by: LibXZR <i@xzr.moe>
This commit is contained in:
parent
a983a3c2e2
commit
b1c71f95ab
|
@ -505,15 +505,13 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
|||
HashMap<Integer, ThumbnailData> snapshots =
|
||||
mGestureState.consumeRecentsAnimationCanceledSnapshot();
|
||||
if (snapshots != null) {
|
||||
mRecentsView.switchToScreenshot(snapshots, () -> {
|
||||
if (mRecentsAnimationController != null) {
|
||||
mRecentsAnimationController.cleanupScreenshot();
|
||||
} else if (mDeferredCleanupRecentsAnimationController != null) {
|
||||
mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
|
||||
mDeferredCleanupRecentsAnimationController = null;
|
||||
}
|
||||
});
|
||||
mRecentsView.onRecentsAnimationComplete();
|
||||
if (mRecentsAnimationController != null) {
|
||||
mRecentsAnimationController.cleanupScreenshot();
|
||||
} else if (mDeferredCleanupRecentsAnimationController != null) {
|
||||
mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
|
||||
mDeferredCleanupRecentsAnimationController = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue