From fe935dfbc198192780f9c3bdd94fdfb1b849d33b Mon Sep 17 00:00:00 2001 From: Zak Cohen Date: Thu, 20 Feb 2020 15:08:10 -0800 Subject: [PATCH 1/2] TAPL test update - don't run all apps in overview tests with actions. Overview actions removes the all apps from overview. Don't run the tests that depend on these. Ultimately need to add more tests for the actions. Test: tapl local Change-Id: I2471d10af7bc03a40a94f99aa16354b85bdb3ad7 --- .../quickstep/QuickstepTestInformationHandler.java | 8 +++++++- .../com/android/quickstep/TaplTestsQuickstep.java | 14 ++++++++++++-- .../android/launcher3/testing/TestProtocol.java | 2 ++ .../launcher3/tapl/LauncherInstrumentation.java | 7 ++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java index 34b2bdb4a8..d4c746f8c6 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -3,8 +3,8 @@ package com.android.quickstep; import android.app.Activity; import android.content.Context; import android.os.Bundle; -import android.util.Log; +import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController; @@ -64,6 +64,12 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { taskBaseIntentComponents); return response; } + + case TestProtocol.REQUEST_OVERVIEW_ACTIONS_ENABLED: { + response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, + FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get()); + return response; + } } return super.call(method); diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index ecfdb55425..28ed58855b 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -81,6 +81,11 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test public void testAllAppsFromOverview() throws Exception { + // When actions are enabled, all apps isn't present in overview + if (mLauncher.overviewActionsEnabled()) { + return; + } + // Test opening all apps from Overview. assertNotNull("switchToAllApps() returned null", mLauncher.getWorkspace().switchToOverview().switchToAllApps()); @@ -141,8 +146,8 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { launcher -> assertEquals("Dismissing a task didn't remove 1 task from Overview", numTasks - 1, getTaskCount(launcher))); - if (!TestHelpers.isInLauncherProcess() || - getFromLauncher(launcher -> !launcher.getDeviceProfile().isLandscape)) { + if (!mLauncher.overviewActionsEnabled() && (!TestHelpers.isInLauncherProcess() + || getFromLauncher(launcher -> !launcher.getDeviceProfile().isLandscape))) { // Test switching to all apps and back. final AllAppsFromOverview allApps = overview.switchToAllApps(); assertNotNull("overview.switchToAllApps() returned null (1)", allApps); @@ -185,6 +190,11 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test public void testAppIconLaunchFromAllAppsFromOverview() throws Exception { + // All apps doesn't exist in Overview when actions are enabled + if (mLauncher.overviewActionsEnabled()) { + return; + } + final AllApps allApps = mLauncher.getWorkspace().switchToOverview().switchToAllApps(); assertTrue("Launcher internal state is not All Apps", diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java index f995c61ac9..97ce65e640 100644 --- a/src/com/android/launcher3/testing/TestProtocol.java +++ b/src/com/android/launcher3/testing/TestProtocol.java @@ -89,6 +89,8 @@ public final class TestProtocol { public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing"; public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing"; + public static final String REQUEST_OVERVIEW_ACTIONS_ENABLED = "overview-actions-enabled"; + public static final String PERMANENT_DIAG_TAG = "TaplTarget"; public static final String NO_BACKGROUND_TO_OVERVIEW_TAG = "b/138251824"; diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 6775521d05..08de156068 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -541,7 +541,7 @@ public final class LauncherInstrumentation { return waitForLauncherObject(APPS_RES_ID); } case OVERVIEW: { - if (mDevice.isNaturalOrientation()) { + if (mDevice.isNaturalOrientation() && !overviewActionsEnabled()) { waitForLauncherObject(APPS_RES_ID); } else { waitUntilGone(APPS_RES_ID); @@ -1197,6 +1197,11 @@ public final class LauncherInstrumentation { getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING); } + public boolean overviewActionsEnabled() { + return getTestInfo(TestProtocol.REQUEST_OVERVIEW_ACTIONS_ENABLED).getBoolean( + TestProtocol.TEST_INFO_RESPONSE_FIELD); + } + public void disableDebugTracing() { getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING); } From 9a4df4dba1512f4aa67da5c7f9d69a1ad22f3805 Mon Sep 17 00:00:00 2001 From: Zak Cohen Date: Wed, 19 Feb 2020 14:52:10 -0800 Subject: [PATCH 2/2] Overview Actions - Enable by default. Enable the Overview Actions feature flag by default. Test: local Bug: 145297320 Change-Id: I6f4a2b6e90704b78d1ff1f77bbfea2d8789169ff --- src/com/android/launcher3/config/FeatureFlags.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 3d8a9d7bbf..d7498a5c11 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -124,7 +124,7 @@ public final class FeatureFlags { "Show launcher preview in grid picker"); public static final BooleanFlag ENABLE_OVERVIEW_ACTIONS = getDebugFlag( - "ENABLE_OVERVIEW_ACTIONS", false, "Show app actions instead of the shelf in Overview." + "ENABLE_OVERVIEW_ACTIONS", true, "Show app actions instead of the shelf in Overview." + " As part of this decoupling, also distinguish swipe up from nav bar vs above it."); public static final BooleanFlag ENABLE_DATABASE_RESTORE = getDebugFlag(