Simplifying some test utility methods

Bug: 283821111
Test: Presubmit
Flag: N/A
Change-Id: I7b9690bc0cc53d097d26cd4f0ab2dd36ba88e1cb
This commit is contained in:
Sunny Goyal
2023-05-25 19:20:10 -07:00
parent 0edac04688
commit ee9740462e
18 changed files with 171 additions and 193 deletions

View File

@@ -367,18 +367,9 @@ public class LoaderTask implements Runnable {
final boolean isSdCardReady = Utilities.isBootCompleted();
final WidgetManagerHelper widgetHelper = new WidgetManagerHelper(context);
boolean clearDb = false;
if (!mApp.getModel().getModelDbController().migrateGridIfNeeded()) {
// Migration failed. Clear workspace.
clearDb = true;
}
if (clearDb) {
Log.d(TAG, "loadWorkspace: resetting launcher database");
Settings.call(contentResolver, Settings.METHOD_CREATE_EMPTY_DB);
}
mApp.getModel().getModelDbController().tryMigrateDB();
Log.d(TAG, "loadWorkspace: loading default favorites");
mApp.getModel().getModelDbController().loadDefaultFavoritesIfNecessary();
Settings.call(contentResolver, Settings.METHOD_LOAD_DEFAULT_FAVORITES);
synchronized (mBgDataModel) {