From 1f76132d4dc0d96bf34d8580064b8dadf24eb9f4 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 18 Jun 2014 18:21:42 -0700 Subject: [PATCH] Toggling Recents from home should actually toggle Recents instead of launching the first task. Change-Id: Id60c54839c9f13299ec8d514e73e37c10735f30c --- .../android/systemui/recents/RecentsActivity.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 88ff726c95512..9ea346b381854 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -277,13 +277,21 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView !mFullScreenshotView.cancelAnimateOnEnterRecents(mFinishRunnable)) { // If we have a focused task, then launch that task if (!mRecentsView.launchFocusedTask()) { - // If there are any tasks, then launch the first task - if (!mRecentsView.launchFirstTask()) { - // We really shouldn't hit this, but if we do, just animate out (aka. finish) + if (mConfig.launchedFromHome) { + // Just start the animation out of recents ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(this, null, mFinishRunnable, null); mRecentsView.startExitToHomeAnimation( new ViewAnimation.TaskViewExitContext(exitTrigger)); + } else { + // Otherwise, try and launch the first task + if (!mRecentsView.launchFirstTask()) { + // If there are no tasks, then just finish recents + ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(this, + null, mFinishRunnable, null); + mRecentsView.startExitToHomeAnimation( + new ViewAnimation.TaskViewExitContext(exitTrigger)); + } } } }