From bda972b2c92ce54ce5d0d2cd11228a5588205d1f Mon Sep 17 00:00:00 2001 From: Luca Zuccarini Date: Mon, 3 Oct 2022 11:48:27 +0000 Subject: [PATCH] [Toast] Switch to using device config to control keyboard sync. Bug: 234812580 Test: followed the existing pattern and tested by manually setting and unsetting the flag through command line - `adb shell device_config put launcher enable_web_suggest_on_default_browser ` Change-Id: Idd479e93b628b78fdf55d826c56f69c5cfdaf46e --- src/com/android/launcher3/Launcher.java | 8 ++++++++ .../launcher3/allapps/AllAppsTransitionController.java | 3 +-- src/com/android/launcher3/config/FeatureFlags.java | 5 ----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index a6831aafa9..5be63e3c5f 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1579,6 +1579,14 @@ public class Launcher extends StatefulActivity return mOldConfig.orientation; } + /** + * Whether keyboard sync is enabled for transitions between Home and All Apps. + * TODO(b/251387263): move this method inside an All Apps specific config class. + */ + public boolean isKeyboardSyncEnabled() { + return false; + } + @Override protected void onNewIntent(Intent intent) { if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 872c4fd5cd..001b494439 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -39,7 +39,6 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.PropertySetter; -import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.statemanager.StateManager.StateHandler; import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.util.MultiPropertyFactory; @@ -229,7 +228,7 @@ public class AllAppsTransitionController StateAnimationConfig config, PendingAnimation builder) { if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) { // For atomic animations, we close the keyboard immediately. - if (!config.userControlled && !FeatureFlags.ENABLE_KEYBOARD_TRANSITION_SYNC.get()) { + if (!config.userControlled && !mLauncher.isKeyboardSyncEnabled()) { mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); } diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 50cf8d67f9..046378ab3f 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -249,11 +249,6 @@ public final class FeatureFlags { public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = new DeviceFlag( "ENABLE_ONE_SEARCH_MOTION", true, "Enables animations in OneSearch."); - public static final BooleanFlag ENABLE_KEYBOARD_TRANSITION_SYNC = new DeviceFlag( - "ENABLE_KEYBOARD_TRANSITION_SYNC", IS_STUDIO_BUILD, - "Enable option to synchronize the keyboard open and close animations when transitioning" - + " between home and all apps"); - public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = new DeviceFlag( "ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", true, "Enable option to show keyboard when going to all-apps");