From 3975de5f8347b3ef1d64a038f3d50dd065618367 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Fri, 21 Oct 2016 14:53:18 -0700 Subject: [PATCH] No recents items can be dismissed by tap or swipe When there are no recents items shown, any tap or swipe will dismiss it and go back to the launcher. Bug: 31464845 Fixes: 31464845 Test: manual - overview with no recents and tap the screen to dismiss Change-Id: I98987daf4d064e3f65141f790e68018fcf445c26 --- .../systemui/recents/views/RecentsViewTouchHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java index 265f3197d8daa..d3ec9845856a4 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java @@ -31,6 +31,7 @@ import com.android.systemui.recents.Recents; import com.android.systemui.recents.RecentsConfiguration; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.ConfigurationChangedEvent; +import com.android.systemui.recents.events.activity.HideRecentsEvent; import com.android.systemui.recents.events.ui.HideIncompatibleAppOverlayEvent; import com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent; import com.android.systemui.recents.events.ui.dragndrop.DragDropTargetChangedEvent; @@ -139,7 +140,10 @@ public class RecentsViewTouchHandler { /** Handles touch events once we have intercepted them */ public boolean onTouchEvent(MotionEvent ev) { handleTouchEvent(ev); - return mDragRequested; + if (ev.getAction() == MotionEvent.ACTION_UP && mRv.getStack().getStackTaskCount() == 0) { + EventBus.getDefault().send(new HideRecentsEvent(false, true)); + } + return true; } /**** Events ****/