Remove flags that are no longer necessary

Flag: EXEMPT code cleanup
Test: GridSizeMigrationTest
Bug: b/325286145, b/325285743
Change-Id: I056021c299b56a186b754b94b33509d0b01816e0
This commit is contained in:
fbaron
2024-11-05 11:06:02 -08:00
committed by Sebastian Franco
parent a64d474286
commit 8f26e042b2
4 changed files with 9 additions and 46 deletions

View File

@@ -52,7 +52,6 @@ import androidx.core.content.res.ResourcesCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.DeviceGridState;
import com.android.launcher3.provider.RestoreDbTask;
import com.android.launcher3.testing.shared.ResourceUtils;
@@ -303,35 +302,6 @@ public class InvariantDeviceProfile implements SafeCloseable {
DisplayController.INSTANCE.executeIfCreated(dc -> dc.setPriorityListener(null));
}
/**
* Reinitialize the current grid after a restore, where some grids might now be disabled.
*/
public void reinitializeAfterRestore(Context context) {
String currentGridName = getCurrentGridName(context);
String currentDbFile = dbFile;
String newGridName = initGrid(context, currentGridName);
String newDbFile = dbFile;
FileLog.d(TAG, "Reinitializing grid after restore."
+ " currentGridName=" + currentGridName
+ ", currentDbFile=" + currentDbFile
+ ", newGridName=" + newGridName
+ ", newDbFile=" + newDbFile);
if (!newDbFile.equals(currentDbFile)) {
FileLog.d(TAG, "Restored grid is disabled : " + currentGridName
+ ", migrating to: " + newGridName
+ ", removing all other grid db files");
for (String gridDbFile : LauncherFiles.GRID_DB_FILES) {
if (gridDbFile.equals(currentDbFile)) {
continue;
}
if (context.getDatabasePath(gridDbFile).delete()) {
FileLog.d(TAG, "Removed old grid db file: " + gridDbFile);
}
}
setCurrentGrid(context, newGridName);
}
}
public static String getCurrentGridName(Context context) {
return LauncherPrefs.get(context).get(GRID_NAME);
}