diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index f33ef654eaf74..aab45b5d02f6b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -749,7 +749,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD public final void onBusEvent(AllTaskViewsDismissedEvent event) { SystemServicesProxy ssp = Recents.getSystemServices(); if (ssp.hasDockedTask()) { - mRecentsView.showEmptyView(R.string.recents_empty_message_dismissed_all); + mRecentsView.showEmptyView(event.msgResId); } else { // Just go straight home (no animation necessary because there are no more task views) dismissRecentsToHome(false /* animateTaskViews */); diff --git a/packages/SystemUI/src/com/android/systemui/recents/events/ui/AllTaskViewsDismissedEvent.java b/packages/SystemUI/src/com/android/systemui/recents/events/ui/AllTaskViewsDismissedEvent.java index cf74519624eaa..0352161be5708 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/events/ui/AllTaskViewsDismissedEvent.java +++ b/packages/SystemUI/src/com/android/systemui/recents/events/ui/AllTaskViewsDismissedEvent.java @@ -22,5 +22,10 @@ import com.android.systemui.recents.events.EventBus; * This is sent whenever all the task views in a stack have been dismissed. */ public class AllTaskViewsDismissedEvent extends EventBus.Event { - // Simple event + + public final int msgResId; + + public AllTaskViewsDismissedEvent(int msgResId) { + this.msgResId = msgResId; + } } diff --git a/packages/SystemUI/src/com/android/systemui/recents/history/RecentsHistoryAdapter.java b/packages/SystemUI/src/com/android/systemui/recents/history/RecentsHistoryAdapter.java index 5eeda72637ea4..16385c9ab358b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/history/RecentsHistoryAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/recents/history/RecentsHistoryAdapter.java @@ -245,7 +245,7 @@ public class RecentsHistoryAdapter extends RecyclerView.Adapter 1) { + if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask()) { if (!event.task.isDockable) { Toast.makeText(mRv.getContext(), R.string.recents_drag_non_dockable_task_message, Toast.LENGTH_SHORT).show(); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 93b5b6c129044..0b20d21d806c5 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -1395,7 +1395,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal */ @Override public void onStackTaskRemoved(TaskStack stack, Task removedTask, boolean wasFrontMostTask, - Task newFrontMostTask, AnimationProps animation) { + Task newFrontMostTask, AnimationProps animation, boolean fromDockGesture) { if (mFocusedTask == removedTask) { resetFocusedTask(removedTask); } @@ -1426,7 +1426,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // If there are no remaining tasks, then just close recents if (mStack.getTaskCount() == 0) { - EventBus.getDefault().send(new AllTaskViewsDismissedEvent()); + EventBus.getDefault().send(new AllTaskViewsDismissedEvent(fromDockGesture + ? R.string.recents_empty_message + : R.string.recents_empty_message_dismissed_all)); } } @@ -1599,7 +1601,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal tv.dismissTask(); } else { // Otherwise, remove the task from the stack immediately - mStack.removeTask(t, AnimationProps.IMMEDIATE); + mStack.removeTask(t, AnimationProps.IMMEDIATE, false /* fromDockGesture */); } } } @@ -1937,7 +1939,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Remove the task from the stack mStack.removeTask(task, new AnimationProps(DEFAULT_SYNC_STACK_DURATION, - Interpolators.FAST_OUT_SLOW_IN)); + Interpolators.FAST_OUT_SLOW_IN), false /* fromDockGesture */); } /**