Merge "Remove temp logic added to migrate users to new 4x5 grid." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-23 01:56:17 +00:00
committed by Android (Google) Code Review
3 changed files with 0 additions and 53 deletions
@@ -18,7 +18,6 @@ package com.android.launcher3;
import static com.android.launcher3.Utilities.getDevicePrefs;
import static com.android.launcher3.Utilities.getPointString;
import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TWO_PANEL_HOME;
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
import static com.android.launcher3.util.DisplayController.CHANGE_SIZE;
@@ -262,9 +261,6 @@ public class InvariantDeviceProfile {
if (ENABLE_TWO_PANEL_HOME.get()) {
return ENABLE_TWO_PANEL_HOME.key;
}
if (ENABLE_FOUR_COLUMNS.get()) {
return ENABLE_FOUR_COLUMNS.key;
}
return Utilities.isGridOptionsEnabled(context)
? Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null) : null;
}
@@ -17,9 +17,6 @@
package com.android.launcher3;
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_HOTSEAT_COUNT;
import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_WORKSPACE_SIZE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI;
@@ -126,33 +123,6 @@ public class LauncherAppState {
mInvariantDeviceProfile = InvariantDeviceProfile.INSTANCE.get(context);
// b/175329686 Temporary logic to gracefully migrate group of users to the new 4x5 grid.
String gridName = InvariantDeviceProfile.getCurrentGridName(context);
if (ENABLE_FOUR_COLUMNS.get()
|| "reasonable".equals(gridName)
|| ENABLE_FOUR_COLUMNS.key.equals(gridName)) {
// Reset flag and remove it from developer options to prevent it from being enabled
// again.
ENABLE_FOUR_COLUMNS.reset(context);
FeatureFlags.removeFlag(ENABLE_FOUR_COLUMNS);
// Force migration code to run
Utilities.getPrefs(context).edit()
.remove(KEY_MIGRATION_SRC_HOTSEAT_COUNT)
.remove(KEY_MIGRATION_SRC_WORKSPACE_SIZE)
.apply();
// We make an empty call here to ensure the database is created with the old IDP grid,
// so that when we set the new grid the migration can proceeds as expected.
LauncherSettings.Settings.call(context.getContentResolver(), "");
String newGridName = "practical";
Utilities.getPrefs(mContext).edit().putString("idp_grid_name", newGridName).commit();
mInvariantDeviceProfile.setCurrentGrid(context, "practical");
} else {
FeatureFlags.removeFlag(ENABLE_FOUR_COLUMNS);
}
mIconCache = new IconCache(mContext, mInvariantDeviceProfile, iconCacheFileName);
mWidgetCache = new WidgetPreviewLoader(mContext, mIconCache);
mModel = new LauncherModel(context, this, mIconCache, new AppFilter(mContext));
@@ -199,10 +199,6 @@ public final class FeatureFlags {
"EXPANDED_SMARTSPACE", false, "Expands smartspace height to two rows. "
+ "Any apps occupying the first row will be removed from workspace.");
public static final DeviceFlag ENABLE_FOUR_COLUMNS = new DeviceFlag(
"ENABLE_FOUR_COLUMNS", false, "Uses 4 columns in launcher grid."
+ "Warning: This will permanently alter your home screen items and is not reversible.");
// TODO: b/172467144 Remove ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE feature flag.
public static final BooleanFlag ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE = new DeviceFlag(
"ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE", false, "Enables a "
@@ -245,12 +241,6 @@ public final class FeatureFlags {
}
}
public static void removeFlag(DebugFlag flag) {
synchronized (sDebugFlags) {
sDebugFlags.remove(flag);
}
}
static List<DebugFlag> getDebugFlags() {
synchronized (sDebugFlags) {
return new ArrayList<>(sDebugFlags);
@@ -328,15 +318,6 @@ public final class FeatureFlags {
.getBoolean(key, defaultValue);
}
/**
* Resets value to default value.
*/
public void reset(Context context) {
mCurrentValue = defaultValue;
context.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE)
.edit().putBoolean(key, defaultValue).apply();
}
@Override
protected StringBuilder appendProps(StringBuilder src) {
return super.appendProps(src).append(", mCurrentValue=").append(mCurrentValue);