diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-05-24 17:17:45 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-24 17:20:10 -0700 |
commit | 55d1e44c47d118e23c0ec452c5e5b31e8cd32690 (patch) | |
tree | b85e62ab4ccb75c4e4e7057ef717aee3119dc9cb | |
parent | 3831fc99dc198ee532cbcdaa3d1adf00fd70d06b (diff) | |
download | android_packages_apps_Trebuchet-55d1e44c47d118e23c0ec452c5e5b31e8cd32690.tar.gz android_packages_apps_Trebuchet-55d1e44c47d118e23c0ec452c5e5b31e8cd32690.tar.bz2 android_packages_apps_Trebuchet-55d1e44c47d118e23c0ec452c5e5b31e8cd32690.zip |
Fixing user getting stuck in quick-switch state
If we are cancelled after the animation has completed, but before the deferred frame
was captured, we set the state as cancelled, and start the new consumer with the
existing recents controller.
But after the deferred frame, we finish the controller (and since the state was set to
cancelled, do not launch the new task)
Bug: 132756514
Change-Id: If30af713c76b6d895d0b01b93d31c0e1403b7214
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index a1bcb9bf2..ffef1cf32 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -1261,7 +1261,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> } else { taskView = mRecentsView.updateThumbnail(mRunningTaskId, mTaskSnapshot); } - if (taskView != null) { + if (taskView != null && !mCanceled) { // Defer finishing the animation until the next launcher frame with the // new thumbnail finishTransitionPosted = new WindowCallbacksCompat(taskView) { @@ -1271,6 +1271,13 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> @Override public void onPostDraw(Canvas canvas) { + // If we were cancelled after this was attached, do not update + // the state. + if (mCanceled) { + detach(); + return; + } + if (mDeferFrameCount > 0) { mDeferFrameCount--; // Workaround, detach and reattach to invalidate the root node for |