diff options
author | Winson Chung <winsonc@google.com> | 2018-10-02 16:19:29 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2018-10-02 23:22:09 +0000 |
commit | f8e04b64645034b2abc748f96508e2680a2c566b (patch) | |
tree | 5cf7e6a4cda894e5017394e5678f44aafbaa8211 /quickstep/src/com/android/quickstep/QuickScrubController.java | |
parent | 899b87cc6b393163c6594d0c9fe97a185908171b (diff) | |
download | android_packages_apps_Trebuchet-f8e04b64645034b2abc748f96508e2680a2c566b.tar.gz android_packages_apps_Trebuchet-f8e04b64645034b2abc748f96508e2680a2c566b.tar.bz2 android_packages_apps_Trebuchet-f8e04b64645034b2abc748f96508e2680a2c566b.zip |
Break out of quickscrub if task fails to launch
- Return the user to their previous state if quickscrub fails to launch
the new task (ie. if it finishes itself mid-launch).
Bug: 117163033
Change-Id: If03cf0431be40d9b81dfcc5dffcb2bf4844bbbd2
Diffstat (limited to 'quickstep/src/com/android/quickstep/QuickScrubController.java')
-rw-r--r-- | quickstep/src/com/android/quickstep/QuickScrubController.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/QuickScrubController.java b/quickstep/src/com/android/quickstep/QuickScrubController.java index 943225647..34207670e 100644 --- a/quickstep/src/com/android/quickstep/QuickScrubController.java +++ b/quickstep/src/com/android/quickstep/QuickScrubController.java @@ -67,6 +67,7 @@ public class QuickScrubController implements OnAlarmListener { private int mQuickScrubSection; private boolean mStartedFromHome; private boolean mFinishedTransitionToQuickScrub; + private int mLaunchingTaskId; private Runnable mOnFinishedTransitionToQuickScrubRunnable; private ActivityControlHelper mActivityControlHelper; private TouchInteractionLog mTouchInteractionLog; @@ -105,6 +106,7 @@ public class QuickScrubController implements OnAlarmListener { if (taskView != null) { mWaitingForTaskLaunch = true; mTouchInteractionLog.launchTaskStart(); + mLaunchingTaskId = taskView.getTask().key.id; taskView.launchTask(true, (result) -> { mTouchInteractionLog.launchTaskEnd(result); if (!result) { @@ -146,6 +148,7 @@ public class QuickScrubController implements OnAlarmListener { mActivityControlHelper = null; mOnFinishedTransitionToQuickScrubRunnable = null; mRecentsView.setNextPageSwitchRunnable(null); + mLaunchingTaskId = 0; } /** @@ -211,6 +214,18 @@ public class QuickScrubController implements OnAlarmListener { } } + public void onTaskRemoved(int taskId) { + if (mLaunchingTaskId == taskId) { + // The task has been removed mid-launch, break out of quickscrub and return the user + // to where they were before (and notify the launch failed) + TaskView taskView = mRecentsView.getTaskView(taskId); + if (taskView != null) { + taskView.notifyTaskLaunchFailed(TAG); + } + breakOutOfQuickScrub(); + } + } + public void snapToNextTaskIfAvailable() { if (mInQuickScrub && mRecentsView.getChildCount() > 0) { int duration = mStartedFromHome ? QUICK_SCRUB_FROM_HOME_START_DURATION |