From dc90a46e7723737724d955571784efa5daf2de16 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Tue, 15 Aug 2023 16:55:23 +0100 Subject: [PATCH] Skips checking for overview actions when grid only overview flag is enabled. Fix: 296060682 Test: TaplTestsQuickstep Flag: ENABLE_GRID_ONLY_OVERVIEW Change-Id: If8ef23767350dbbcf80294abf6b93eebe57d3487 --- .../launcher3/testing/TestInformationHandler.java | 7 +++++++ .../android/launcher3/testing/shared/TestProtocol.java | 2 ++ tests/tapl/com/android/launcher3/tapl/BaseOverview.java | 9 ++++++--- .../android/launcher3/tapl/LauncherInstrumentation.java | 5 +++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index 438a4a02e7..0fed5433bd 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -16,6 +16,7 @@ package com.android.launcher3.testing; import static com.android.launcher3.allapps.AllAppsStore.DEFER_UPDATES_TEST; +import static com.android.launcher3.config.FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW; import static com.android.launcher3.config.FeatureFlags.ENABLE_TRACKPAD_GESTURE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; @@ -251,6 +252,12 @@ public class TestInformationHandler implements ResourceBasedOverride { + l.getAppsView().getActiveRecyclerView().getPaddingBottom()); } + case TestProtocol.REQUEST_FLAG_ENABLE_GRID_ONLY_OVERVIEW: { + response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, + ENABLE_GRID_ONLY_OVERVIEW.get()); + return response; + } + default: return null; } diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java index d86a2f8e75..bbe4c20e5c 100644 --- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -167,6 +167,8 @@ public final class TestProtocol { public static final String REQUEST_IS_EMULATE_DISPLAY_RUNNING = "is-emulate-display-running"; public static final String REQUEST_EMULATE_PRINT_DEVICE = "emulate-print-device"; + public static final String REQUEST_FLAG_ENABLE_GRID_ONLY_OVERVIEW = "enable-grid-only-overview"; + /** Logs {@link Log#d(String, String)} if {@link #sDebugTracing} is true. */ public static void testLogD(String tag, String message) { if (!sDebugTracing) { diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java index 2c3c02827d..aa5c770ab9 100644 --- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java +++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java @@ -324,13 +324,16 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { if (!hasTasks() || isClearAllVisible()) { return false; } - OverviewTask task = mLauncher.isTablet() ? getFocusedTaskForTablet() : getCurrentTask(); + boolean isTablet = mLauncher.isTablet(); + if (isTablet && mLauncher.isGridOnlyOverviewEnabled()) { + return false; + } + OverviewTask task = isTablet ? getFocusedTaskForTablet() : getCurrentTask(); if (task == null) { return false; } // In tablets, if focused task is not in center, overview actions aren't visible. - if (mLauncher.isTablet() - && Math.abs(task.getExactCenterX() - mLauncher.getExactScreenCenterX()) >= 1) { + if (isTablet && Math.abs(task.getExactCenterX() - mLauncher.getExactScreenCenterX()) >= 1) { return false; } // Overview actions aren't visible for split screen tasks. diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index b929293fa7..940ea3b6c9 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -1761,6 +1761,11 @@ public final class LauncherInstrumentation { TestProtocol.TEST_INFO_RESPONSE_FIELD); } + boolean isGridOnlyOverviewEnabled() { + return getTestInfo(TestProtocol.REQUEST_FLAG_ENABLE_GRID_ONLY_OVERVIEW).getBoolean( + TestProtocol.TEST_INFO_RESPONSE_FIELD); + } + public void sendPointer(long downTime, long currentTime, int action, Point point, GestureScope gestureScope) { final boolean hasTIS = hasTIS();