From befa11295b23683875489433516eaf8e9910acb0 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 2 Jul 2021 16:36:47 +0100 Subject: [PATCH] Allow dragging outside TaskView on fallback recents - Similar to LauncherRecentsView.onTouchEvent, don't allow touch to escape if overview UI is shown - Add FLAG_OVERVIEW_UI to RecentsState Fix: 192658511 Test: FallbackRecentsTest.testOverview on pixel_jumbojack Change-Id: I80270da6c077e8302f75384edeb521cfa81266ec --- .../quickstep/fallback/FallbackRecentsView.java | 8 ++++++++ .../android/quickstep/fallback/RecentsState.java | 14 +++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index efce6500ea..d9631880dc 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -26,6 +26,7 @@ import android.app.ActivityManager.RunningTaskInfo; import android.content.Context; import android.os.Build; import android.util.AttributeSet; +import android.view.MotionEvent; import androidx.annotation.Nullable; @@ -209,4 +210,11 @@ public class FallbackRecentsView extends RecentsView { private static final int FLAG_SHOW_AS_GRID = BaseState.getFlag(4); private static final int FLAG_SCRIM = BaseState.getFlag(5); private static final int FLAG_LIVE_TILE = BaseState.getFlag(6); + private static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7); public static final RecentsState DEFAULT = new RecentsState(0, FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID | FLAG_SCRIM - | FLAG_LIVE_TILE); + | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI); public static final RecentsState MODAL_TASK = new ModalState(1, FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_MODAL - | FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE); + | FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI); public static final RecentsState BACKGROUND_APP = new BackgroundAppState(2, - FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN); + FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI); public static final RecentsState HOME = new RecentsState(3, 0); public static final RecentsState BG_LAUNCHER = new LauncherState(4, 0); @@ -140,6 +141,13 @@ public class RecentsState implements BaseState { return deviceProfile.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get(); } + /** + * True if the state has overview panel visible. + */ + public boolean overviewUi() { + return hasFlag(FLAG_OVERVIEW_UI); + } + private static class ModalState extends RecentsState { public ModalState(int id, int flags) {