Include a developer option sliding flag to toggle the different amount of apps to show
Bug: 299294792
Test: Verified SearchTransitionController didn't regress by turning off BACKGROUND_DRAWABLES flag.
Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Change-Id: I78ee3a9dbc2d60f1b7acaa5834a8c656217a07d8
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java
index 301fbe4..c1a85fa 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java
@@ -28,6 +28,7 @@
import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_START_SCALE_PERCENT;
import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_SLOP_PERCENTAGE;
import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_TIMEOUT_MS;
+import static com.android.launcher3.LauncherPrefs.PRIVATE_SPACE_APPS;
import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_HIGHLIGHT_KEY;
import static com.android.launcher3.uioverrides.plugins.PluginManagerWrapper.PLUGIN_CHANGED;
import static com.android.launcher3.uioverrides.plugins.PluginManagerWrapper.pluginEnabledKey;
@@ -67,6 +68,7 @@
import androidx.preference.SwitchPreference;
import com.android.launcher3.ConstantItem;
+import com.android.launcher3.Flags;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
@@ -115,6 +117,9 @@
addAllAppsFromOverviewCatergory();
}
addCustomLpnhCategory();
+ if (Flags.enablePrivateSpace()) {
+ addCustomPrivateAppsCategory();
+ }
}
private void filterPreferences(String query, PreferenceGroup pg) {
@@ -365,6 +370,12 @@
}
}
+ private void addCustomPrivateAppsCategory() {
+ PreferenceCategory category = newCategory("Apps in Private Space Config");
+ category.addPreference(createSeekBarPreference(
+ "Number of Apps to put in private region", 0, 100, 1, PRIVATE_SPACE_APPS));
+ }
+
/**
* Create a preference with text and a seek bar. Should be added to a PreferenceCategory.
*
diff --git a/src/com/android/launcher3/LauncherPrefs.kt b/src/com/android/launcher3/LauncherPrefs.kt
index a05b0f5..78056e6 100644
--- a/src/com/android/launcher3/LauncherPrefs.kt
+++ b/src/com/android/launcher3/LauncherPrefs.kt
@@ -364,6 +364,13 @@
EncryptionType.MOVE_TO_DEVICE_PROTECTED
)
@JvmField
+ val PRIVATE_SPACE_APPS =
+ nonRestorableItem(
+ "pref_private_space_apps",
+ 0,
+ EncryptionType.MOVE_TO_DEVICE_PROTECTED
+ )
+ @JvmField
val THEMED_ICONS =
backedUpItem(Themes.KEY_THEMED_ICONS, false, EncryptionType.MOVE_TO_DEVICE_PROTECTED)
@JvmField val PROMISE_ICON_IDS = backedUpItem(InstallSessionHelper.PROMISE_ICON_IDS, "")