Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-qpr-dev
diff --git a/protos/launcher_atom.proto b/protos/launcher_atom.proto
index c8a7d85..c638ba9 100644
--- a/protos/launcher_atom.proto
+++ b/protos/launcher_atom.proto
@@ -130,7 +130,7 @@
optional int32 cardinality = 2;
}
-// Next value 43
+// Next value 44
enum Attribute {
UNKNOWN = 0;
DEFAULT_LAYOUT = 1; // icon automatically placed in workspace, folder, hotseat
@@ -176,6 +176,7 @@
ALL_APPS_SEARCH_RESULT_ASSISTANT_MEMORY = 31;
ALL_APPS_SEARCH_RESULT_VIDEO = 41;
ALL_APPS_SEARCH_RESULT_SYSTEM_POINTER = 42;
+ ALL_APPS_SEARCH_RESULT_EDUCARD = 43;
// Web suggestions provided by AGA
ALL_APPS_SEARCH_RESULT_WEB_SUGGEST = 39;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 0b86155..b586487 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -471,6 +471,7 @@
if (mControllers.taskbarActivityContext.isDestroyed()) {
Log.e("b/260135164", "updateIconAlphaForHome is called after Taskbar is destroyed",
new Exception());
+ return;
}
mIconAlphaForHome.setValue(alpha);
boolean hotseatVisible = alpha == 0
diff --git a/quickstep/src/com/android/launcher3/uioverrides/DeviceFlag.java b/quickstep/src/com/android/launcher3/uioverrides/DeviceFlag.java
deleted file mode 100644
index c46809a..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/DeviceFlag.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.uioverrides;
-
-import android.annotation.TargetApi;
-import android.os.Build;
-import android.provider.DeviceConfig;
-
-import com.android.launcher3.config.FeatureFlags.DebugFlag;
-
-@TargetApi(Build.VERSION_CODES.P)
-public class DeviceFlag extends DebugFlag {
-
- public static final String NAMESPACE_LAUNCHER = "launcher";
-
- private final boolean mDefaultValueInCode;
-
- public DeviceFlag(String key, boolean defaultValue, String description) {
- super(key, getDeviceValue(key, defaultValue), description);
- mDefaultValueInCode = defaultValue;
- }
-
- @Override
- protected StringBuilder appendProps(StringBuilder src) {
- return super.appendProps(src).append(", mDefaultValueInCode=").append(mDefaultValueInCode);
- }
-
- @Override
- public boolean get() {
- // Override this method in order to let Robolectric ShadowDeviceFlag to stub it.
- return super.get();
- }
-
- protected static boolean getDeviceValue(String key, boolean defaultValue) {
- return DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, defaultValue);
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DebugFlag.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DebugFlag.java
new file mode 100644
index 0000000..177a399
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/DebugFlag.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.uioverrides.flags;
+
+import com.android.launcher3.config.FeatureFlags.BooleanFlag;
+
+class DebugFlag extends BooleanFlag {
+
+ public final String key;
+ public final String description;
+
+ public final boolean defaultValue;
+
+ boolean mHasBeenChangedAtLeastOnce;
+
+ public DebugFlag(String key, String description, boolean defaultValue, boolean currentValue) {
+ super(currentValue);
+ this.key = key;
+ this.defaultValue = defaultValue;
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return key + ": defaultValue=" + defaultValue + ", mCurrentValue=" + get();
+ }
+}
diff --git a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsFragment.java
similarity index 99%
rename from src/com/android/launcher3/settings/DeveloperOptionsFragment.java
rename to quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsFragment.java
index 40fc16e..9384a89 100644
--- a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsFragment.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.settings;
+package com.android.launcher3.uioverrides.flags;
import static android.content.Intent.ACTION_PACKAGE_ADDED;
import static android.content.Intent.ACTION_PACKAGE_CHANGED;
@@ -63,7 +63,6 @@
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.config.FlagTogglerPrefUi;
import com.android.launcher3.secondarydisplay.SecondaryDisplayLauncher;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.OnboardingPrefs;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DeviceFlag.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DeviceFlag.java
new file mode 100644
index 0000000..3900ebb
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/DeviceFlag.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.uioverrides.flags;
+
+class DeviceFlag extends DebugFlag {
+
+ private final boolean mDefaultValueInCode;
+
+ public DeviceFlag(String key, String description, boolean defaultValue,
+ boolean currentValue, boolean defaultValueInCode) {
+ super(key, description, defaultValue, currentValue);
+ mDefaultValueInCode = defaultValueInCode;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + ", mDefaultValueInCode=" + mDefaultValueInCode;
+ }
+}
diff --git a/src/com/android/launcher3/config/FlagTogglerPrefUi.java b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagTogglerPrefUi.java
similarity index 93%
rename from src/com/android/launcher3/config/FlagTogglerPrefUi.java
rename to quickstep/src/com/android/launcher3/uioverrides/flags/FlagTogglerPrefUi.java
index 2eb6e6d..4ca7e31 100644
--- a/src/com/android/launcher3/config/FlagTogglerPrefUi.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagTogglerPrefUi.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.config;
+package com.android.launcher3.uioverrides.flags;
import static com.android.launcher3.config.FeatureFlags.FLAGS_PREF_NAME;
@@ -33,7 +33,7 @@
import androidx.preference.SwitchPreference;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags.DebugFlag;
+import com.android.launcher3.config.FeatureFlags;
/**
* Dev-build only UI allowing developers to toggle flag settings. See {@link FeatureFlags}.
@@ -50,7 +50,7 @@
@Override
public void putBoolean(String key, boolean value) {
- for (DebugFlag flag : FeatureFlags.getDebugFlags()) {
+ for (DebugFlag flag : FlagsFactory.getDebugFlags()) {
if (flag.key.equals(key)) {
SharedPreferences prefs = mContext.getSharedPreferences(
FLAGS_PREF_NAME, Context.MODE_PRIVATE);
@@ -71,7 +71,7 @@
@Override
public boolean getBoolean(String key, boolean defaultValue) {
- for (DebugFlag flag : FeatureFlags.getDebugFlags()) {
+ for (DebugFlag flag : FlagsFactory.getDebugFlags()) {
if (flag.key.equals(key)) {
return mContext.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE)
.getBoolean(key, flag.defaultValue);
@@ -93,7 +93,7 @@
// flag with a different value than the default. That way, when we flip flags in
// future, engineers will pick up the new value immediately. To accomplish this, we use a
// custom preference data store.
- for (DebugFlag flag : FeatureFlags.getDebugFlags()) {
+ for (DebugFlag flag : FlagsFactory.getDebugFlags()) {
SwitchPreference switchPreference = new SwitchPreference(mContext);
switchPreference.setKey(flag.key);
switchPreference.setDefaultValue(flag.defaultValue);
@@ -149,11 +149,11 @@
}
private boolean anyChanged() {
- for (DebugFlag flag : FeatureFlags.getDebugFlags()) {
+ for (DebugFlag flag : FlagsFactory.getDebugFlags()) {
if (getFlagStateFromSharedPrefs(flag) != flag.get()) {
return true;
}
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java
new file mode 100644
index 0000000..29ef2b4
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.uioverrides.flags;
+
+import static android.app.ActivityThread.currentApplication;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.provider.DeviceConfig;
+
+import com.android.launcher3.Utilities;
+import com.android.launcher3.config.FeatureFlags.BooleanFlag;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Helper class to create various flags for system build
+ */
+public class FlagsFactory {
+
+ public static final String FLAGS_PREF_NAME = "featureFlags";
+ public static final String NAMESPACE_LAUNCHER = "launcher";
+
+ private static final List<DebugFlag> sDebugFlags = new ArrayList<>();
+
+ /**
+ * Creates a new debug flag
+ */
+ public static BooleanFlag getDebugFlag(
+ int bugId, String key, boolean defaultValue, String description) {
+ if (Utilities.IS_DEBUG_DEVICE) {
+ SharedPreferences prefs = currentApplication()
+ .getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE);
+ boolean currentValue = prefs.getBoolean(key, defaultValue);
+ DebugFlag flag = new DebugFlag(key, description, defaultValue, currentValue);
+ flag.mHasBeenChangedAtLeastOnce = prefs.contains(key);
+ sDebugFlags.add(flag);
+ return flag;
+ } else {
+ return new BooleanFlag(defaultValue);
+ }
+ }
+
+ /**
+ * Creates a new release flag
+ */
+ public static BooleanFlag getReleaseFlag(
+ int bugId, String key, boolean defaultValueInCode, String description) {
+ boolean defaultValue = DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, defaultValueInCode);
+ if (Utilities.IS_DEBUG_DEVICE) {
+ SharedPreferences prefs = currentApplication()
+ .getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE);
+ boolean currentValue = prefs.getBoolean(key, defaultValue);
+ DebugFlag flag = new DeviceFlag(key, description, defaultValue, currentValue,
+ defaultValueInCode);
+ flag.mHasBeenChangedAtLeastOnce = prefs.contains(key);
+ sDebugFlags.add(flag);
+ return flag;
+ } else {
+ return new BooleanFlag(defaultValue);
+ }
+ }
+
+ static List<DebugFlag> getDebugFlags() {
+ if (!Utilities.IS_DEBUG_DEVICE) {
+ return Collections.emptyList();
+ }
+ List<DebugFlag> flags;
+ synchronized (sDebugFlags) {
+ flags = new ArrayList<>(sDebugFlags);
+ }
+ flags.sort((f1, f2) -> {
+ // Sort first by any prefs that the user has changed, then alphabetically.
+ int changeComparison = Boolean.compare(
+ f2.mHasBeenChangedAtLeastOnce, f1.mHasBeenChangedAtLeastOnce);
+ return changeComparison != 0
+ ? changeComparison
+ : f1.key.compareToIgnoreCase(f2.key);
+ });
+ return flags;
+ }
+
+ /**
+ * Dumps the current flags state to the print writer
+ */
+ public static void dump(PrintWriter pw) {
+ if (!Utilities.IS_DEBUG_DEVICE) {
+ return;
+ }
+ pw.println("DeviceFlags:");
+ synchronized (sDebugFlags) {
+ for (DebugFlag flag : sDebugFlags) {
+ if (flag instanceof DeviceFlag) {
+ pw.println(" " + flag);
+ }
+ }
+ }
+ pw.println("DebugFlags:");
+ synchronized (sDebugFlags) {
+ for (DebugFlag flag : sDebugFlags) {
+ if (!(flag instanceof DeviceFlag)) {
+ pw.println(" " + flag);
+ }
+ }
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 61caef2..ff81e08 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -86,6 +86,7 @@
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.LauncherTraceProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
+import com.android.launcher3.uioverrides.flags.FlagsFactory;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.OnboardingPrefs;
@@ -1175,7 +1176,7 @@
}
} else {
// Dump everything
- FeatureFlags.dump(pw);
+ FlagsFactory.dump(pw);
if (mDeviceState.isUserUnlocked()) {
PluginManagerWrapper.INSTANCE.get(getBaseContext()).dump(pw);
}
diff --git a/res/xml/launcher_preferences.xml b/res/xml/launcher_preferences.xml
index 8a0c909..284ab9e 100644
--- a/res/xml/launcher_preferences.xml
+++ b/res/xml/launcher_preferences.xml
@@ -50,10 +50,4 @@
launcher:logIdOn="615"
launcher:logIdOff="616" />
- <androidx.preference.PreferenceScreen
- android:key="pref_developer_options"
- android:persistent="false"
- android:title="@string/developer_options_title"
- android:fragment="com.android.launcher3.settings.DeveloperOptionsFragment"/>
-
</androidx.preference.PreferenceScreen>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 90b2374..8a90d0e 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -1597,6 +1597,8 @@
writer.println(prefix + pxToDpStr("iconTextSizePx", iconTextSizePx));
writer.println(prefix + pxToDpStr("iconDrawablePaddingPx", iconDrawablePaddingPx));
+ writer.println(prefix + "\tinv.numFolderRows: " + inv.numFolderRows);
+ writer.println(prefix + "\tinv.numFolderColumns: " + inv.numFolderColumns);
writer.println(prefix + pxToDpStr("folderCellWidthPx", folderCellWidthPx));
writer.println(prefix + pxToDpStr("folderCellHeightPx", folderCellHeightPx));
writer.println(prefix + pxToDpStr("folderChildIconSizePx", folderChildIconSizePx));
diff --git a/src/com/android/launcher3/MainProcessInitializer.java b/src/com/android/launcher3/MainProcessInitializer.java
index f2a3de7..3d7e11e 100644
--- a/src/com/android/launcher3/MainProcessInitializer.java
+++ b/src/com/android/launcher3/MainProcessInitializer.java
@@ -18,7 +18,6 @@
import android.content.Context;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.BitmapCreationCheck;
import com.android.launcher3.graphics.IconShape;
import com.android.launcher3.logging.FileLog;
@@ -37,7 +36,6 @@
protected void init(Context context) {
FileLog.setDir(context.getApplicationContext().getFilesDir());
- FeatureFlags.initialize(context);
IconShape.init(context);
if (BitmapCreationCheck.ENABLED) {
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index ce12399..db2b759 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -16,16 +16,13 @@
package com.android.launcher3.config;
+import static com.android.launcher3.uioverrides.flags.FlagsFactory.getDebugFlag;
+import static com.android.launcher3.uioverrides.flags.FlagsFactory.getReleaseFlag;
+
import android.content.Context;
-import android.content.SharedPreferences;
import com.android.launcher3.BuildConfig;
import com.android.launcher3.Utilities;
-import com.android.launcher3.uioverrides.DeviceFlag;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
/**
* Defines a set of flags used to control various launcher behaviors.
@@ -34,12 +31,9 @@
*/
public final class FeatureFlags {
- private static final List<DebugFlag> sDebugFlags = new ArrayList<>();
-
public static final String FLAGS_PREF_NAME = "featureFlags";
- private FeatureFlags() {
- }
+ private FeatureFlags() { }
public static boolean showFlagTogglerUi(Context context) {
return BuildConfig.IS_DEBUG_DEVICE && Utilities.isDevelopersOptionsEnabled(context);
@@ -69,110 +63,88 @@
* Declare a new ToggleableFlag below. Give it a unique key (e.g. "QSB_ON_FIRST_SCREEN"),
* and set a default value for the flag. This will be the default value on Debug builds.
*/
- // b/270390028
- public static final BooleanFlag ENABLE_INPUT_CONSUMER_REASON_LOGGING = getDebugFlag(
+ public static final BooleanFlag ENABLE_INPUT_CONSUMER_REASON_LOGGING = getDebugFlag(270390028,
"ENABLE_INPUT_CONSUMER_REASON_LOGGING",
true,
"Log the reason why an Input Consumer was selected for a gesture.");
- // b/270389990
- public static final BooleanFlag ENABLE_GESTURE_ERROR_DETECTION = getDebugFlag(
+ public static final BooleanFlag ENABLE_GESTURE_ERROR_DETECTION = getDebugFlag(270389990,
"ENABLE_GESTURE_ERROR_DETECTION",
true,
"Analyze gesture events and log detected errors");
// When enabled the promise icon is visible in all apps while installation an app.
- // b/270390012
- public static final BooleanFlag PROMISE_APPS_IN_ALL_APPS = getDebugFlag(
+ public static final BooleanFlag PROMISE_APPS_IN_ALL_APPS = getDebugFlag(270390012,
"PROMISE_APPS_IN_ALL_APPS", false, "Add promise icon in all-apps");
- // b/270390904
- public static final BooleanFlag KEYGUARD_ANIMATION = getDebugFlag(
+ public static final BooleanFlag KEYGUARD_ANIMATION = getDebugFlag(270390904,
"KEYGUARD_ANIMATION", false, "Enable animation for keyguard going away on wallpaper");
- // b/270390907
- public static final BooleanFlag ENABLE_DEVICE_SEARCH = new DeviceFlag(
+ public static final BooleanFlag ENABLE_DEVICE_SEARCH = getReleaseFlag(270390907,
"ENABLE_DEVICE_SEARCH", true, "Allows on device search in all apps");
- // b/270390286
public static final BooleanFlag ENABLE_FLOATING_SEARCH_BAR =
- getDebugFlag("ENABLE_FLOATING_SEARCH_BAR", false,
+ getDebugFlag(270390286, "ENABLE_FLOATING_SEARCH_BAR", false,
"Keep All Apps search bar at the bottom (but above keyboard if open)");
- // b/270390930
- public static final BooleanFlag ENABLE_HIDE_HEADER = new DeviceFlag("ENABLE_HIDE_HEADER",
- true, "Hide header on keyboard before typing in all apps");
+ public static final BooleanFlag ENABLE_HIDE_HEADER = getReleaseFlag(270390930,
+ "ENABLE_HIDE_HEADER", true, "Hide header on keyboard before typing in all apps");
- // b/270390779
- public static final BooleanFlag ENABLE_EXPANDING_PAUSE_WORK_BUTTON = new DeviceFlag(
+ public static final BooleanFlag ENABLE_EXPANDING_PAUSE_WORK_BUTTON = getReleaseFlag(270390779,
"ENABLE_EXPANDING_PAUSE_WORK_BUTTON", false,
"Expand and collapse pause work button while scrolling");
- // b/270390950
- public static final BooleanFlag ENABLE_RECENT_BLOCK = getDebugFlag("ENABLE_RECENT_BLOCK",
- false, "Show recently tapped search target block in zero state");
+ public static final BooleanFlag ENABLE_RECENT_BLOCK = getDebugFlag(270390950,
+ "ENABLE_RECENT_BLOCK", false, "Show recently tapped search target block in zero state");
- // b/270391455
- public static final BooleanFlag COLLECT_SEARCH_HISTORY = new DeviceFlag(
+ public static final BooleanFlag COLLECT_SEARCH_HISTORY = getReleaseFlag(270391455,
"COLLECT_SEARCH_HISTORY", false, "Allow launcher to collect search history for log");
- // b/270390937
- public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(
+ public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(270390937,
"ENABLE_TWOLINE_ALLAPPS", false, "Enables two line label inside all apps.");
- // b/270391397
- public static final BooleanFlag ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING = new DeviceFlag(
- "ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING", false,
+ public static final BooleanFlag ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING = getReleaseFlag(
+ 270391397, "ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING", false,
"Allows on device search in all apps logging");
- // b/270391693
- public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(
+ public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(270391693,
"IME_STICKY_SNACKBAR_EDU", true, "Show sticky IME edu in AllApps");
- // b/270391653
- public static final BooleanFlag ENABLE_PEOPLE_TILE_PREVIEW = getDebugFlag(
+ public static final BooleanFlag ENABLE_PEOPLE_TILE_PREVIEW = getDebugFlag(270391653,
"ENABLE_PEOPLE_TILE_PREVIEW", false,
"Experimental: Shows conversation shortcuts on home screen as search results");
- // b/270391638
- public static final BooleanFlag FOLDER_NAME_MAJORITY_RANKING = getDebugFlag(
+ public static final BooleanFlag FOLDER_NAME_MAJORITY_RANKING = getDebugFlag(270391638,
"FOLDER_NAME_MAJORITY_RANKING", true,
"Suggests folder names based on majority based ranking.");
- // b/270391706
- public static final BooleanFlag INJECT_FALLBACK_APP_CORPUS_RESULTS = new DeviceFlag(
- "INJECT_FALLBACK_APP_CORPUS_RESULTS", false, "Inject "
- + "fallback app corpus result when AiAi fails to return it.");
+ public static final BooleanFlag INJECT_FALLBACK_APP_CORPUS_RESULTS = getReleaseFlag(270391706,
+ "INJECT_FALLBACK_APP_CORPUS_RESULTS", false,
+ "Inject fallback app corpus result when AiAi fails to return it.");
- // b/270391641
- public static final BooleanFlag ASSISTANT_GIVES_LAUNCHER_FOCUS = getDebugFlag(
+ public static final BooleanFlag ASSISTANT_GIVES_LAUNCHER_FOCUS = getDebugFlag(270391641,
"ASSISTANT_GIVES_LAUNCHER_FOCUS", false,
"Allow Launcher to handle nav bar gestures while Assistant is running over it");
- // b/270392203
- public static final BooleanFlag ENABLE_BULK_WORKSPACE_ICON_LOADING = getDebugFlag(
+ public static final BooleanFlag ENABLE_BULK_WORKSPACE_ICON_LOADING = getDebugFlag(270392203,
"ENABLE_BULK_WORKSPACE_ICON_LOADING",
true,
"Enable loading workspace icons in bulk.");
- // b/270392465
- public static final BooleanFlag ENABLE_BULK_ALL_APPS_ICON_LOADING = getDebugFlag(
+ public static final BooleanFlag ENABLE_BULK_ALL_APPS_ICON_LOADING = getDebugFlag(270392465,
"ENABLE_BULK_ALL_APPS_ICON_LOADING",
true,
"Enable loading all apps icons in bulk.");
- // b/270392706
- public static final BooleanFlag ENABLE_DATABASE_RESTORE = getDebugFlag(
+ public static final BooleanFlag ENABLE_DATABASE_RESTORE = getDebugFlag(270392706,
"ENABLE_DATABASE_RESTORE", false,
"Enable database restore when new restore session is created");
- // b/270391664
- public static final BooleanFlag ENABLE_SMARTSPACE_DISMISS = getDebugFlag(
+ public static final BooleanFlag ENABLE_SMARTSPACE_DISMISS = getDebugFlag(270391664,
"ENABLE_SMARTSPACE_DISMISS", true,
"Adds a menu option to dismiss the current Enhanced Smartspace card.");
- // b/270392629
- public static final BooleanFlag ENABLE_OVERLAY_CONNECTION_OPTIM = getDebugFlag(
+ public static final BooleanFlag ENABLE_OVERLAY_CONNECTION_OPTIM = getDebugFlag(270392629,
"ENABLE_OVERLAY_CONNECTION_OPTIM",
false,
"Enable optimizing overlay service connection");
@@ -180,402 +152,252 @@
/**
* Enables region sampling for text color: Needs system health assessment before turning on
*/
- // b/270391669
- public static final BooleanFlag ENABLE_REGION_SAMPLING = getDebugFlag(
+ public static final BooleanFlag ENABLE_REGION_SAMPLING = getDebugFlag(270391669,
"ENABLE_REGION_SAMPLING", false,
"Enable region sampling to determine color of text on screen.");
- // b/270393096
public static final BooleanFlag ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS =
- getDebugFlag(
+ getDebugFlag(270393096,
"ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS", false,
"Always use hardware optimization for folder animations.");
- // b/270392980
- public static final BooleanFlag SEPARATE_RECENTS_ACTIVITY = getDebugFlag(
+ public static final BooleanFlag SEPARATE_RECENTS_ACTIVITY = getDebugFlag(270392980,
"SEPARATE_RECENTS_ACTIVITY", false,
"Uses a separate recents activity instead of using the integrated recents+Launcher UI");
- // b/270392984
- public static final BooleanFlag ENABLE_MINIMAL_DEVICE = getDebugFlag(
+ public static final BooleanFlag ENABLE_MINIMAL_DEVICE = getDebugFlag(270392984,
"ENABLE_MINIMAL_DEVICE", false,
"Allow user to toggle minimal device mode in launcher.");
- // b/270392477
public static final BooleanFlag ENABLE_TASKBAR_POPUP_MENU = getDebugFlag(
- "ENABLE_TASKBAR_POPUP_MENU", true, "Enables long pressing taskbar icons to show the"
- + " popup menu.");
+ 270392477, "ENABLE_TASKBAR_POPUP_MENU", true,
+ "Enables long pressing taskbar icons to show the popup menu.");
- // b/270392643
- public static final BooleanFlag ENABLE_TWO_PANEL_HOME = getDebugFlag(
+ public static final BooleanFlag ENABLE_TWO_PANEL_HOME = getDebugFlag(270392643,
"ENABLE_TWO_PANEL_HOME", true,
"Uses two panel on home screen. Only applicable on large screen devices.");
- // b/270393276
- public static final BooleanFlag ENABLE_SCRIM_FOR_APP_LAUNCH = getDebugFlag(
+ public static final BooleanFlag ENABLE_SCRIM_FOR_APP_LAUNCH = getDebugFlag(270393276,
"ENABLE_SCRIM_FOR_APP_LAUNCH", false,
"Enables scrim during app launch animation.");
- // b/270393258
- public static final BooleanFlag ENABLE_ENFORCED_ROUNDED_CORNERS = new DeviceFlag(
+ public static final BooleanFlag ENABLE_ENFORCED_ROUNDED_CORNERS = getReleaseFlag(270393258,
"ENABLE_ENFORCED_ROUNDED_CORNERS", true, "Enforce rounded corners on all App Widgets");
- // b/270393108
- public static final BooleanFlag NOTIFY_CRASHES = getDebugFlag("NOTIFY_CRASHES", false,
+ public static final BooleanFlag NOTIFY_CRASHES = getDebugFlag(
+ 270393108, "NOTIFY_CRASHES", false,
"Sends a notification whenever launcher encounters an uncaught exception.");
- // b/270393604
- public static final BooleanFlag ENABLE_WALLPAPER_SCRIM = getDebugFlag(
+ public static final BooleanFlag ENABLE_WALLPAPER_SCRIM = getDebugFlag(270393604,
"ENABLE_WALLPAPER_SCRIM", false,
"Enables scrim over wallpaper for text protection.");
- // b/270393268
- public static final BooleanFlag WIDGETS_IN_LAUNCHER_PREVIEW = getDebugFlag(
+ public static final BooleanFlag WIDGETS_IN_LAUNCHER_PREVIEW = getDebugFlag(270393268,
"WIDGETS_IN_LAUNCHER_PREVIEW", true,
"Enables widgets in Launcher preview for the Wallpaper app.");
- // b/270393112
- public static final BooleanFlag QUICK_WALLPAPER_PICKER = getDebugFlag(
+ public static final BooleanFlag QUICK_WALLPAPER_PICKER = getDebugFlag(270393112,
"QUICK_WALLPAPER_PICKER", true,
"Shows quick wallpaper picker in long-press menu");
- // b/270393426
- public static final BooleanFlag ENABLE_BACK_SWIPE_HOME_ANIMATION = getDebugFlag(
+ public static final BooleanFlag ENABLE_BACK_SWIPE_HOME_ANIMATION = getDebugFlag(270393426,
"ENABLE_BACK_SWIPE_HOME_ANIMATION", true,
"Enables home animation to icon when user swipes back.");
- // b/270393294
- public static final BooleanFlag ENABLE_ICON_LABEL_AUTO_SCALING = getDebugFlag(
+ public static final BooleanFlag ENABLE_ICON_LABEL_AUTO_SCALING = getDebugFlag(270393294,
"ENABLE_ICON_LABEL_AUTO_SCALING", true,
"Enables scaling/spacing for icon labels to make more characters visible");
- // b/270393897
- public static final BooleanFlag ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT = getDebugFlag(
+ public static final BooleanFlag ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT = getDebugFlag(270393897,
"ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT", false,
"Enables displaying the all apps button in the hotseat.");
- // b/270393900
- public static final BooleanFlag ENABLE_ALL_APPS_ONE_SEARCH_IN_TASKBAR = getDebugFlag(
+ public static final BooleanFlag ENABLE_ALL_APPS_ONE_SEARCH_IN_TASKBAR = getDebugFlag(270393900,
"ENABLE_ALL_APPS_ONE_SEARCH_IN_TASKBAR", false,
"Enables One Search box in Taskbar All Apps.");
- // b/270393449
- public static final BooleanFlag ENABLE_TASKBAR_IN_OVERVIEW = getDebugFlag(
+ public static final BooleanFlag ENABLE_TASKBAR_IN_OVERVIEW = getDebugFlag(270393449,
"ENABLE_TASKBAR_IN_OVERVIEW", true,
"Enables accessing the system Taskbar in overview.");
- // b/270393906
- public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE = getDebugFlag(
+ public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE = getDebugFlag(270393906,
"ENABLE_SPLIT_FROM_WORKSPACE", true,
"Enable initiating split screen from workspace.");
- // b/270394122
public static final BooleanFlag ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS =
- getDebugFlag("ENABLE_SPLIT_FROM_FULLSCREEN_SHORTCUT", false,
+ getDebugFlag(270394122, "ENABLE_SPLIT_FROM_FULLSCREEN_SHORTCUT", false,
"Enable splitting from fullscreen app with keyboard shortcuts");
- // b/270393453
public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE = getDebugFlag(
- "ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE", false,
+ 270393453, "ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE", false,
"Enable initiating split screen from workspace to workspace.");
- // b/270393455
- public static final BooleanFlag ENABLE_NEW_MIGRATION_LOGIC = getDebugFlag(
+ public static final BooleanFlag ENABLE_NEW_MIGRATION_LOGIC = getDebugFlag(270393455,
"ENABLE_NEW_MIGRATION_LOGIC", true,
"Enable the new grid migration logic, keeping pages when src < dest");
- // b/270394384
- public static final BooleanFlag ENABLE_WIDGET_HOST_IN_BACKGROUND = getDebugFlag(
+ public static final BooleanFlag ENABLE_WIDGET_HOST_IN_BACKGROUND = getDebugFlag(270394384,
"ENABLE_WIDGET_HOST_IN_BACKGROUND", false,
"Enable background widget updates listening for widget holder");
- // b/270394223
- public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = new DeviceFlag(
+ public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = getReleaseFlag(270394223,
"ENABLE_ONE_SEARCH_MOTION", true, "Enables animations in OneSearch.");
- // b/270394041
- public static final BooleanFlag ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES = new DeviceFlag(
- "ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES", false,
+ public static final BooleanFlag ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES = getReleaseFlag(
+ 270394041, "ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES", false,
"Enable option to replace decorator-based search result backgrounds with drawables");
- // b/270394392
- public static final BooleanFlag ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION = new DeviceFlag(
- "ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION", false,
+ public static final BooleanFlag ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION = getReleaseFlag(
+ 270394392, "ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION", false,
"Enable option to launch search results using the new view container transitions");
- // b/270394225
- public static final BooleanFlag TWO_PREDICTED_ROWS_ALL_APPS_SEARCH = new DeviceFlag(
+ public static final BooleanFlag TWO_PREDICTED_ROWS_ALL_APPS_SEARCH = getReleaseFlag(270394225,
"TWO_PREDICTED_ROWS_ALL_APPS_SEARCH", false,
"Use 2 rows of app predictions in All Apps search zero-state");
- // b/270394468
- public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = new DeviceFlag(
- "ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", true,
+ public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = getReleaseFlag(
+ 270394468, "ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", true,
"Enable option to show keyboard when going to all-apps");
- // b/270394973
- public static final BooleanFlag USE_LOCAL_ICON_OVERRIDES = getDebugFlag(
+ public static final BooleanFlag USE_LOCAL_ICON_OVERRIDES = getDebugFlag(270394973,
"USE_LOCAL_ICON_OVERRIDES", true,
"Use inbuilt monochrome icons if app doesn't provide one");
- // b/270394476
- public static final BooleanFlag ENABLE_DISMISS_PREDICTION_UNDO = getDebugFlag(
+ public static final BooleanFlag ENABLE_DISMISS_PREDICTION_UNDO = getDebugFlag(270394476,
"ENABLE_DISMISS_PREDICTION_UNDO", false,
"Show an 'Undo' snackbar when users dismiss a predicted hotseat item");
- // b/270395008
- public static final BooleanFlag ENABLE_CACHED_WIDGET = getDebugFlag(
+ public static final BooleanFlag ENABLE_CACHED_WIDGET = getDebugFlag(270395008,
"ENABLE_CACHED_WIDGET", true,
"Show previously cached widgets as opposed to deferred widget where available");
- // b/270395010
- public static final BooleanFlag USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES = getDebugFlag(
+ public static final BooleanFlag USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES = getDebugFlag(270395010,
"USE_SEARCH_REQUEST_TIMEOUT_OVERRIDES", false,
"Use local overrides for search request timeout");
- // b/270395171
- public static final BooleanFlag CONTINUOUS_VIEW_TREE_CAPTURE = getDebugFlag(
+ public static final BooleanFlag CONTINUOUS_VIEW_TREE_CAPTURE = getDebugFlag(270395171,
"CONTINUOUS_VIEW_TREE_CAPTURE", false, "Capture View tree every frame");
- // b/270395070
- public static final BooleanFlag FOLDABLE_WORKSPACE_REORDER = getDebugFlag(
+ public static final BooleanFlag FOLDABLE_WORKSPACE_REORDER = getDebugFlag(270395070,
"FOLDABLE_WORKSPACE_REORDER", true,
"In foldables, when reordering the icons and widgets, is now going to use both sides");
- // b/270395073
- public static final BooleanFlag ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH = getDebugFlag(
+ public static final BooleanFlag ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH = getDebugFlag(270395073,
"ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH", false,
"Allow bottom sheet depth to be smaller than 1 for multi-display devices.");
- // b/270395177
- public static final BooleanFlag SCROLL_TOP_TO_RESET = new DeviceFlag(
- "SCROLL_TOP_TO_RESET", true, "Bring up IME and focus on "
- + "input when scroll to top if 'Always show keyboard' is enabled or in prefix state");
+ public static final BooleanFlag SCROLL_TOP_TO_RESET = getReleaseFlag(
+ 270395177, "SCROLL_TOP_TO_RESET", true,
+ "Bring up IME and focus on input when scroll to top if 'Always show keyboard'"
+ + " is enabled or in prefix state");
- // b/270395516
- public static final BooleanFlag ENABLE_MATERIAL_U_POPUP = getDebugFlag(
+ public static final BooleanFlag ENABLE_MATERIAL_U_POPUP = getDebugFlag(270395516,
"ENABLE_MATERIAL_U_POPUP", false, "Switch popup UX to use material U");
- // b/270395269
- public static final BooleanFlag ENABLE_SEARCH_UNINSTALLED_APPS = new DeviceFlag(
+ public static final BooleanFlag ENABLE_SEARCH_UNINSTALLED_APPS = getReleaseFlag(270395269,
"ENABLE_SEARCH_UNINSTALLED_APPS", false, "Search uninstalled app results.");
- // b/270395183
- public static final BooleanFlag SHOW_HOME_GARDENING = getDebugFlag(
+ public static final BooleanFlag SHOW_HOME_GARDENING = getDebugFlag(270395183,
"SHOW_HOME_GARDENING", false,
"Show the new home gardening mode");
- // b/270395133
- public static final BooleanFlag HOME_GARDENING_WORKSPACE_BUTTONS = getDebugFlag(
+ public static final BooleanFlag HOME_GARDENING_WORKSPACE_BUTTONS = getDebugFlag(270395133,
"HOME_GARDENING_WORKSPACE_BUTTONS", false,
"Change workspace edit buttons to reflect home gardening");
- // b/270395134
- public static final BooleanFlag ENABLE_DOWNLOAD_APP_UX_V2 = new DeviceFlag(
+ public static final BooleanFlag ENABLE_DOWNLOAD_APP_UX_V2 = getReleaseFlag(270395134,
"ENABLE_DOWNLOAD_APP_UX_V2", true, "Updates the download app UX"
+ " to have better visuals");
- // b/270395186
- public static final BooleanFlag ENABLE_DOWNLOAD_APP_UX_V3 = getDebugFlag(
+ public static final BooleanFlag ENABLE_DOWNLOAD_APP_UX_V3 = getDebugFlag(270395186,
"ENABLE_DOWNLOAD_APP_UX_V3", false, "Updates the download app UX"
- + " to have better visuals, improve contrast, and color");
+ + " to have better visuals, improve contrast, and color");
- // b/270395077
- public static final BooleanFlag FORCE_PERSISTENT_TASKBAR = getDebugFlag(
+ public static final BooleanFlag FORCE_PERSISTENT_TASKBAR = getDebugFlag(270395077,
"FORCE_PERSISTENT_TASKBAR", false, "Forces taskbar to be persistent, even in gesture"
+ " nav mode and when transient taskbar is enabled.");
- // b/270395274
- public static final BooleanFlag FOLDABLE_SINGLE_PAGE = getDebugFlag(
+ public static final BooleanFlag FOLDABLE_SINGLE_PAGE = getDebugFlag(270395274,
"FOLDABLE_SINGLE_PAGE", false,
"Use a single page for the workspace");
- // b/270395798
- public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(
+ public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(270395798,
"ENABLE_TRANSIENT_TASKBAR", true, "Enables transient taskbar.");
- // b/270395140
- public static final BooleanFlag SECONDARY_DRAG_N_DROP_TO_PIN = getDebugFlag(
+ public static final BooleanFlag SECONDARY_DRAG_N_DROP_TO_PIN = getDebugFlag(270395140,
"SECONDARY_DRAG_N_DROP_TO_PIN", false,
"Enable dragging and dropping to pin apps within secondary display");
- // b/270395143
- public static final BooleanFlag ENABLE_ICON_IN_TEXT_HEADER = getDebugFlag(
+ public static final BooleanFlag ENABLE_ICON_IN_TEXT_HEADER = getDebugFlag(270395143,
"ENABLE_ICON_IN_TEXT_HEADER", false, "Show icon in textheader");
- // b/270395087
- public static final BooleanFlag ENABLE_APP_ICON_FOR_INLINE_SHORTCUTS = getDebugFlag(
+ public static final BooleanFlag ENABLE_APP_ICON_FOR_INLINE_SHORTCUTS = getDebugFlag(270395087,
"ENABLE_APP_ICON_IN_INLINE_SHORTCUTS", false, "Show app icon for inline shortcut");
- // b/270395278
- public static final BooleanFlag SHOW_DOT_PAGINATION = getDebugFlag(
+ public static final BooleanFlag SHOW_DOT_PAGINATION = getDebugFlag(270395278,
"SHOW_DOT_PAGINATION", false, "Enable showing dot pagination in workspace");
- // b/270395809
- public static final BooleanFlag LARGE_SCREEN_WIDGET_PICKER = getDebugFlag(
+ public static final BooleanFlag LARGE_SCREEN_WIDGET_PICKER = getDebugFlag(270395809,
"LARGE_SCREEN_WIDGET_PICKER", false, "Enable new widget picker that takes "
+ "advantage of large screen format");
- // b/270396257
- public static final BooleanFlag ENABLE_NEW_GESTURE_NAV_TUTORIAL = getDebugFlag(
+ public static final BooleanFlag ENABLE_NEW_GESTURE_NAV_TUTORIAL = getDebugFlag(270396257,
"ENABLE_NEW_GESTURE_NAV_TUTORIAL", false,
"Enable the redesigned gesture navigation tutorial");
- // b/270395567
- public static final BooleanFlag ENABLE_LAUNCH_FROM_STAGED_APP = getDebugFlag(
+ public static final BooleanFlag ENABLE_LAUNCH_FROM_STAGED_APP = getDebugFlag(270395567,
"ENABLE_LAUNCH_FROM_STAGED_APP", true,
"Enable the ability to tap a staged app during split select to launch it in full screen"
);
- // b/270396358
- public static final BooleanFlag ENABLE_HAPTICS_ALL_APPS = getDebugFlag(
+ public static final BooleanFlag ENABLE_HAPTICS_ALL_APPS = getDebugFlag(270396358,
"ENABLE_HAPTICS_ALL_APPS", false, "Enables haptics opening/closing All apps");
- // b/270396209
- public static final BooleanFlag ENABLE_FORCED_MONO_ICON = getDebugFlag(
+ public static final BooleanFlag ENABLE_FORCED_MONO_ICON = getDebugFlag(270396209,
"ENABLE_FORCED_MONO_ICON", false,
"Enable the ability to generate monochromatic icons, if it is not provided by the app"
);
- // b/270396364
- public static final BooleanFlag ENABLE_DREAM_TRANSITION = getDebugFlag(
+ public static final BooleanFlag ENABLE_DREAM_TRANSITION = getDebugFlag(270396364,
"ENABLE_DREAM_TRANSITION", true,
"Enable the launcher transition when the device enters a dream");
- // b/270396268
- public static final BooleanFlag ENABLE_TASKBAR_EDU_TOOLTIP = getDebugFlag(
+ public static final BooleanFlag ENABLE_TASKBAR_EDU_TOOLTIP = getDebugFlag(270396268,
"ENABLE_TASKBAR_EDU_TOOLTIP", true,
"Enable the tooltip version of the Taskbar education flow.");
- // b/270396680
- public static final BooleanFlag ENABLE_MULTI_INSTANCE = getDebugFlag(
+ public static final BooleanFlag ENABLE_MULTI_INSTANCE = getDebugFlag(270396680,
"ENABLE_MULTI_INSTANCE", false,
"Enables creation and filtering of multiple task instances in overview");
- // b/270396583
- public static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(
+ public static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(270396583,
"ENABLE_TASKBAR_PINNING", false,
"Enables taskbar pinning to allow user to switch between transient and persistent "
+ "taskbar flavors");
- // b/270397206
- public static final BooleanFlag ENABLE_GRID_ONLY_OVERVIEW = getDebugFlag(
+ public static final BooleanFlag ENABLE_GRID_ONLY_OVERVIEW = getDebugFlag(270397206,
"ENABLE_GRID_ONLY_OVERVIEW", false,
"Enable a grid-only overview without a focused task.");
- // b/270397209
- public static final BooleanFlag RECEIVE_UNFOLD_EVENTS_FROM_SYSUI = getDebugFlag(
+ public static final BooleanFlag RECEIVE_UNFOLD_EVENTS_FROM_SYSUI = getDebugFlag(270397209,
"RECEIVE_UNFOLD_EVENTS_FROM_SYSUI", true,
"Enables receiving unfold animation events from sysui instead of calculating "
+ "them in launcher process using hinge sensor values.");
- // b/270396844
- public static final BooleanFlag ENABLE_KEYBOARD_QUICK_SWITCH = getDebugFlag(
+ public static final BooleanFlag ENABLE_KEYBOARD_QUICK_SWITCH = getDebugFlag(270396844,
"ENABLE_KEYBOARD_QUICK_SWITCH", false,
"Enables keyboard quick switching");
- public static void initialize(Context context) {
- synchronized (sDebugFlags) {
- for (DebugFlag flag : sDebugFlags) {
- flag.initialize(context);
- }
-
- sDebugFlags.sort((f1, f2) -> {
- // Sort first by any prefs that the user has changed, then alphabetically.
- int changeComparison = Boolean.compare(f2.mHasBeenChangedAtLeastOnce,
- f1.mHasBeenChangedAtLeastOnce);
- return changeComparison != 0
- ? changeComparison
- : f1.key.compareToIgnoreCase(f2.key);
- });
- }
- }
-
- static List<DebugFlag> getDebugFlags() {
- synchronized (sDebugFlags) {
- return new ArrayList<>(sDebugFlags);
- }
- }
-
- public static void dump(PrintWriter pw) {
- pw.println("DeviceFlags:");
- synchronized (sDebugFlags) {
- for (DebugFlag flag : sDebugFlags) {
- if (flag instanceof DeviceFlag) {
- pw.println(" " + flag.toString());
- }
- }
- }
- pw.println("DebugFlags:");
- synchronized (sDebugFlags) {
- for (DebugFlag flag : sDebugFlags) {
- if (!(flag instanceof DeviceFlag)) {
- pw.println(" " + flag.toString());
- }
- }
- }
- }
-
public static class BooleanFlag {
- public final String key;
- public final boolean defaultValue;
+ private final boolean mCurrentValue;
- public BooleanFlag(String key, boolean defaultValue) {
- this.key = key;
- this.defaultValue = defaultValue;
+ public BooleanFlag(boolean currentValue) {
+ mCurrentValue = currentValue;
}
public boolean get() {
- return defaultValue;
- }
-
- @Override
- public String toString() {
- return appendProps(new StringBuilder()).toString();
- }
-
- protected StringBuilder appendProps(StringBuilder src) {
- return src.append(key).append(", defaultValue=").append(defaultValue);
- }
- }
-
- public static class DebugFlag extends BooleanFlag {
-
- public final String description;
- protected boolean mHasBeenChangedAtLeastOnce;
- protected boolean mCurrentValue;
-
- public DebugFlag(String key, boolean defaultValue, String description) {
- super(key, defaultValue);
- this.description = description;
- mCurrentValue = this.defaultValue;
- synchronized (sDebugFlags) {
- sDebugFlags.add(this);
- }
- }
-
- @Override
- public boolean get() {
return mCurrentValue;
}
-
- public void initialize(Context context) {
- SharedPreferences prefs =
- context.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE);
- mHasBeenChangedAtLeastOnce = prefs.contains(key);
- mCurrentValue = prefs.getBoolean(key, defaultValue);
- }
-
- @Override
- protected StringBuilder appendProps(StringBuilder src) {
- return super.appendProps(src).append(", mCurrentValue=").append(mCurrentValue);
- }
- }
-
- private static BooleanFlag getDebugFlag(String key, boolean defaultValue, String description) {
- return Utilities.IS_DEBUG_DEVICE
- ? new DebugFlag(key, defaultValue, description)
- : new BooleanFlag(key, defaultValue);
}
}
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 8d6a5cb..d3a237c 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -52,6 +52,7 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.states.RotationHelper;
+import com.android.launcher3.uioverrides.flags.DeveloperOptionsFragment;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.DisplayController;
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/DeviceFlag.java b/src_ui_overrides/com/android/launcher3/uioverrides/flags/DeveloperOptionsFragment.java
similarity index 62%
rename from src_ui_overrides/com/android/launcher3/uioverrides/DeviceFlag.java
rename to src_ui_overrides/com/android/launcher3/uioverrides/flags/DeveloperOptionsFragment.java
index 5c1ac28..68843f2 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/DeviceFlag.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/flags/DeveloperOptionsFragment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,14 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package com.android.launcher3.uioverrides.flags;
-package com.android.launcher3.uioverrides;
-
-import com.android.launcher3.config.FeatureFlags.DebugFlag;
-
-public class DeviceFlag extends DebugFlag {
-
- public DeviceFlag(String key, boolean defaultValue, String description) {
- super(key, defaultValue, description);
- }
+/**
+ * Place holder class for developer options.
+ */
+public class DeveloperOptionsFragment {
}
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/flags/FlagsFactory.java b/src_ui_overrides/com/android/launcher3/uioverrides/flags/FlagsFactory.java
new file mode 100644
index 0000000..599969b
--- /dev/null
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/flags/FlagsFactory.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.uioverrides.flags;
+
+import com.android.launcher3.config.FeatureFlags.BooleanFlag;
+
+import java.io.PrintWriter;
+
+/**
+ * Helper class to create various flags for launcher build. The base implementation does
+ * not provide any flagging system, and simply replies with the default value.
+ */
+public class FlagsFactory {
+
+ /**
+ * Creates a new debug flag
+ */
+ public static BooleanFlag getDebugFlag(
+ int bugId, String key, boolean defaultValue, String description) {
+ return new BooleanFlag(defaultValue);
+ }
+
+ /**
+ * Creates a new debug flag
+ */
+ public static BooleanFlag getReleaseFlag(
+ int bugId, String key, boolean defaultValueInCode, String description) {
+ return new BooleanFlag(defaultValueInCode);
+ }
+
+ /**
+ * Dumps the current flags state to the print writer
+ */
+ public static void dump(PrintWriter pw) { }
+}
diff --git a/tests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt b/tests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt
index ca269a9..f24f0da 100644
--- a/tests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt
+++ b/tests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt
@@ -33,7 +33,6 @@
import com.android.launcher3.provider.LauncherDbUtils
import com.android.launcher3.util.LauncherModelHelper
import com.android.launcher3.util.LauncherModelHelper.*
-import com.android.launcher3.util.TestUtil
import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
@@ -619,8 +618,6 @@
assertThat(locMap[testPackage3]).isEqualTo(1)
assertThat(locMap[testPackage4]).isEqualTo(1)
assertThat(locMap[testPackage5]).isEqualTo(2)
-
- disableNewMigrationLogic()
}
/**
@@ -685,7 +682,6 @@
assertThat(locMap[testPackage3]).isEqualTo(0)
assertThat(locMap[testPackage4]).isEqualTo(0)
assertThat(locMap[testPackage5]).isEqualTo(0)
- disableNewMigrationLogic()
}
/** Migrating from a larger grid to a smaller, we reflow from page 0 */
@@ -746,19 +742,9 @@
assertThat(locMap[testPackage3]).isEqualTo(0)
assertThat(locMap[testPackage4]).isEqualTo(0)
assertThat(locMap[testPackage5]).isEqualTo(0)
-
- disableNewMigrationLogic()
}
private fun enableNewMigrationLogic(srcGridSize: String) {
LauncherPrefs.get(context).putSync(WORKSPACE_SIZE.to(srcGridSize))
- TestUtil.overrideBooleanFlagValue(context,
- FeatureFlags.ENABLE_NEW_MIGRATION_LOGIC, true);
- FeatureFlags.initialize(context)
- }
-
- private fun disableNewMigrationLogic() {
- TestUtil.overrideBooleanFlagValue(context,
- FeatureFlags.ENABLE_NEW_MIGRATION_LOGIC, false);
}
}
diff --git a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
index d981267..af31e93 100644
--- a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
+++ b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
@@ -76,6 +76,8 @@
"\ticonSizePx: 147.0px (56.0dp)\n" +
"\ticonTextSizePx: 38.0px (14.476191dp)\n" +
"\ticonDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tinv.numFolderRows: 4\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 195.0px (74.28571dp)\n" +
"\tfolderCellHeightPx: 230.0px (87.61905dp)\n" +
"\tfolderChildIconSizePx: 147.0px (56.0dp)\n" +
@@ -206,6 +208,8 @@
"\ticonSizePx: 147.0px (56.0dp)\n" +
"\ticonTextSizePx: 38.0px (14.476191dp)\n" +
"\ticonDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tinv.numFolderRows: 4\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 195.0px (74.28571dp)\n" +
"\tfolderCellHeightPx: 230.0px (87.61905dp)\n" +
"\tfolderChildIconSizePx: 147.0px (56.0dp)\n" +
@@ -336,6 +340,8 @@
"\ticonSizePx: 147.0px (56.0dp)\n" +
"\ticonTextSizePx: 0.0px (0.0dp)\n" +
"\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
+ "\tinv.numFolderRows: 4\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 142.0px (54.095238dp)\n" +
"\tfolderCellHeightPx: 168.0px (64.0dp)\n" +
"\tfolderChildIconSizePx: 108.0px (41.142857dp)\n" +
@@ -466,6 +472,8 @@
"\ticonSizePx: 147.0px (56.0dp)\n" +
"\ticonTextSizePx: 0.0px (0.0dp)\n" +
"\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
+ "\tinv.numFolderRows: 4\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 128.0px (48.761906dp)\n" +
"\tfolderCellHeightPx: 152.0px (57.904762dp)\n" +
"\tfolderChildIconSizePx: 98.0px (37.333332dp)\n" +
@@ -597,6 +605,8 @@
"\ticonSizePx: 120.0px (60.0dp)\n" +
"\ticonTextSizePx: 28.0px (14.0dp)\n" +
"\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 3\n" +
"\tfolderCellWidthPx: 397.0px (198.5dp)\n" +
"\tfolderCellHeightPx: 371.0px (185.5dp)\n" +
"\tfolderChildIconSizePx: 99.0px (49.5dp)\n" +
@@ -728,6 +738,8 @@
"\ticonSizePx: 120.0px (60.0dp)\n" +
"\ticonTextSizePx: 28.0px (14.0dp)\n" +
"\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 3\n" +
"\tfolderCellWidthPx: 397.0px (198.5dp)\n" +
"\tfolderCellHeightPx: 371.0px (185.5dp)\n" +
"\tfolderChildIconSizePx: 99.0px (49.5dp)\n" +
@@ -859,6 +871,8 @@
"\ticonSizePx: 120.0px (60.0dp)\n" +
"\ticonTextSizePx: 28.0px (14.0dp)\n" +
"\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 3\n" +
"\tfolderCellWidthPx: 408.0px (204.0dp)\n" +
"\tfolderCellHeightPx: 648.0px (324.0dp)\n" +
"\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
@@ -990,6 +1004,8 @@
"\ticonSizePx: 120.0px (60.0dp)\n" +
"\ticonTextSizePx: 28.0px (14.0dp)\n" +
"\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 3\n" +
"\tfolderCellWidthPx: 408.0px (204.0dp)\n" +
"\tfolderCellHeightPx: 648.0px (324.0dp)\n" +
"\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
@@ -1126,6 +1142,8 @@
"\ticonSizePx: 141.0px (53.714287dp)\n" +
"\ticonTextSizePx: 34.0px (12.952381dp)\n" +
"\ticonDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 189.0px (72.0dp)\n" +
"\tfolderCellHeightPx: 219.0px (83.42857dp)\n" +
"\tfolderChildIconSizePx: 141.0px (53.714287dp)\n" +
@@ -1261,6 +1279,8 @@
"\ticonSizePx: 141.0px (53.714287dp)\n" +
"\ticonTextSizePx: 34.0px (12.952381dp)\n" +
"\ticonDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 189.0px (72.0dp)\n" +
"\tfolderCellHeightPx: 219.0px (83.42857dp)\n" +
"\tfolderChildIconSizePx: 141.0px (53.714287dp)\n" +
@@ -1396,6 +1416,8 @@
"\ticonSizePx: 141.0px (53.714287dp)\n" +
"\ticonTextSizePx: 34.0px (12.952381dp)\n" +
"\ticonDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 189.0px (72.0dp)\n" +
"\tfolderCellHeightPx: 219.0px (83.42857dp)\n" +
"\tfolderChildIconSizePx: 141.0px (53.714287dp)\n" +
@@ -1527,6 +1549,8 @@
"\ticonSizePx: 141.0px (53.714287dp)\n" +
"\ticonTextSizePx: 34.0px (12.952381dp)\n" +
"\ticonDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tinv.numFolderRows: 3\n" +
+ "\tinv.numFolderColumns: 4\n" +
"\tfolderCellWidthPx: 189.0px (72.0dp)\n" +
"\tfolderCellHeightPx: 219.0px (83.42857dp)\n" +
"\tfolderChildIconSizePx: 141.0px (53.714287dp)\n" +
diff --git a/tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java b/tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java
index 33a7f5c..7e9d9da 100644
--- a/tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java
+++ b/tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java
@@ -21,7 +21,6 @@
import static com.google.common.truth.Truth.assertThat;
-import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
import android.os.SystemClock;
@@ -34,11 +33,8 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.tapl.LauncherInstrumentation;
import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.util.LauncherModelHelper;
-import com.android.launcher3.util.TestUtil;
import org.junit.After;
import org.junit.Ignore;
@@ -278,9 +274,6 @@
}
private void setDragNDropFlag(Boolean status) {
- Context context = new LauncherModelHelper().sandboxContext;
- TestUtil.overrideBooleanFlagValue(
- context, FeatureFlags.SECONDARY_DRAG_N_DROP_TO_PIN, status);
startSecondaryDisplayActivity();
}
}
diff --git a/tests/src/com/android/launcher3/settings/SettingsActivityTest.java b/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
index 1c205f0..837973f 100644
--- a/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
+++ b/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
@@ -50,6 +50,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.android.launcher3.R;
+import com.android.launcher3.uioverrides.flags.DeveloperOptionsFragment;
import com.android.systemui.shared.plugins.PluginPrefs;
import org.junit.After;
diff --git a/tests/src/com/android/launcher3/util/TestUtil.java b/tests/src/com/android/launcher3/util/TestUtil.java
index 38de4c3..d7c6c4f 100644
--- a/tests/src/com/android/launcher3/util/TestUtil.java
+++ b/tests/src/com/android/launcher3/util/TestUtil.java
@@ -19,18 +19,14 @@
import static androidx.test.InstrumentationRegistry.getInstrumentation;
import static androidx.test.InstrumentationRegistry.getTargetContext;
-import android.content.Context;
import android.content.pm.LauncherApps;
import android.content.res.Resources;
import android.os.Handler;
import android.os.Looper;
import android.os.UserHandle;
-import androidx.annotation.VisibleForTesting;
import androidx.test.uiautomator.UiDevice;
-import com.android.launcher3.config.FeatureFlags;
-
import org.junit.Assert;
import java.io.FileOutputStream;
@@ -72,18 +68,6 @@
}
}
- @VisibleForTesting
- // Override feature flag, mainly to be used ONLY in tests
- public static void overrideBooleanFlagValue(
- Context context, FeatureFlags.BooleanFlag flagToOverride,
- boolean bool) {
- context.getSharedPreferences(FeatureFlags.FLAGS_PREF_NAME, Context.MODE_PRIVATE)
- .edit()
- .putBoolean(flagToOverride.key, bool)
- .commit();
- FeatureFlags.initialize(context);
- }
-
public static void uninstallDummyApp() throws IOException {
UiDevice.getInstance(getInstrumentation()).executeShellCommand(
"pm uninstall " + DUMMY_PACKAGE);