Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.launcher3.config; |
| 18 | |
fbaron | e58aaf1 | 2023-09-25 11:34:56 -0700 | [diff] [blame] | 19 | import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN; |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 20 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_DELAY; |
| 21 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_END_SCALE_PERCENT; |
| 22 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_ITERATIONS; |
| 23 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_SCALE_EXPONENT; |
| 24 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_START_SCALE_PERCENT; |
| 25 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_SLOP_PERCENTAGE; |
| 26 | import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_TIMEOUT_MS; |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 27 | import static com.android.launcher3.config.FeatureFlags.FlagState.DISABLED; |
| 28 | import static com.android.launcher3.config.FeatureFlags.FlagState.ENABLED; |
| 29 | import static com.android.launcher3.config.FeatureFlags.FlagState.TEAMFOOD; |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 30 | import static com.android.launcher3.uioverrides.flags.FlagsFactory.getDebugFlag; |
| 31 | import static com.android.launcher3.uioverrides.flags.FlagsFactory.getReleaseFlag; |
Tracy Zhou | f2d7be1 | 2023-11-02 17:33:51 -0700 | [diff] [blame] | 32 | import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification; |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 33 | |
Tracy Zhou | 89f7288 | 2024-02-13 23:12:42 -0800 | [diff] [blame] | 34 | import android.content.res.Resources; |
Anushree Ganjam | cb571da | 2023-10-24 14:47:09 -0700 | [diff] [blame] | 35 | import android.view.ViewConfiguration; |
| 36 | |
Sunny Goyal | b138ec9 | 2023-03-02 16:49:59 -0800 | [diff] [blame] | 37 | import androidx.annotation.VisibleForTesting; |
| 38 | |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 39 | import com.android.launcher3.BuildConfig; |
Alex Chau | e1955fe | 2023-09-13 15:33:57 +0100 | [diff] [blame] | 40 | import com.android.launcher3.Flags; |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 41 | import com.android.launcher3.uioverrides.flags.FlagsFactory; |
Ryan Lothian | fa530cd | 2018-10-12 14:14:16 -0400 | [diff] [blame] | 42 | |
Sunny Goyal | b138ec9 | 2023-03-02 16:49:59 -0800 | [diff] [blame] | 43 | import java.util.function.Predicate; |
| 44 | import java.util.function.ToIntFunction; |
| 45 | |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 46 | /** |
| 47 | * Defines a set of flags used to control various launcher behaviors. |
Schneider Victor-tulias | 8d3d623 | 2023-09-26 17:19:15 -0400 | [diff] [blame] | 48 | * <p> |
Ryan Lothian | 688e989 | 2018-10-03 13:32:01 -0400 | [diff] [blame] | 49 | * <p>All the flags should be defined here with appropriate default values. |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 50 | */ |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 51 | public final class FeatureFlags { |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 52 | |
Sunny Goyal | b138ec9 | 2023-03-02 16:49:59 -0800 | [diff] [blame] | 53 | @VisibleForTesting |
| 54 | public static Predicate<BooleanFlag> sBooleanReader = f -> f.mCurrentValue; |
| 55 | @VisibleForTesting |
| 56 | public static ToIntFunction<IntFlag> sIntReader = f -> f.mCurrentValue; |
| 57 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 58 | private FeatureFlags() { } |
Ryan Lothian | fa530cd | 2018-10-12 14:14:16 -0400 | [diff] [blame] | 59 | |
Zak Cohen | 3eeb41d | 2020-02-14 14:15:13 -0800 | [diff] [blame] | 60 | /** |
| 61 | * True when the build has come from Android Studio and is being used for local debugging. |
Sunny Goyal | 29fa0f3 | 2023-02-22 16:56:15 -0800 | [diff] [blame] | 62 | * @deprecated Use {@link BuildConfig#IS_STUDIO_BUILD} directly |
Zak Cohen | 3eeb41d | 2020-02-14 14:15:13 -0800 | [diff] [blame] | 63 | */ |
Sunny Goyal | 29fa0f3 | 2023-02-22 16:56:15 -0800 | [diff] [blame] | 64 | @Deprecated |
| 65 | public static final boolean IS_STUDIO_BUILD = BuildConfig.IS_STUDIO_BUILD; |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 66 | |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 67 | /** |
| 68 | * Enable moving the QSB on the 0th screen of the workspace. This is not a configuration feature |
| 69 | * and should be modified at a project level. |
Sunny Goyal | 29fa0f3 | 2023-02-22 16:56:15 -0800 | [diff] [blame] | 70 | * @deprecated Use {@link BuildConfig#QSB_ON_FIRST_SCREEN} directly |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 71 | */ |
Sunny Goyal | 29fa0f3 | 2023-02-22 16:56:15 -0800 | [diff] [blame] | 72 | @Deprecated |
Shikha Malhotra | 7884332 | 2022-02-24 13:30:57 +0000 | [diff] [blame] | 73 | public static final boolean QSB_ON_FIRST_SCREEN = BuildConfig.QSB_ON_FIRST_SCREEN; |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 74 | |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 75 | /** |
| 76 | * Feature flag to handle define config changes dynamically instead of killing the process. |
Schneider Victor-tulias | 7d8a0df | 2023-04-05 15:11:44 -0700 | [diff] [blame] | 77 | * <p> |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 78 | * |
| 79 | * To add a new flag that can be toggled through the flags UI: |
Schneider Victor-tulias | 7d8a0df | 2023-04-05 15:11:44 -0700 | [diff] [blame] | 80 | * <p> |
Zak Cohen | f9e73a0 | 2019-12-03 12:00:44 -0800 | [diff] [blame] | 81 | * Declare a new ToggleableFlag below. Give it a unique key (e.g. "QSB_ON_FIRST_SCREEN"), |
Federico Baron | dafd14d | 2022-10-05 14:51:37 -0700 | [diff] [blame] | 82 | * and set a default value for the flag. This will be the default value on Debug builds. |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 83 | * <p> |
Sunny Goyal | 3e3d759 | 2019-09-11 16:51:50 -0700 | [diff] [blame] | 84 | */ |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 85 | // TODO(Block 1): Clean up flags |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 86 | public static final BooleanFlag ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES = getReleaseFlag( |
Luca Zuccarini | c3c75c2 | 2023-08-03 16:16:33 +0000 | [diff] [blame] | 87 | 270394041, "ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES", ENABLED, |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 88 | "Enable option to replace decorator-based search result backgrounds with drawables"); |
| 89 | |
| 90 | public static final BooleanFlag ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION = getReleaseFlag( |
Luca Zuccarini | c3c75c2 | 2023-08-03 16:16:33 +0000 | [diff] [blame] | 91 | 270394392, "ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION", ENABLED, |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 92 | "Enable option to launch search results using the new view container transitions"); |
| 93 | |
| 94 | // TODO(Block 2): Clean up flags |
| 95 | public static final BooleanFlag ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH = getDebugFlag(270395073, |
| 96 | "ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH", DISABLED, |
| 97 | "Allow bottom sheet depth to be smaller than 1 for multi-display devices."); |
| 98 | |
| 99 | // TODO(Block 3): Clean up flags |
| 100 | public static final BooleanFlag ENABLE_DISMISS_PREDICTION_UNDO = getDebugFlag(270394476, |
| 101 | "ENABLE_DISMISS_PREDICTION_UNDO", DISABLED, |
| 102 | "Show an 'Undo' snackbar when users dismiss a predicted hotseat item"); |
| 103 | |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 104 | public static final BooleanFlag MOVE_STARTUP_DATA_TO_DEVICE_PROTECTED_STORAGE = getDebugFlag( |
| 105 | 251502424, "ENABLE_BOOT_AWARE_STARTUP_DATA", DISABLED, |
| 106 | "Marks LauncherPref data as (and allows it to) available while the device is" |
| 107 | + " locked. Enabling this causes a 1-time movement of certain SharedPreferences" |
| 108 | + " data. Improves startup latency."); |
| 109 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 110 | public static final BooleanFlag CONTINUOUS_VIEW_TREE_CAPTURE = getDebugFlag(270395171, |
| 111 | "CONTINUOUS_VIEW_TREE_CAPTURE", ENABLED, "Capture View tree every frame"); |
| 112 | |
| 113 | public static final BooleanFlag ENABLE_WORKSPACE_LOADING_OPTIMIZATION = getDebugFlag(251502424, |
| 114 | "ENABLE_WORKSPACE_LOADING_OPTIMIZATION", DISABLED, |
| 115 | "load the current workspace screen visible to the user before the rest rather than " |
| 116 | + "loading all of them at once."); |
| 117 | |
| 118 | public static final BooleanFlag CHANGE_MODEL_DELEGATE_LOADING_ORDER = getDebugFlag(251502424, |
| 119 | "CHANGE_MODEL_DELEGATE_LOADING_ORDER", DISABLED, |
| 120 | "changes the timing of the loading and binding of delegate items during " |
| 121 | + "data preparation for loading the home screen"); |
| 122 | |
| 123 | // TODO(Block 4): Cleanup flags |
| 124 | public static final BooleanFlag ENABLE_FLOATING_SEARCH_BAR = |
Andy Wickham | 830e4b7 | 2023-04-19 07:08:44 -0700 | [diff] [blame] | 125 | getReleaseFlag(268388460, "ENABLE_FLOATING_SEARCH_BAR", DISABLED, |
Andy Wickham | 64896f3 | 2023-05-30 21:46:24 -0700 | [diff] [blame] | 126 | "Allow search bar to persist and animate across states, and attach to" |
| 127 | + " the keyboard from the bottom of the screen"); |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 128 | |
Andy Wickham | 830e4b7 | 2023-04-19 07:08:44 -0700 | [diff] [blame] | 129 | public static final BooleanFlag ENABLE_ALL_APPS_FROM_OVERVIEW = |
| 130 | getDebugFlag(275132633, "ENABLE_ALL_APPS_FROM_OVERVIEW", DISABLED, |
| 131 | "Allow entering All Apps from Overview (e.g. long swipe up from app)"); |
| 132 | |
Andy Wickham | 9fbc52f | 2023-09-22 17:44:23 -0700 | [diff] [blame] | 133 | public static final BooleanFlag CUSTOM_LPNH_THRESHOLDS = |
Anushree Ganjam | cb571da | 2023-10-24 14:47:09 -0700 | [diff] [blame] | 134 | getReleaseFlag(301680992, "CUSTOM_LPNH_THRESHOLDS", DISABLED, |
Andy Wickham | 9fbc52f | 2023-09-22 17:44:23 -0700 | [diff] [blame] | 135 | "Add dev options to customize the LPNH trigger slop and milliseconds"); |
| 136 | |
Andy Wickham | 24a50df | 2023-10-31 16:51:36 -0700 | [diff] [blame] | 137 | public static final BooleanFlag ANIMATE_LPNH = |
| 138 | getReleaseFlag(308693847, "ANIMATE_LPNH", TEAMFOOD, |
| 139 | "Animates navbar when long pressing"); |
| 140 | |
Andreas Agvard | 1ea0746 | 2023-11-30 20:47:22 +0100 | [diff] [blame] | 141 | public static final BooleanFlag SHRINK_NAV_HANDLE_ON_PRESS = |
| 142 | getReleaseFlag(314158312, "SHRINK_NAV_HANDLE_ON_PRESS", DISABLED, |
| 143 | "Shrinks navbar when long pressing if ANIMATE_LPNH is enabled"); |
| 144 | |
Anushree Ganjam | cb571da | 2023-10-24 14:47:09 -0700 | [diff] [blame] | 145 | public static final IntFlag LPNH_SLOP_PERCENTAGE = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 146 | FlagsFactory.getIntFlag(301680992, "LPNH_SLOP_PERCENTAGE", 100, |
| 147 | "Controls touch slop percentage for lpnh", |
| 148 | LONG_PRESS_NAV_HANDLE_SLOP_PERCENTAGE); |
Anushree Ganjam | cb571da | 2023-10-24 14:47:09 -0700 | [diff] [blame] | 149 | |
| 150 | public static final IntFlag LPNH_TIMEOUT_MS = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 151 | FlagsFactory.getIntFlag(301680992, "LPNH_TIMEOUT_MS", |
| 152 | ViewConfiguration.getLongPressTimeout(), |
| 153 | "Controls lpnh timeout in milliseconds", LONG_PRESS_NAV_HANDLE_TIMEOUT_MS); |
Anushree Ganjam | cb571da | 2023-10-24 14:47:09 -0700 | [diff] [blame] | 154 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 155 | public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = getReleaseFlag( |
| 156 | 270394468, "ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", ENABLED, |
| 157 | "Enable option to show keyboard when going to all-apps"); |
| 158 | |
| 159 | // TODO(Block 5): Clean up flags |
| 160 | public static final BooleanFlag ENABLE_TWOLINE_DEVICESEARCH = getDebugFlag(201388851, |
Brandon Dayauon | 00bd00f | 2024-03-07 10:14:44 -0800 | [diff] [blame] | 161 | "ENABLE_TWOLINE_DEVICESEARCH", DISABLED, |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 162 | "Enable two line label for icons with labels on device search."); |
| 163 | |
| 164 | public static final BooleanFlag ENABLE_ICON_IN_TEXT_HEADER = getDebugFlag(270395143, |
| 165 | "ENABLE_ICON_IN_TEXT_HEADER", DISABLED, "Show icon in textheader"); |
| 166 | |
| 167 | public static final BooleanFlag ENABLE_PREMIUM_HAPTICS_ALL_APPS = getDebugFlag(270396358, |
| 168 | "ENABLE_PREMIUM_HAPTICS_ALL_APPS", DISABLED, |
| 169 | "Enables haptics opening/closing All apps"); |
| 170 | |
| 171 | // TODO(Block 6): Clean up flags |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 172 | public static final BooleanFlag ENABLE_ALL_APPS_SEARCH_IN_TASKBAR = getDebugFlag(270393900, |
Brian Isganitis | 26e1ff5 | 2023-10-03 14:12:19 -0400 | [diff] [blame] | 173 | "ENABLE_ALL_APPS_SEARCH_IN_TASKBAR", ENABLED, |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 174 | "Enables Search box in Taskbar All Apps."); |
| 175 | |
| 176 | public static final BooleanFlag SECONDARY_DRAG_N_DROP_TO_PIN = getDebugFlag(270395140, |
| 177 | "SECONDARY_DRAG_N_DROP_TO_PIN", DISABLED, |
| 178 | "Enable dragging and dropping to pin apps within secondary display"); |
| 179 | |
| 180 | // TODO(Block 7): Clean up flags |
| 181 | public static final BooleanFlag ENABLE_FORCED_MONO_ICON = getDebugFlag(270396209, |
| 182 | "ENABLE_FORCED_MONO_ICON", DISABLED, |
| 183 | "Enable the ability to generate monochromatic icons, if it is not provided by the app"); |
| 184 | |
| 185 | // TODO(Block 8): Clean up flags |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 186 | |
| 187 | // TODO(Block 9): Clean up flags |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 188 | public static final BooleanFlag MULTI_SELECT_EDIT_MODE = getDebugFlag(270709220, |
| 189 | "MULTI_SELECT_EDIT_MODE", DISABLED, "Enable new multi-select edit mode " |
| 190 | + "for home screen"); |
| 191 | |
fbaron | c290725 | 2023-09-05 15:53:43 -0700 | [diff] [blame] | 192 | public static final BooleanFlag SMARTSPACE_AS_A_WIDGET = getDebugFlag(299181941, |
| 193 | "SMARTSPACE_AS_A_WIDGET", DISABLED, "Enable SmartSpace as a widget"); |
| 194 | |
fbaron | e58aaf1 | 2023-09-25 11:34:56 -0700 | [diff] [blame] | 195 | public static boolean shouldShowFirstPageWidget() { |
| 196 | return SMARTSPACE_AS_A_WIDGET.get() && WIDGET_ON_FIRST_SCREEN; |
| 197 | } |
| 198 | |
fbaron | f96f7fe | 2023-07-10 09:39:17 -0700 | [diff] [blame] | 199 | public static final BooleanFlag ENABLE_SMARTSPACE_REMOVAL = getDebugFlag(290799975, |
| 200 | "ENABLE_SMARTSPACE_REMOVAL", DISABLED, "Enable SmartSpace removal for " |
| 201 | + "home screen"); |
| 202 | |
Sebastian Franco | 7ba9489 | 2023-06-29 14:33:23 -0700 | [diff] [blame] | 203 | // TODO(Block 11): Clean up flags |
Sebastián Franco | 1f4d56c | 2023-08-08 03:29:10 +0000 | [diff] [blame] | 204 | public static final BooleanFlag FOLDABLE_SINGLE_PAGE = getDebugFlag(270395274, |
Sebastian Franco | f376613 | 2023-09-07 14:50:07 -0700 | [diff] [blame] | 205 | "FOLDABLE_SINGLE_PAGE", DISABLED, "Use a single page for the workspace"); |
Sebastián Franco | 1f4d56c | 2023-08-08 03:29:10 +0000 | [diff] [blame] | 206 | |
Sebastian Franco | 7ba9489 | 2023-06-29 14:33:23 -0700 | [diff] [blame] | 207 | public static final BooleanFlag ENABLE_PARAMETRIZE_REORDER = getDebugFlag(289420844, |
| 208 | "ENABLE_PARAMETRIZE_REORDER", DISABLED, |
| 209 | "Enables generating the reorder using a set of parameters"); |
| 210 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 211 | // TODO(Block 12): Clean up flags |
| 212 | public static final BooleanFlag ENABLE_MULTI_INSTANCE = getDebugFlag(270396680, |
| 213 | "ENABLE_MULTI_INSTANCE", DISABLED, |
| 214 | "Enables creation and filtering of multiple task instances in overview"); |
| 215 | |
| 216 | // TODO(Block 13): Clean up flags |
| 217 | public static final BooleanFlag ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING = getReleaseFlag( |
| 218 | 270391397, "ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING", DISABLED, |
| 219 | "Allows on device search in all apps logging"); |
| 220 | |
| 221 | // TODO(Block 14): Cleanup flags |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 222 | public static final BooleanFlag NOTIFY_CRASHES = getDebugFlag(270393108, "NOTIFY_CRASHES", |
Tony Wickham | 670f17f | 2023-06-05 22:15:18 +0000 | [diff] [blame] | 223 | TEAMFOOD, "Sends a notification whenever launcher encounters an uncaught exception."); |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 224 | |
Tracy Zhou | f2d7be1 | 2023-11-02 17:33:51 -0700 | [diff] [blame] | 225 | public static final boolean ENABLE_TASKBAR_NAVBAR_UNIFICATION = |
Tracy Zhou | 89f7288 | 2024-02-13 23:12:42 -0800 | [diff] [blame] | 226 | enableTaskbarNavbarUnification() && !isPhone(); |
| 227 | |
| 228 | private static boolean isPhone() { |
| 229 | final boolean isPhone; |
| 230 | int foldedDeviceStatesId = Resources.getSystem().getIdentifier( |
| 231 | "config_foldedDeviceStates", "array", "android"); |
| 232 | if (foldedDeviceStatesId != 0) { |
| 233 | isPhone = Resources.getSystem().getIntArray(foldedDeviceStatesId).length == 0; |
| 234 | } else { |
| 235 | isPhone = true; |
| 236 | } |
| 237 | return isPhone; |
| 238 | } |
Tracy Zhou | f2d7be1 | 2023-11-02 17:33:51 -0700 | [diff] [blame] | 239 | |
Tracy Zhou | 00f9e52 | 2023-10-24 18:39:36 -0700 | [diff] [blame] | 240 | // Aconfig migration complete for ENABLE_TASKBAR_NO_RECREATION. |
Tracy Zhou | 01cc856 | 2023-08-29 22:39:04 -0700 | [diff] [blame] | 241 | public static final BooleanFlag ENABLE_TASKBAR_NO_RECREATION = getDebugFlag(299193589, |
| 242 | "ENABLE_TASKBAR_NO_RECREATION", DISABLED, |
| 243 | "Enables taskbar with no recreation from lifecycle changes of TaskbarActivityContext."); |
Tracy Zhou | 00f9e52 | 2023-10-24 18:39:36 -0700 | [diff] [blame] | 244 | public static boolean enableTaskbarNoRecreate() { |
Tracy Zhou | f2d7be1 | 2023-11-02 17:33:51 -0700 | [diff] [blame] | 245 | return ENABLE_TASKBAR_NO_RECREATION.get() || Flags.enableTaskbarNoRecreate() |
| 246 | // Task bar pinning and task bar nav bar unification are both dependent on |
| 247 | // ENABLE_TASKBAR_NO_RECREATION. We want to turn ENABLE_TASKBAR_NO_RECREATION on |
| 248 | // when either of the dependent features is turned on. |
Jagrut Desai | 057144e | 2024-01-03 15:04:00 -0800 | [diff] [blame] | 249 | || enableTaskbarPinning() || ENABLE_TASKBAR_NAVBAR_UNIFICATION; |
Tracy Zhou | 00f9e52 | 2023-10-24 18:39:36 -0700 | [diff] [blame] | 250 | } |
Tracy Zhou | 01cc856 | 2023-08-29 22:39:04 -0700 | [diff] [blame] | 251 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 252 | // TODO(Block 16): Clean up flags |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 253 | // When enabled the promise icon is visible in all apps while installation an app. |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 254 | public static final BooleanFlag PROMISE_APPS_IN_ALL_APPS = getDebugFlag(270390012, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 255 | "PROMISE_APPS_IN_ALL_APPS", DISABLED, "Add promise icon in all-apps"); |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 256 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 257 | public static final BooleanFlag KEYGUARD_ANIMATION = getDebugFlag(270390904, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 258 | "KEYGUARD_ANIMATION", DISABLED, |
| 259 | "Enable animation for keyguard going away on wallpaper"); |
Jon Miranda | c298078 | 2020-03-17 14:24:42 -0700 | [diff] [blame] | 260 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 261 | public static final BooleanFlag ENABLE_DEVICE_SEARCH = getReleaseFlag(270390907, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 262 | "ENABLE_DEVICE_SEARCH", ENABLED, "Allows on device search in all apps"); |
Samuel Fufa | 9ae44d6 | 2020-07-17 11:18:25 -0700 | [diff] [blame] | 263 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 264 | public static final BooleanFlag ENABLE_HIDE_HEADER = getReleaseFlag(270390930, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 265 | "ENABLE_HIDE_HEADER", ENABLED, "Hide header on keyboard before typing in all apps"); |
Brandon Dayauon | 452ee1e | 2022-06-13 13:39:44 -0700 | [diff] [blame] | 266 | |
Anushree Ganjam | d1a28fe | 2023-08-23 21:40:57 -0700 | [diff] [blame] | 267 | // Aconfig migration complete for ENABLE_EXPANDING_PAUSE_WORK_BUTTON. |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 268 | public static final BooleanFlag ENABLE_EXPANDING_PAUSE_WORK_BUTTON = getDebugFlag(270390779, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 269 | "ENABLE_EXPANDING_PAUSE_WORK_BUTTON", DISABLED, |
Brandon Dayauon | c9672b9 | 2022-11-21 16:30:28 -0800 | [diff] [blame] | 270 | "Expand and collapse pause work button while scrolling"); |
| 271 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 272 | public static final BooleanFlag COLLECT_SEARCH_HISTORY = getReleaseFlag(270391455, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 273 | "COLLECT_SEARCH_HISTORY", DISABLED, "Allow launcher to collect search history for log"); |
sfufa@google.com | 2f0c1e6 | 2021-11-18 12:48:16 -0800 | [diff] [blame] | 274 | |
Anushree Ganjam | 2a14b97 | 2023-08-30 13:31:10 -0700 | [diff] [blame] | 275 | // Aconfig migration complete for ENABLE_TWOLINE_ALLAPPS. |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 276 | public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(270390937, |
Brandon Dayauon | 00bd00f | 2024-03-07 10:14:44 -0800 | [diff] [blame] | 277 | "ENABLE_TWOLINE_ALLAPPS", DISABLED, "Enables two line label inside all apps."); |
Hyunyoung Song | afe8fad | 2021-11-09 16:11:58 -0800 | [diff] [blame] | 278 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 279 | public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(270391693, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 280 | "IME_STICKY_SNACKBAR_EDU", ENABLED, "Show sticky IME edu in AllApps"); |
Samuel Fufa | d04a92d | 2021-06-16 09:46:25 -0500 | [diff] [blame] | 281 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 282 | public static final BooleanFlag FOLDER_NAME_MAJORITY_RANKING = getDebugFlag(270391638, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 283 | "FOLDER_NAME_MAJORITY_RANKING", ENABLED, |
Jayaprakash Sundararaj | f489845 | 2020-06-08 01:19:15 -0700 | [diff] [blame] | 284 | "Suggests folder names based on majority based ranking."); |
| 285 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 286 | public static final BooleanFlag INJECT_FALLBACK_APP_CORPUS_RESULTS = getReleaseFlag(270391706, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 287 | "INJECT_FALLBACK_APP_CORPUS_RESULTS", DISABLED, |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 288 | "Inject fallback app corpus result when AiAi fails to return it."); |
Holly Sun | c620807 | 2022-11-18 14:51:28 -0800 | [diff] [blame] | 289 | |
Andreas Agvard | eea784a | 2023-05-16 01:23:52 +0200 | [diff] [blame] | 290 | public static final BooleanFlag ENABLE_LONG_PRESS_NAV_HANDLE = |
Anushree Ganjam | bfa3586 | 2024-03-07 12:39:18 -0800 | [diff] [blame] | 291 | getReleaseFlag(299682306, "ENABLE_LONG_PRESS_NAV_HANDLE", ENABLED, |
Andreas Agvard | eea784a | 2023-05-16 01:23:52 +0200 | [diff] [blame] | 292 | "Enables long pressing on the bottom bar nav handle to trigger events."); |
| 293 | |
Andreas Agvard | d167498 | 2023-10-16 15:49:56 +0200 | [diff] [blame] | 294 | public static final BooleanFlag ENABLE_SEARCH_HAPTIC_HINT = |
Andy Wickham | c0c420a | 2023-11-29 16:51:08 -0800 | [diff] [blame] | 295 | getReleaseFlag(314005131, "ENABLE_SEARCH_HAPTIC_HINT", ENABLED, |
| 296 | "Enables haptic hint while long pressing on the bottom bar nav handle."); |
| 297 | |
| 298 | public static final BooleanFlag ENABLE_SEARCH_HAPTIC_COMMIT = |
Andreas Agvard | fd7f192 | 2023-12-01 09:28:03 +0100 | [diff] [blame] | 299 | getReleaseFlag(314005577, "ENABLE_SEARCH_HAPTIC_COMMIT", ENABLED, |
Andy Wickham | c0c420a | 2023-11-29 16:51:08 -0800 | [diff] [blame] | 300 | "Enables haptic hint at end of long pressing on the bottom bar nav handle."); |
Andreas Agvard | d167498 | 2023-10-16 15:49:56 +0200 | [diff] [blame] | 301 | |
Andreas Agvard | b36bcff | 2023-11-10 15:16:55 +0100 | [diff] [blame] | 302 | public static final IntFlag LPNH_HAPTIC_HINT_START_SCALE_PERCENT = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 303 | FlagsFactory.getIntFlag(309972570, |
| 304 | "LPNH_HAPTIC_HINT_START_SCALE_PERCENT", 0, |
| 305 | "Haptic hint start scale.", |
| 306 | LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_START_SCALE_PERCENT); |
Andreas Agvard | b36bcff | 2023-11-10 15:16:55 +0100 | [diff] [blame] | 307 | |
| 308 | public static final IntFlag LPNH_HAPTIC_HINT_END_SCALE_PERCENT = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 309 | FlagsFactory.getIntFlag(309972570, |
| 310 | "LPNH_HAPTIC_HINT_END_SCALE_PERCENT", 100, |
| 311 | "Haptic hint end scale.", LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_END_SCALE_PERCENT); |
Andreas Agvard | b36bcff | 2023-11-10 15:16:55 +0100 | [diff] [blame] | 312 | |
| 313 | public static final IntFlag LPNH_HAPTIC_HINT_SCALE_EXPONENT = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 314 | FlagsFactory.getIntFlag(309972570, |
| 315 | "LPNH_HAPTIC_HINT_SCALE_EXPONENT", 1, |
| 316 | "Haptic hint scale exponent.", |
| 317 | LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_SCALE_EXPONENT); |
Andreas Agvard | b36bcff | 2023-11-10 15:16:55 +0100 | [diff] [blame] | 318 | |
| 319 | public static final IntFlag LPNH_HAPTIC_HINT_ITERATIONS = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 320 | FlagsFactory.getIntFlag(309972570, "LPNH_HAPTIC_HINT_ITERATIONS", |
| 321 | 50, |
| 322 | "Haptic hint number of iterations.", |
| 323 | LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_ITERATIONS); |
Andreas Agvard | b36bcff | 2023-11-10 15:16:55 +0100 | [diff] [blame] | 324 | |
Andreas Agvard | 0fc7d52 | 2023-11-16 17:51:00 +0100 | [diff] [blame] | 325 | public static final BooleanFlag ENABLE_LPNH_DEEP_PRESS = |
| 326 | getReleaseFlag(310952290, "ENABLE_LPNH_DEEP_PRESS", ENABLED, |
| 327 | "Long press of nav handle is instantly triggered if deep press is detected."); |
| 328 | |
Andreas Agvard | fc74c09 | 2023-11-16 15:06:46 +0100 | [diff] [blame] | 329 | public static final IntFlag LPNH_HAPTIC_HINT_DELAY = |
Anushree Ganjam | eb5cb75 | 2024-01-18 11:14:54 -0800 | [diff] [blame] | 330 | FlagsFactory.getIntFlag(309972570, "LPNH_HAPTIC_HINT_DELAY", 0, |
| 331 | "Delay before haptic hint starts.", LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_DELAY); |
Andreas Agvard | fc74c09 | 2023-11-16 15:06:46 +0100 | [diff] [blame] | 332 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 333 | // TODO(Block 17): Clean up flags |
Jagrut Desai | 90dd098 | 2023-11-09 09:57:38 -0800 | [diff] [blame] | 334 | // Aconfig migration complete for ENABLE_TASKBAR_PINNING. |
Jagrut Desai | 5bcad41 | 2023-12-20 11:09:50 -0800 | [diff] [blame] | 335 | private static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(296231746, |
Jagrut Desai | 0dbc0d0 | 2023-10-30 12:24:50 -0700 | [diff] [blame] | 336 | "ENABLE_TASKBAR_PINNING", TEAMFOOD, |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 337 | "Enables taskbar pinning to allow user to switch between transient and persistent " |
| 338 | + "taskbar flavors"); |
Andy Wickham | d386d7d | 2019-10-17 11:59:53 -0700 | [diff] [blame] | 339 | |
Jagrut Desai | 90dd098 | 2023-11-09 09:57:38 -0800 | [diff] [blame] | 340 | public static boolean enableTaskbarPinning() { |
| 341 | return ENABLE_TASKBAR_PINNING.get() || Flags.enableTaskbarPinning(); |
| 342 | } |
| 343 | |
Jeremy Sim | 7dc3bdc | 2023-10-12 13:04:54 -0700 | [diff] [blame] | 344 | // Aconfig migration complete for ENABLE_APP_PAIRS. |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 345 | public static final BooleanFlag ENABLE_APP_PAIRS = getDebugFlag(274189428, |
| 346 | "ENABLE_APP_PAIRS", DISABLED, |
| 347 | "Enables the ability to create and save app pairs on the Home screen for easy" |
| 348 | + " split screen launching."); |
Jeremy Sim | 7dc3bdc | 2023-10-12 13:04:54 -0700 | [diff] [blame] | 349 | public static boolean enableAppPairs() { |
| 350 | return ENABLE_APP_PAIRS.get() || com.android.wm.shell.Flags.enableAppPairs(); |
| 351 | } |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 352 | |
| 353 | // TODO(Block 19): Clean up flags |
| 354 | public static final BooleanFlag SCROLL_TOP_TO_RESET = getReleaseFlag(270395177, |
| 355 | "SCROLL_TOP_TO_RESET", ENABLED, |
| 356 | "Bring up IME and focus on input when scroll to top if 'Always show keyboard'" |
| 357 | + " is enabled or in prefix state"); |
| 358 | |
| 359 | public static final BooleanFlag ENABLE_SEARCH_UNINSTALLED_APPS = getReleaseFlag(270395269, |
Holly Sun | cd5d9a7 | 2023-06-13 15:31:30 -0700 | [diff] [blame] | 360 | "ENABLE_SEARCH_UNINSTALLED_APPS", ENABLED, "Search uninstalled app results."); |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 361 | |
| 362 | // TODO(Block 20): Clean up flags |
| 363 | public static final BooleanFlag ENABLE_SCRIM_FOR_APP_LAUNCH = getDebugFlag(270393276, |
| 364 | "ENABLE_SCRIM_FOR_APP_LAUNCH", DISABLED, "Enables scrim during app launch animation."); |
| 365 | |
| 366 | public static final BooleanFlag ENABLE_BACK_SWIPE_HOME_ANIMATION = getDebugFlag(270393426, |
| 367 | "ENABLE_BACK_SWIPE_HOME_ANIMATION", ENABLED, |
| 368 | "Enables home animation to icon when user swipes back."); |
| 369 | |
Jon Miranda | f762e17 | 2023-08-02 11:59:44 -0700 | [diff] [blame] | 370 | public static final BooleanFlag ENABLE_DYNAMIC_TASKBAR_THRESHOLDS = getDebugFlag(294252473, |
Jon Miranda | 0605413 | 2023-08-17 07:47:12 -0700 | [diff] [blame] | 371 | "ENABLE_DYNAMIC_TASKBAR_THRESHOLDS", ENABLED, |
Jon Miranda | f762e17 | 2023-08-02 11:59:44 -0700 | [diff] [blame] | 372 | "Enables taskbar thresholds that scale based on screen size."); |
| 373 | |
Jon Miranda | 60ae29e | 2023-10-27 09:37:22 -0700 | [diff] [blame] | 374 | // Aconfig migration complete for ENABLE_HOME_TRANSITION_LISTENER. |
Jon Miranda | 00c3d78 | 2023-10-17 18:11:01 -0700 | [diff] [blame] | 375 | public static final BooleanFlag ENABLE_HOME_TRANSITION_LISTENER = getDebugFlag(306053414, |
Jon Miranda | 60ae29e | 2023-10-27 09:37:22 -0700 | [diff] [blame] | 376 | "ENABLE_HOME_TRANSITION_LISTENER", TEAMFOOD, |
Jon Miranda | 00c3d78 | 2023-10-17 18:11:01 -0700 | [diff] [blame] | 377 | "Enables launcher to listen to all transitions that include home activity."); |
| 378 | |
Jon Miranda | 60ae29e | 2023-10-27 09:37:22 -0700 | [diff] [blame] | 379 | public static boolean enableHomeTransitionListener() { |
| 380 | return ENABLE_HOME_TRANSITION_LISTENER.get() || Flags.enableHomeTransitionListener(); |
| 381 | } |
| 382 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 383 | // TODO(Block 21): Clean up flags |
| 384 | public static final BooleanFlag ENABLE_APP_ICON_FOR_INLINE_SHORTCUTS = getDebugFlag(270395087, |
| 385 | "ENABLE_APP_ICON_IN_INLINE_SHORTCUTS", DISABLED, "Show app icon for inline shortcut"); |
| 386 | |
| 387 | // TODO(Block 22): Clean up flags |
Sihua Ma | a5ccdbb | 2023-05-15 14:20:28 -0700 | [diff] [blame] | 388 | public static final BooleanFlag ENABLE_WIDGET_TRANSITION_FOR_RESIZING = getDebugFlag(268553314, |
| 389 | "ENABLE_WIDGET_TRANSITION_FOR_RESIZING", DISABLED, |
| 390 | "Enable widget transition animation when resizing the widgets"); |
| 391 | |
Nick Chameyev | 705c665 | 2023-04-14 17:05:12 +0100 | [diff] [blame] | 392 | public static final BooleanFlag PREEMPTIVE_UNFOLD_ANIMATION_START = getDebugFlag(270397209, |
Nick Chameyev | 6d75697 | 2023-05-26 11:50:13 +0100 | [diff] [blame] | 393 | "PREEMPTIVE_UNFOLD_ANIMATION_START", ENABLED, |
Nick Chameyev | 705c665 | 2023-04-14 17:05:12 +0100 | [diff] [blame] | 394 | "Enables starting the unfold animation preemptively when unfolding, without" |
| 395 | + "waiting for SystemUI and then merging the SystemUI progress whenever we " |
| 396 | + "start receiving the events"); |
| 397 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 398 | // TODO(Block 24): Clean up flags |
| 399 | public static final BooleanFlag ENABLE_NEW_MIGRATION_LOGIC = getDebugFlag(270393455, |
| 400 | "ENABLE_NEW_MIGRATION_LOGIC", ENABLED, |
| 401 | "Enable the new grid migration logic, keeping pages when src < dest"); |
| 402 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 403 | // TODO(Block 25): Clean up flags |
| 404 | public static final BooleanFlag ENABLE_NEW_GESTURE_NAV_TUTORIAL = getDebugFlag(270396257, |
| 405 | "ENABLE_NEW_GESTURE_NAV_TUTORIAL", ENABLED, |
| 406 | "Enable the redesigned gesture navigation tutorial"); |
| 407 | |
| 408 | // TODO(Block 26): Clean up flags |
| 409 | public static final BooleanFlag ENABLE_WIDGET_HOST_IN_BACKGROUND = getDebugFlag(270394384, |
| 410 | "ENABLE_WIDGET_HOST_IN_BACKGROUND", ENABLED, |
| 411 | "Enable background widget updates listening for widget holder"); |
| 412 | |
| 413 | // TODO(Block 27): Clean up flags |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 414 | public static final BooleanFlag ENABLE_OVERLAY_CONNECTION_OPTIM = getDebugFlag(270392629, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 415 | "ENABLE_OVERLAY_CONNECTION_OPTIM", DISABLED, |
Sunny Goyal | 64453ae | 2022-10-21 14:06:49 -0700 | [diff] [blame] | 416 | "Enable optimizing overlay service connection"); |
| 417 | |
Grace | 170911d | 2022-07-22 01:13:46 +0000 | [diff] [blame] | 418 | /** |
| 419 | * Enables region sampling for text color: Needs system health assessment before turning on |
| 420 | */ |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 421 | public static final BooleanFlag ENABLE_REGION_SAMPLING = getDebugFlag(270391669, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 422 | "ENABLE_REGION_SAMPLING", DISABLED, |
Grace | 170911d | 2022-07-22 01:13:46 +0000 | [diff] [blame] | 423 | "Enable region sampling to determine color of text on screen."); |
| 424 | |
vadimt | 5a07aad | 2020-02-12 14:40:05 -0800 | [diff] [blame] | 425 | public static final BooleanFlag ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS = |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 426 | getDebugFlag(270393096, "ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS", |
| 427 | DISABLED, "Always use hardware optimization for folder animations."); |
vadimt | 5a07aad | 2020-02-12 14:40:05 -0800 | [diff] [blame] | 428 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 429 | public static final BooleanFlag SEPARATE_RECENTS_ACTIVITY = getDebugFlag(270392980, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 430 | "SEPARATE_RECENTS_ACTIVITY", DISABLED, |
Sunny Goyal | a314d5a | 2020-05-20 20:34:04 -0700 | [diff] [blame] | 431 | "Uses a separate recents activity instead of using the integrated recents+Launcher UI"); |
| 432 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 433 | public static final BooleanFlag ENABLE_ENFORCED_ROUNDED_CORNERS = getReleaseFlag(270393258, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 434 | "ENABLE_ENFORCED_ROUNDED_CORNERS", ENABLED, |
| 435 | "Enforce rounded corners on all App Widgets"); |
Pierre Barbier de Reuille | 298526e | 2021-03-18 08:49:47 +0000 | [diff] [blame] | 436 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 437 | public static final BooleanFlag USE_LOCAL_ICON_OVERRIDES = getDebugFlag(270394973, |
| 438 | "USE_LOCAL_ICON_OVERRIDES", ENABLED, |
| 439 | "Use inbuilt monochrome icons if app doesn't provide one"); |
Schneider Victor-tulias | 766f2fc | 2022-05-11 10:27:30 -0700 | [diff] [blame] | 440 | |
Tracy Zhou | 859edd0 | 2023-11-08 22:44:44 -0800 | [diff] [blame] | 441 | // Aconfig migration complete for ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE. |
Tracy Zhou | 7e0f5d8 | 2022-10-09 23:39:24 -0700 | [diff] [blame] | 442 | public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE = getDebugFlag( |
Vinit Nayak | e606ad4 | 2023-08-16 17:28:10 +0000 | [diff] [blame] | 443 | 270393453, "ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE", DISABLED, |
Tracy Zhou | 7e0f5d8 | 2022-10-09 23:39:24 -0700 | [diff] [blame] | 444 | "Enable initiating split screen from workspace to workspace."); |
Vinit Nayak | a1be4c1 | 2023-10-24 16:57:39 -0700 | [diff] [blame] | 445 | public static boolean enableSplitContextually() { |
| 446 | return ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE.get() || |
| 447 | com.android.wm.shell.Flags.enableSplitContextual(); |
| 448 | } |
Tracy Zhou | 7e0f5d8 | 2022-10-09 23:39:24 -0700 | [diff] [blame] | 449 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 450 | public static final BooleanFlag ENABLE_TRACKPAD_GESTURE = getDebugFlag(271010401, |
Tracy Zhou | e715071 | 2023-05-15 18:43:29 +0000 | [diff] [blame] | 451 | "ENABLE_TRACKPAD_GESTURE", ENABLED, "Enables trackpad gesture."); |
Tracy Zhou | daad3fe | 2022-10-20 00:37:33 -0700 | [diff] [blame] | 452 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 453 | // TODO(Block 29): Clean up flags |
| 454 | public static final BooleanFlag ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT = getDebugFlag(270393897, |
| 455 | "ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT", DISABLED, |
| 456 | "Enables displaying the all apps button in the hotseat."); |
Nicolo' Mazzucato | 8d9edd2 | 2023-02-06 18:38:50 +0000 | [diff] [blame] | 457 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 458 | public static final BooleanFlag ENABLE_KEYBOARD_QUICK_SWITCH = getDebugFlag(270396844, |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 459 | "ENABLE_KEYBOARD_QUICK_SWITCH", ENABLED, "Enables keyboard quick switching"); |
Schneider Victor-tulias | f908729 | 2023-01-24 15:05:08 -0800 | [diff] [blame] | 460 | |
Schneider Victor-tulias | eb8dce0 | 2023-05-03 10:10:21 -0700 | [diff] [blame] | 461 | public static final BooleanFlag ENABLE_KEYBOARD_TASKBAR_TOGGLE = getDebugFlag(281726846, |
| 462 | "ENABLE_KEYBOARD_TASKBAR_TOGGLE", ENABLED, |
| 463 | "Enables keyboard taskbar stash toggling"); |
| 464 | |
Schneider Victor-tulias | ecaba5a | 2023-04-18 14:09:07 -0700 | [diff] [blame] | 465 | // TODO(Block 30): Clean up flags |
| 466 | public static final BooleanFlag USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES = getDebugFlag(270395010, |
| 467 | "USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES", DISABLED, |
| 468 | "Use local overrides for search request timeout"); |
Ankita Vyas | 45ef9b6 | 2023-01-20 09:19:29 +0000 | [diff] [blame] | 469 | |
Sebastian Franco | 7ba9489 | 2023-06-29 14:33:23 -0700 | [diff] [blame] | 470 | // TODO(Block 31): Clean up flags |
Vinit Nayak | 2a014d4 | 2023-04-24 20:55:50 -0700 | [diff] [blame] | 471 | |
Sebastian Franco | 7ba9489 | 2023-06-29 14:33:23 -0700 | [diff] [blame] | 472 | // TODO(Block 32): Clean up flags |
Thales Lima | ca31b61 | 2023-09-14 14:25:26 +0100 | [diff] [blame] | 473 | // Aconfig migration complete for ENABLE_RESPONSIVE_WORKSPACE. |
| 474 | @VisibleForTesting |
Thales Lima | ec5abba | 2023-04-05 16:33:50 +0100 | [diff] [blame] | 475 | public static final BooleanFlag ENABLE_RESPONSIVE_WORKSPACE = getDebugFlag(241386436, |
Thales Lima | 8f58b0a | 2023-09-25 16:27:21 -0700 | [diff] [blame] | 476 | "ENABLE_RESPONSIVE_WORKSPACE", TEAMFOOD, |
Thales Lima | ec5abba | 2023-04-05 16:33:50 +0100 | [diff] [blame] | 477 | "Enables new workspace grid calculations method."); |
Thales Lima | ca31b61 | 2023-09-14 14:25:26 +0100 | [diff] [blame] | 478 | public static boolean enableResponsiveWorkspace() { |
| 479 | return ENABLE_RESPONSIVE_WORKSPACE.get() || Flags.enableResponsiveWorkspace(); |
| 480 | } |
Thales Lima | ec5abba | 2023-04-05 16:33:50 +0100 | [diff] [blame] | 481 | |
Fengjiang Li | 1519c16 | 2023-06-15 12:28:42 -0700 | [diff] [blame] | 482 | // TODO(Block 33): Clean up flags |
Fengjiang Li | 1519c16 | 2023-06-15 12:28:42 -0700 | [diff] [blame] | 483 | public static final BooleanFlag ENABLE_ALL_APPS_RV_PREINFLATION = getDebugFlag(288161355, |
Fengjiang Li | 1a0c278 | 2023-12-14 18:19:35 +0000 | [diff] [blame] | 484 | "ENABLE_ALL_APPS_RV_PREINFLATION", ENABLED, |
Fengjiang Li | 1519c16 | 2023-06-15 12:28:42 -0700 | [diff] [blame] | 485 | "Enables preinflating all apps icons to avoid scrolling jank."); |
Fengjiang Li | 98c91a6 | 2023-08-04 17:16:11 +0000 | [diff] [blame] | 486 | public static final BooleanFlag ALL_APPS_GONE_VISIBILITY = getDebugFlag(291651514, |
Fengjiang Li | 1a0c278 | 2023-12-14 18:19:35 +0000 | [diff] [blame] | 487 | "ALL_APPS_GONE_VISIBILITY", ENABLED, |
Fengjiang Li | 98c91a6 | 2023-08-04 17:16:11 +0000 | [diff] [blame] | 488 | "Set all apps container view's hidden visibility to GONE instead of INVISIBLE."); |
| 489 | |
Schneider Victor-tulias | 8d3d623 | 2023-09-26 17:19:15 -0400 | [diff] [blame] | 490 | // TODO(Block 34): Empty block |
| 491 | // Please only add flags to your assigned block. If you do not have a block: |
| 492 | // 1. Assign yourself this block |
| 493 | // 2. Add your flag to this block |
| 494 | // 3. Add a new empty block below this one |
| 495 | // 4. Move this comment to that new empty block |
| 496 | // This is all to prevent merge conflicts in the future and help keep track of who owns which |
| 497 | // flags. |
| 498 | // List of assigned blocks can be found: http://go/gnl-flags-block-directory |
Sebastian Franco | 7ba9489 | 2023-06-29 14:33:23 -0700 | [diff] [blame] | 499 | |
Sunny Goyal | 94fa76f | 2020-01-21 11:59:19 -0800 | [diff] [blame] | 500 | public static class BooleanFlag { |
Ryan Lothian | fa530cd | 2018-10-12 14:14:16 -0400 | [diff] [blame] | 501 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 502 | private final boolean mCurrentValue; |
Hyunyoung Song | e17a699 | 2019-09-09 23:32:17 -0700 | [diff] [blame] | 503 | |
Sunny Goyal | 749983b | 2023-02-24 09:27:04 -0800 | [diff] [blame] | 504 | public BooleanFlag(boolean currentValue) { |
| 505 | mCurrentValue = currentValue; |
Ryan Lothian | fa530cd | 2018-10-12 14:14:16 -0400 | [diff] [blame] | 506 | } |
| 507 | |
Ryan Lothian | fa530cd | 2018-10-12 14:14:16 -0400 | [diff] [blame] | 508 | public boolean get() { |
Sunny Goyal | b138ec9 | 2023-03-02 16:49:59 -0800 | [diff] [blame] | 509 | return sBooleanReader.test(this); |
Sunny Goyal | 94fa76f | 2020-01-21 11:59:19 -0800 | [diff] [blame] | 510 | } |
Sunny Goyal | 94fa76f | 2020-01-21 11:59:19 -0800 | [diff] [blame] | 511 | } |
Sunny Goyal | 2003c1c | 2023-02-28 12:00:27 -0800 | [diff] [blame] | 512 | |
| 513 | /** |
| 514 | * Class representing an integer flag |
| 515 | */ |
| 516 | public static class IntFlag { |
| 517 | |
| 518 | private final int mCurrentValue; |
| 519 | |
| 520 | public IntFlag(int currentValue) { |
| 521 | mCurrentValue = currentValue; |
| 522 | } |
| 523 | |
| 524 | public int get() { |
Sunny Goyal | b138ec9 | 2023-03-02 16:49:59 -0800 | [diff] [blame] | 525 | return sIntReader.applyAsInt(this); |
Sunny Goyal | 2003c1c | 2023-02-28 12:00:27 -0800 | [diff] [blame] | 526 | } |
| 527 | } |
Sunny Goyal | ef6b0c0 | 2023-03-20 15:56:07 -0700 | [diff] [blame] | 528 | |
| 529 | /** |
| 530 | * Enabled state for a flag |
| 531 | */ |
| 532 | public enum FlagState { |
| 533 | ENABLED, |
| 534 | DISABLED, |
| 535 | TEAMFOOD // Enabled in team food |
| 536 | } |
Sunny Goyal | e1ee42c | 2017-07-24 01:02:38 -0700 | [diff] [blame] | 537 | } |