From dbc8ec530c3d91948db5f5cd4e83effc26f65eb1 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Thu, 21 Sep 2023 19:05:07 +0000 Subject: [PATCH] Move "Enable Boot Aware Startup data" to behind a FeatureFlag. Previously this was hard-coded to disabled, but that was before FeatureFlags were made to be boot aware. Bug: 251502424 Test: Verified that doing this doesn't break my device. Also tested the Pre-loading feature itself and didn't see any errors in the logs. Change-Id: I031e1756b985664a2e8d8ad26e16803ead874727 --- src/com/android/launcher3/LauncherPrefs.kt | 7 ++++--- src/com/android/launcher3/config/FeatureFlags.java | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/LauncherPrefs.kt b/src/com/android/launcher3/LauncherPrefs.kt index 427eaa3bab..36d37c7b62 100644 --- a/src/com/android/launcher3/LauncherPrefs.kt +++ b/src/com/android/launcher3/LauncherPrefs.kt @@ -376,9 +376,10 @@ class LauncherPrefs(private val encryptedContext: Context) { } } -// This is hard-coded to false for now until it is time to release this optimization. It is only -// a var because the unit tests are setting this to true so they can run. -@VisibleForTesting var isBootAwareStartupDataEnabled: Boolean = false +// It is a var because the unit tests are setting this to true so they can run. +@VisibleForTesting +var isBootAwareStartupDataEnabled: Boolean = + com.android.launcher3.config.FeatureFlags.ENABLE_BOOT_AWARE_STARTUP_DATA.get() private val BOOT_AWARE_ITEMS: MutableSet> = mutableSetOf() diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index a136ef0964..e00005bfc5 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -265,6 +265,11 @@ public final class FeatureFlags { "Enables taskbar pinning to allow user to switch between transient and persistent " + "taskbar flavors"); + public static final BooleanFlag ENABLE_BOOT_AWARE_STARTUP_DATA = getDebugFlag(251502424, + "ENABLE_BOOT_AWARE_STARTUP_DATA", DISABLED, "Marks LauncherPref data as (and allows it " + + "to) available while the device is locked. Enabling this causes a 1-time " + + "migration of certain SharedPreferences data. Improves startup latency."); + // TODO(Block 18): Clean up flags public static final BooleanFlag ENABLE_APP_PAIRS = getDebugFlag(274189428, "ENABLE_APP_PAIRS", DISABLED,