Merge "Moving data sanitization before bind" into sc-dev am: 3ca4b0d88f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13741856

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie6d3581a6697537657cccfd5abe9044f02520a4e
This commit is contained in:
TreeHugger Robot authored and Automerger Merge Worker committed 2021-03-10 12:09:53 +00:00
commit dfcf0f72bc
1 file changed
+14 -11
+14 -11
View File
@@ -192,6 +192,16 @@ public class LoaderTask implements Runnable {
loadWorkspace(allShortcuts);
logger.addSplit("loadWorkspace");
// Sanitize data re-syncs widgets/shortcuts based on the workspace loaded from db.
// sanitizeData should not be invoked if the workspace is loaded from a db different
// from the main db as defined in the invariant device profile.
// (e.g. both grid preview and minimal device mode uses a different db)
if (mApp.getInvariantDeviceProfile().dbFile.equals(mDbName)) {
verifyNotStopped();
sanitizeData();
logger.addSplit("sanitizeData");
}
verifyNotStopped();
mResults.bindWorkspace();
logger.addSplit("bindWorkspace");
@@ -274,14 +284,6 @@ public class LoaderTask implements Runnable {
loadFolderNames();
}
// Sanitize data re-syncs widgets/shortcuts based on the workspace loaded from db.
// sanitizeData should not be invoked if the workspace is loaded from a db different
// from the main db as defined in the invariant device profile.
// (e.g. both grid preview and minimal device mode uses a different db)
if (mApp.getInvariantDeviceProfile().dbFile.equals(mDbName)) {
sanitizeData();
}
verifyNotStopped();
updateHandler.finish();
logger.addSplit("finish icon update");
@@ -875,10 +877,11 @@ public class LoaderTask implements Runnable {
mBgDataModel.itemsIdMap.remove(folderId);
}
}
// Remove any ghost widgets
LauncherSettings.Settings.call(contentResolver,
LauncherSettings.Settings.METHOD_REMOVE_GHOST_WIDGETS);
}
// Remove any ghost widgets
LauncherSettings.Settings.call(contentResolver,
LauncherSettings.Settings.METHOD_REMOVE_GHOST_WIDGETS);
// Update pinned state of model shortcuts
mBgDataModel.updateShortcutPinnedState(context);