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 19 import static com.android.launcher3.config.FeatureFlags.FlagState.DISABLED; 20 import static com.android.launcher3.config.FeatureFlags.FlagState.ENABLED; 21 import static com.android.launcher3.config.FeatureFlags.FlagState.TEAMFOOD; 22 import static com.android.launcher3.uioverrides.flags.FlagsFactory.getDebugFlag; 23 import static com.android.launcher3.uioverrides.flags.FlagsFactory.getReleaseFlag; 24 25 import android.content.Context; 26 27 import androidx.annotation.VisibleForTesting; 28 29 import com.android.launcher3.BuildConfig; 30 import com.android.launcher3.Utilities; 31 32 import java.util.function.Predicate; 33 import java.util.function.ToIntFunction; 34 35 /** 36 * Defines a set of flags used to control various launcher behaviors. 37 * 38 * Please only add flags to your assigned block to prevent merge conflicts. If you do not have 39 * a block, please update the current empty block and add a new empty block below to prevent 40 * merge conflicts with the previous block. 41 * List of blocks can be found: 42 * <a href="http://go/gnl-flags-block-directory">here</a> 43 * 44 * <p>All the flags should be defined here with appropriate default values. 45 */ 46 public final class FeatureFlags { 47 48 @VisibleForTesting 49 public static Predicate<BooleanFlag> sBooleanReader = f -> f.mCurrentValue; 50 @VisibleForTesting 51 public static ToIntFunction<IntFlag> sIntReader = f -> f.mCurrentValue; 52 FeatureFlags()53 private FeatureFlags() { } 54 showFlagTogglerUi(Context context)55 public static boolean showFlagTogglerUi(Context context) { 56 return BuildConfig.IS_DEBUG_DEVICE && Utilities.isDevelopersOptionsEnabled(context); 57 } 58 59 /** 60 * True when the build has come from Android Studio and is being used for local debugging. 61 * @deprecated Use {@link BuildConfig#IS_STUDIO_BUILD} directly 62 */ 63 @Deprecated 64 public static final boolean IS_STUDIO_BUILD = BuildConfig.IS_STUDIO_BUILD; 65 66 /** 67 * Enable moving the QSB on the 0th screen of the workspace. This is not a configuration feature 68 * and should be modified at a project level. 69 * @deprecated Use {@link BuildConfig#QSB_ON_FIRST_SCREEN} directly 70 */ 71 @Deprecated 72 public static final boolean QSB_ON_FIRST_SCREEN = BuildConfig.QSB_ON_FIRST_SCREEN; 73 74 /** 75 * Feature flag to handle define config changes dynamically instead of killing the process. 76 * <p> 77 * 78 * To add a new flag that can be toggled through the flags UI: 79 * <p> 80 * Declare a new ToggleableFlag below. Give it a unique key (e.g. "QSB_ON_FIRST_SCREEN"), 81 * and set a default value for the flag. This will be the default value on Debug builds. 82 * <p> 83 */ 84 // TODO(Block 1): Clean up flags 85 public static final BooleanFlag ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES = getReleaseFlag( 86 270394041, "ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES", ENABLED, 87 "Enable option to replace decorator-based search result backgrounds with drawables"); 88 89 public static final BooleanFlag ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION = getReleaseFlag( 90 270394392, "ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION", ENABLED, 91 "Enable option to launch search results using the new view container transitions"); 92 93 // TODO(Block 2): Clean up flags 94 public static final BooleanFlag ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH = getDebugFlag(270395073, 95 "ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH", DISABLED, 96 "Allow bottom sheet depth to be smaller than 1 for multi-display devices."); 97 98 // TODO(Block 3): Clean up flags 99 public static final BooleanFlag ENABLE_DISMISS_PREDICTION_UNDO = getDebugFlag(270394476, 100 "ENABLE_DISMISS_PREDICTION_UNDO", DISABLED, 101 "Show an 'Undo' snackbar when users dismiss a predicted hotseat item"); 102 103 public static final BooleanFlag CONTINUOUS_VIEW_TREE_CAPTURE = getDebugFlag(270395171, 104 "CONTINUOUS_VIEW_TREE_CAPTURE", ENABLED, "Capture View tree every frame"); 105 106 public static final BooleanFlag ENABLE_WORKSPACE_LOADING_OPTIMIZATION = getDebugFlag(251502424, 107 "ENABLE_WORKSPACE_LOADING_OPTIMIZATION", DISABLED, 108 "load the current workspace screen visible to the user before the rest rather than " 109 + "loading all of them at once."); 110 111 public static final BooleanFlag CHANGE_MODEL_DELEGATE_LOADING_ORDER = getDebugFlag(251502424, 112 "CHANGE_MODEL_DELEGATE_LOADING_ORDER", DISABLED, 113 "changes the timing of the loading and binding of delegate items during " 114 + "data preparation for loading the home screen"); 115 116 // TODO(Block 4): Cleanup flags 117 public static final BooleanFlag ENABLE_FLOATING_SEARCH_BAR = 118 getReleaseFlag(268388460, "ENABLE_FLOATING_SEARCH_BAR", DISABLED, 119 "Allow search bar to persist and animate across states, and attach to" 120 + " the keyboard from the bottom of the screen"); 121 122 public static final BooleanFlag ENABLE_ALL_APPS_FROM_OVERVIEW = 123 getDebugFlag(275132633, "ENABLE_ALL_APPS_FROM_OVERVIEW", DISABLED, 124 "Allow entering All Apps from Overview (e.g. long swipe up from app)"); 125 126 public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = getReleaseFlag( 127 270394468, "ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", ENABLED, 128 "Enable option to show keyboard when going to all-apps"); 129 130 // TODO(Block 5): Clean up flags 131 public static final BooleanFlag ENABLE_TWOLINE_DEVICESEARCH = getDebugFlag(201388851, 132 "ENABLE_TWOLINE_DEVICESEARCH", ENABLED, 133 "Enable two line label for icons with labels on device search."); 134 135 public static final BooleanFlag ENABLE_ICON_IN_TEXT_HEADER = getDebugFlag(270395143, 136 "ENABLE_ICON_IN_TEXT_HEADER", DISABLED, "Show icon in textheader"); 137 138 public static final BooleanFlag ENABLE_PREMIUM_HAPTICS_ALL_APPS = getDebugFlag(270396358, 139 "ENABLE_PREMIUM_HAPTICS_ALL_APPS", DISABLED, 140 "Enables haptics opening/closing All apps"); 141 142 // TODO(Block 6): Clean up flags 143 public static final BooleanFlag ENABLE_ALL_APPS_SEARCH_IN_TASKBAR = getDebugFlag(270393900, 144 "ENABLE_ALL_APPS_SEARCH_IN_TASKBAR", DISABLED, 145 "Enables Search box in Taskbar All Apps."); 146 147 public static final BooleanFlag SECONDARY_DRAG_N_DROP_TO_PIN = getDebugFlag(270395140, 148 "SECONDARY_DRAG_N_DROP_TO_PIN", DISABLED, 149 "Enable dragging and dropping to pin apps within secondary display"); 150 151 // TODO(Block 7): Clean up flags 152 public static final BooleanFlag ENABLE_FORCED_MONO_ICON = getDebugFlag(270396209, 153 "ENABLE_FORCED_MONO_ICON", DISABLED, 154 "Enable the ability to generate monochromatic icons, if it is not provided by the app"); 155 156 // TODO(Block 8): Clean up flags 157 public static final BooleanFlag ENABLE_MATERIAL_U_POPUP = getDebugFlag(270395516, 158 "ENABLE_MATERIAL_U_POPUP", ENABLED, "Switch popup UX to use material U"); 159 160 // TODO(Block 9): Clean up flags 161 public static final BooleanFlag ENABLE_DOWNLOAD_APP_UX_V2 = getReleaseFlag(270395134, 162 "ENABLE_DOWNLOAD_APP_UX_V2", ENABLED, "Updates the download app UX" 163 + " to have better visuals"); 164 165 public static final BooleanFlag ENABLE_DOWNLOAD_APP_UX_V3 = getDebugFlag(270395186, 166 "ENABLE_DOWNLOAD_APP_UX_V3", ENABLED, "Updates the download app UX" 167 + " to have better visuals, improve contrast, and color"); 168 169 public static final BooleanFlag SHOW_DOT_PAGINATION = getDebugFlag(270395278, 170 "SHOW_DOT_PAGINATION", ENABLED, "Enable showing dot pagination in workspace"); 171 172 public static final BooleanFlag LARGE_SCREEN_WIDGET_PICKER = getDebugFlag(270395809, 173 "LARGE_SCREEN_WIDGET_PICKER", ENABLED, "Enable new widget picker that takes " 174 + "advantage of large screen format"); 175 176 public static final BooleanFlag MULTI_SELECT_EDIT_MODE = getDebugFlag(270709220, 177 "MULTI_SELECT_EDIT_MODE", DISABLED, "Enable new multi-select edit mode " 178 + "for home screen"); 179 180 // TODO(Block 10): Clean up flags 181 public static final BooleanFlag ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION = getDebugFlag(270614790, 182 "ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION", DISABLED, 183 "Enables predictive back animation from all apps and widgets to home"); 184 185 // TODO(Block 11): Clean up flags 186 public static final BooleanFlag FOLDABLE_SINGLE_PAGE = getDebugFlag(270395274, 187 "FOLDABLE_SINGLE_PAGE", DISABLED, "Use a single page for the workspace"); 188 189 public static final BooleanFlag ENABLE_PARAMETRIZE_REORDER = getDebugFlag(289420844, 190 "ENABLE_PARAMETRIZE_REORDER", DISABLED, 191 "Enables generating the reorder using a set of parameters"); 192 193 // TODO(Block 12): Clean up flags 194 public static final BooleanFlag ENABLE_MULTI_INSTANCE = getDebugFlag(270396680, 195 "ENABLE_MULTI_INSTANCE", DISABLED, 196 "Enables creation and filtering of multiple task instances in overview"); 197 198 // TODO(Block 13): Clean up flags 199 public static final BooleanFlag ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING = getReleaseFlag( 200 270391397, "ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING", DISABLED, 201 "Allows on device search in all apps logging"); 202 203 // TODO(Block 14): Cleanup flags 204 public static final BooleanFlag NOTIFY_CRASHES = getDebugFlag(270393108, "NOTIFY_CRASHES", 205 TEAMFOOD, "Sends a notification whenever launcher encounters an uncaught exception."); 206 207 public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(270395798, 208 "ENABLE_TRANSIENT_TASKBAR", ENABLED, "Enables transient taskbar."); 209 210 // TODO(Block 16): Clean up flags 211 // When enabled the promise icon is visible in all apps while installation an app. 212 public static final BooleanFlag PROMISE_APPS_IN_ALL_APPS = getDebugFlag(270390012, 213 "PROMISE_APPS_IN_ALL_APPS", DISABLED, "Add promise icon in all-apps"); 214 215 public static final BooleanFlag KEYGUARD_ANIMATION = getDebugFlag(270390904, 216 "KEYGUARD_ANIMATION", DISABLED, 217 "Enable animation for keyguard going away on wallpaper"); 218 219 public static final BooleanFlag ENABLE_DEVICE_SEARCH = getReleaseFlag(270390907, 220 "ENABLE_DEVICE_SEARCH", ENABLED, "Allows on device search in all apps"); 221 222 public static final BooleanFlag ENABLE_HIDE_HEADER = getReleaseFlag(270390930, 223 "ENABLE_HIDE_HEADER", ENABLED, "Hide header on keyboard before typing in all apps"); 224 225 public static final BooleanFlag ENABLE_EXPANDING_PAUSE_WORK_BUTTON = getDebugFlag(270390779, 226 "ENABLE_EXPANDING_PAUSE_WORK_BUTTON", DISABLED, 227 "Expand and collapse pause work button while scrolling"); 228 229 public static final BooleanFlag COLLECT_SEARCH_HISTORY = getReleaseFlag(270391455, 230 "COLLECT_SEARCH_HISTORY", DISABLED, "Allow launcher to collect search history for log"); 231 232 public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(270390937, 233 "ENABLE_TWOLINE_ALLAPPS", DISABLED, "Enables two line label inside all apps."); 234 235 public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(270391693, 236 "IME_STICKY_SNACKBAR_EDU", ENABLED, "Show sticky IME edu in AllApps"); 237 238 public static final BooleanFlag ENABLE_PEOPLE_TILE_PREVIEW = getDebugFlag(270391653, 239 "ENABLE_PEOPLE_TILE_PREVIEW", DISABLED, 240 "Experimental: Shows conversation shortcuts on home screen as search results"); 241 242 public static final BooleanFlag FOLDER_NAME_MAJORITY_RANKING = getDebugFlag(270391638, 243 "FOLDER_NAME_MAJORITY_RANKING", ENABLED, 244 "Suggests folder names based on majority based ranking."); 245 246 public static final BooleanFlag INJECT_FALLBACK_APP_CORPUS_RESULTS = getReleaseFlag(270391706, 247 "INJECT_FALLBACK_APP_CORPUS_RESULTS", DISABLED, 248 "Inject fallback app corpus result when AiAi fails to return it."); 249 250 public static final BooleanFlag ENABLE_LONG_PRESS_NAV_HANDLE = 251 getReleaseFlag(282993230, "ENABLE_LONG_PRESS_NAV_HANDLE_MPR", TEAMFOOD, 252 "Enables long pressing on the bottom bar nav handle to trigger events."); 253 254 // TODO(Block 17): Clean up flags 255 public static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(270396583, 256 "ENABLE_TASKBAR_PINNING", DISABLED, 257 "Enables taskbar pinning to allow user to switch between transient and persistent " 258 + "taskbar flavors"); 259 260 // TODO(Block 18): Clean up flags 261 public static final BooleanFlag ENABLE_APP_PAIRS = getDebugFlag(274189428, 262 "ENABLE_APP_PAIRS", DISABLED, 263 "Enables the ability to create and save app pairs on the Home screen for easy" 264 + " split screen launching."); 265 266 // TODO(Block 19): Clean up flags 267 public static final BooleanFlag SCROLL_TOP_TO_RESET = getReleaseFlag(270395177, 268 "SCROLL_TOP_TO_RESET", ENABLED, 269 "Bring up IME and focus on input when scroll to top if 'Always show keyboard'" 270 + " is enabled or in prefix state"); 271 272 public static final BooleanFlag ENABLE_SEARCH_UNINSTALLED_APPS = getReleaseFlag(270395269, 273 "ENABLE_SEARCH_UNINSTALLED_APPS", ENABLED, "Search uninstalled app results."); 274 275 // TODO(Block 20): Clean up flags 276 public static final BooleanFlag ENABLE_SCRIM_FOR_APP_LAUNCH = getDebugFlag(270393276, 277 "ENABLE_SCRIM_FOR_APP_LAUNCH", DISABLED, "Enables scrim during app launch animation."); 278 279 public static final BooleanFlag ENABLE_BACK_SWIPE_HOME_ANIMATION = getDebugFlag(270393426, 280 "ENABLE_BACK_SWIPE_HOME_ANIMATION", ENABLED, 281 "Enables home animation to icon when user swipes back."); 282 283 public static final BooleanFlag ENABLE_DYNAMIC_TASKBAR_THRESHOLDS = getDebugFlag(294252473, 284 "ENABLE_DYNAMIC_TASKBAR_THRESHOLDS", ENABLED, 285 "Enables taskbar thresholds that scale based on screen size."); 286 287 // TODO(Block 21): Clean up flags 288 public static final BooleanFlag ENABLE_APP_ICON_FOR_INLINE_SHORTCUTS = getDebugFlag(270395087, 289 "ENABLE_APP_ICON_IN_INLINE_SHORTCUTS", DISABLED, "Show app icon for inline shortcut"); 290 291 // TODO(Block 22): Clean up flags 292 public static final BooleanFlag ENABLE_WIDGET_TRANSITION_FOR_RESIZING = getDebugFlag(268553314, 293 "ENABLE_WIDGET_TRANSITION_FOR_RESIZING", DISABLED, 294 "Enable widget transition animation when resizing the widgets"); 295 296 public static final BooleanFlag PREEMPTIVE_UNFOLD_ANIMATION_START = getDebugFlag(270397209, 297 "PREEMPTIVE_UNFOLD_ANIMATION_START", ENABLED, 298 "Enables starting the unfold animation preemptively when unfolding, without" 299 + "waiting for SystemUI and then merging the SystemUI progress whenever we " 300 + "start receiving the events"); 301 302 // TODO(Block 23): Clean up flags 303 public static final BooleanFlag ENABLE_GRID_ONLY_OVERVIEW = getDebugFlag(270397206, 304 "ENABLE_GRID_ONLY_OVERVIEW", TEAMFOOD, 305 "Enable a grid-only overview without a focused task."); 306 307 public static final BooleanFlag ENABLE_CURSOR_HOVER_STATES = getDebugFlag(243191650, 308 "ENABLE_CURSOR_HOVER_STATES", TEAMFOOD, 309 "Enables cursor hover states for certain elements."); 310 311 // TODO(Block 24): Clean up flags 312 public static final BooleanFlag ENABLE_NEW_MIGRATION_LOGIC = getDebugFlag(270393455, 313 "ENABLE_NEW_MIGRATION_LOGIC", ENABLED, 314 "Enable the new grid migration logic, keeping pages when src < dest"); 315 316 public static final BooleanFlag ENABLE_CACHED_WIDGET = getDebugFlag(270395008, 317 "ENABLE_CACHED_WIDGET", ENABLED, 318 "Show previously cached widgets as opposed to deferred widget where available"); 319 320 // TODO(Block 25): Clean up flags 321 public static final BooleanFlag ENABLE_NEW_GESTURE_NAV_TUTORIAL = getDebugFlag(270396257, 322 "ENABLE_NEW_GESTURE_NAV_TUTORIAL", ENABLED, 323 "Enable the redesigned gesture navigation tutorial"); 324 325 // TODO(Block 26): Clean up flags 326 public static final BooleanFlag ENABLE_WIDGET_HOST_IN_BACKGROUND = getDebugFlag(270394384, 327 "ENABLE_WIDGET_HOST_IN_BACKGROUND", ENABLED, 328 "Enable background widget updates listening for widget holder"); 329 330 // TODO(Block 27): Clean up flags 331 public static final BooleanFlag ENABLE_OVERLAY_CONNECTION_OPTIM = getDebugFlag(270392629, 332 "ENABLE_OVERLAY_CONNECTION_OPTIM", DISABLED, 333 "Enable optimizing overlay service connection"); 334 335 /** 336 * Enables region sampling for text color: Needs system health assessment before turning on 337 */ 338 public static final BooleanFlag ENABLE_REGION_SAMPLING = getDebugFlag(270391669, 339 "ENABLE_REGION_SAMPLING", DISABLED, 340 "Enable region sampling to determine color of text on screen."); 341 342 public static final BooleanFlag ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS = 343 getDebugFlag(270393096, "ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS", 344 DISABLED, "Always use hardware optimization for folder animations."); 345 346 public static final BooleanFlag SEPARATE_RECENTS_ACTIVITY = getDebugFlag(270392980, 347 "SEPARATE_RECENTS_ACTIVITY", DISABLED, 348 "Uses a separate recents activity instead of using the integrated recents+Launcher UI"); 349 350 public static final BooleanFlag ENABLE_ENFORCED_ROUNDED_CORNERS = getReleaseFlag(270393258, 351 "ENABLE_ENFORCED_ROUNDED_CORNERS", ENABLED, 352 "Enforce rounded corners on all App Widgets"); 353 354 public static final BooleanFlag ENABLE_ICON_LABEL_AUTO_SCALING = getDebugFlag(270393294, 355 "ENABLE_ICON_LABEL_AUTO_SCALING", ENABLED, 356 "Enables scaling/spacing for icon labels to make more characters visible"); 357 358 public static final BooleanFlag USE_LOCAL_ICON_OVERRIDES = getDebugFlag(270394973, 359 "USE_LOCAL_ICON_OVERRIDES", ENABLED, 360 "Use inbuilt monochrome icons if app doesn't provide one"); 361 362 // TODO(Block 28): Clean up flags 363 public static final BooleanFlag ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS = 364 getDebugFlag(270394122, "ENABLE_SPLIT_FROM_FULLSCREEN_SHORTCUT", DISABLED, 365 "Enable splitting from fullscreen app with keyboard shortcuts"); 366 367 public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE = getDebugFlag( 368 270393453, "ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE", DISABLED, 369 "Enable initiating split screen from workspace to workspace."); 370 371 public static final BooleanFlag ENABLE_SPLIT_FROM_DESKTOP_TO_WORKSPACE = getDebugFlag( 372 279586624, "ENABLE_SPLIT_FROM_DESKTOP_TO_WORKSPACE", DISABLED, 373 "Enable initiating split screen from desktop mode to workspace."); 374 375 public static final BooleanFlag ENABLE_TRACKPAD_GESTURE = getDebugFlag(271010401, 376 "ENABLE_TRACKPAD_GESTURE", ENABLED, "Enables trackpad gesture."); 377 378 // TODO(Block 29): Clean up flags 379 public static final BooleanFlag ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT = getDebugFlag(270393897, 380 "ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT", DISABLED, 381 "Enables displaying the all apps button in the hotseat."); 382 383 public static final BooleanFlag ENABLE_KEYBOARD_QUICK_SWITCH = getDebugFlag(270396844, 384 "ENABLE_KEYBOARD_QUICK_SWITCH", ENABLED, "Enables keyboard quick switching"); 385 386 public static final BooleanFlag ENABLE_KEYBOARD_TASKBAR_TOGGLE = getDebugFlag(281726846, 387 "ENABLE_KEYBOARD_TASKBAR_TOGGLE", ENABLED, 388 "Enables keyboard taskbar stash toggling"); 389 390 // TODO(Block 30): Clean up flags 391 public static final BooleanFlag USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES = getDebugFlag(270395010, 392 "USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES", DISABLED, 393 "Use local overrides for search request timeout"); 394 395 // TODO(Block 31): Clean up flags 396 397 // TODO(Block 32): Clean up flags 398 public static final BooleanFlag ENABLE_RESPONSIVE_WORKSPACE = getDebugFlag(241386436, 399 "ENABLE_RESPONSIVE_WORKSPACE", DISABLED, 400 "Enables new workspace grid calculations method."); 401 402 // TODO(Block 33): Clean up flags 403 public static final BooleanFlag ENABLE_ALL_APPS_RV_PREINFLATION = getDebugFlag(288161355, 404 "ENABLE_ALL_APPS_RV_PREINFLATION", ENABLED, 405 "Enables preinflating all apps icons to avoid scrolling jank."); 406 407 // TODO(Block 34): Clean up flags 408 public static final BooleanFlag ALL_APPS_GONE_VISIBILITY = getDebugFlag(291651514, 409 "ALL_APPS_GONE_VISIBILITY", ENABLED, 410 "Set all apps container view's hidden visibility to GONE instead of INVISIBLE."); 411 412 // TODO(Block 35): Empty block 413 414 public static class BooleanFlag { 415 416 private final boolean mCurrentValue; 417 BooleanFlag(boolean currentValue)418 public BooleanFlag(boolean currentValue) { 419 mCurrentValue = currentValue; 420 } 421 get()422 public boolean get() { 423 return sBooleanReader.test(this); 424 } 425 } 426 427 /** 428 * Class representing an integer flag 429 */ 430 public static class IntFlag { 431 432 private final int mCurrentValue; 433 IntFlag(int currentValue)434 public IntFlag(int currentValue) { 435 mCurrentValue = currentValue; 436 } 437 get()438 public int get() { 439 return sIntReader.applyAsInt(this); 440 } 441 } 442 443 /** 444 * Enabled state for a flag 445 */ 446 public enum FlagState { 447 ENABLED, 448 DISABLED, 449 TEAMFOOD // Enabled in team food 450 } 451 } 452