Merge "Fix wrong number of columns for AllApps calculation" into main
diff --git a/aconfig/launcher.aconfig b/aconfig/launcher.aconfig
index fa76453..5689c8a 100644
--- a/aconfig/launcher.aconfig
+++ b/aconfig/launcher.aconfig
@@ -62,3 +62,10 @@
description: "Enables taskbar pinning to allow user to switch between transient and persistent taskbar flavors."
bug: "270396583"
}
+
+flag {
+ name: "enable_split_from_fullscreen_with_keyboard_shortcuts"
+ namespace: "launcher"
+ description: "Enables initiating split from a fullscreen app using keyboard shortcuts"
+ bug: "270394122"
+}
diff --git a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
index 3748a24..bdbdfd8 100644
--- a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
@@ -16,7 +16,7 @@
package com.android.quickstep.util;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS;
+import static com.android.launcher3.config.FeatureFlags.enableSplitFromFullscreenWithKeyboardShortcuts;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.quickstep.views.DesktopTaskView.isDesktopModeSupported;
@@ -191,7 +191,7 @@
}
private boolean shouldIgnoreSecondSplitLaunch() {
- return (!ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get()
+ return (!enableSplitFromFullscreenWithKeyboardShortcuts()
&& !FeatureFlags.enableSplitContextually()
&& !isDesktopModeSupported())
|| !mController.isSplitSelectActive();
diff --git a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
index f3fa86a..8f719d0 100644
--- a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
@@ -16,7 +16,7 @@
package com.android.quickstep.util;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS;
+import static com.android.launcher3.config.FeatureFlags.enableSplitFromFullscreenWithKeyboardShortcuts;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_RIGHT_BOTTOM;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
@@ -75,7 +75,7 @@
@BinderThread
public void enterStageSplit(boolean leftOrTop) {
- if (!ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get()) {
+ if (!enableSplitFromFullscreenWithKeyboardShortcuts()) {
return;
}
RecentsAnimationCallbacks callbacks = new RecentsAnimationCallbacks(
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 0966350..ff8537b 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -103,7 +103,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testWorkspaceSwitchToAllApps() {
assertNotNull("switchToAllApps() returned null",
mLauncher.getWorkspace().switchToAllApps());
@@ -180,7 +179,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testOverviewActions() throws Exception {
assumeFalse("Skipping Overview Actions tests for grid only overview",
mLauncher.isTablet() && mLauncher.isGridOnlyOverviewEnabled());
@@ -217,7 +215,6 @@
@NavigationModeSwitch
@PortraitLandscape
@ScreenRecord // b/238461765
- @PlatinumTest(focusArea = "launcher")
public void testSwitchToOverview() throws Exception {
startTestAppsWithCheck();
assertNotNull("Workspace.switchToOverview() returned null",
@@ -243,7 +240,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testBackground() throws Exception {
startAppFast(CALCULATOR_APP_PACKAGE);
final LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
@@ -270,7 +266,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testQuickSwitchFromApp() throws Exception {
startTestActivity(2);
startTestActivity(3);
@@ -300,7 +295,6 @@
@Test
@ScreenRecord // b/242163205
- @PlatinumTest(focusArea = "launcher")
@TaskbarModeSwitch(mode = PERSISTENT)
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
assumeTrue(mLauncher.isTablet());
@@ -327,7 +321,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testQuickSwitchFromHome() throws Exception {
startTestActivity(2);
mLauncher.goHome().quickSwitchToPreviousApp();
diff --git a/src/com/android/launcher3/ExtendedEditText.java b/src/com/android/launcher3/ExtendedEditText.java
index 8ff030e..8eab3e3 100644
--- a/src/com/android/launcher3/ExtendedEditText.java
+++ b/src/com/android/launcher3/ExtendedEditText.java
@@ -90,14 +90,23 @@
/**
* Synchronously shows the soft input method.
*
- * @param shouldFocus whether this EditText should also request focus.
- * @return true if the keyboard is shown correctly and focus is given to this view (if
- * applicable).
+ * @return true if the keyboard is shown correctly and focus is given to this view.
*/
- public boolean showKeyboard(boolean shouldFocus) {
+ public boolean showKeyboard() {
onKeyboardShown();
- boolean focusResult = !shouldFocus || requestFocus();
- return focusResult && showSoftInputInternal();
+ return requestFocus() && showSoftInputInternal();
+ }
+
+ /**
+ * Requests the framework to show the keyboard in order to ensure that an already registered
+ * controlled keyboard animation is triggered correctly.
+ * Must NEVER be called in any other case than to trigger a pre-registered controlled animation.
+ */
+ public void requestShowKeyboardForControlledAnimation() {
+ // We don't log the keyboard state, as that must happen only after the controlled animation
+ // has completed.
+ // We also must not request focus, as this triggers unwanted side effects.
+ showSoftInputInternal();
}
public void hideKeyboard() {
diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
index ecbc7a9..4427a49 100644
--- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
@@ -160,7 +160,7 @@
* Focuses the search field to handle key events.
*/
public void focusSearchField() {
- mInput.showKeyboard(true /* shouldFocus */);
+ mInput.showKeyboard();
}
/**
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 8a14a85..51eb363 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -408,11 +408,16 @@
"USE_LOCAL_ICON_OVERRIDES", ENABLED,
"Use inbuilt monochrome icons if app doesn't provide one");
- // TODO(Block 28): Clean up flags
+ // Aconfig migration complete for ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.
public static final BooleanFlag ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS =
getDebugFlag(270394122, "ENABLE_SPLIT_FROM_FULLSCREEN_SHORTCUT", DISABLED,
"Enable splitting from fullscreen app with keyboard shortcuts");
+ public static boolean enableSplitFromFullscreenWithKeyboardShortcuts() {
+ return ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get()
+ || Flags.enableSplitFromFullscreenWithKeyboardShortcuts();
+ }
+ // Aconfig migration complete for ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE.
public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE = getDebugFlag(
270393453, "ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE", DISABLED,
"Enable initiating split screen from workspace to workspace.");
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 57e1641..8bf7ec2 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -536,7 +536,7 @@
mFolderName.selectAll();
}
}
- mFolderName.showKeyboard(true /* shouldFocus */);
+ mFolderName.showKeyboard();
mFolderName.displayCompletions(
Stream.of(mInfo.suggestedFolderNames.getLabels())
.filter(Objects::nonNull)