Loading src/com/android/launcher3/LauncherProvider.java +3 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,9 @@ public class LauncherProvider extends ContentProvider { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); Cursor result = qb.query(db, projection, args.where, args.args, null, null, sortOrder); final Bundle extra = new Bundle(); extra.putString(LauncherSettings.Settings.EXTRA_DB_NAME, mOpenHelper.getDatabaseName()); result.setExtras(extra); result.setNotificationUri(getContext().getContentResolver(), uri); return result; Loading src/com/android/launcher3/LauncherSettings.java +2 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,8 @@ public class LauncherSettings { public static final String EXTRA_VALUE = "value"; public static final String EXTRA_DB_NAME = "db_name"; public static Bundle call(ContentResolver cr, String method) { return call(cr, method, null /* arg */); } Loading src/com/android/launcher3/model/LoaderTask.java +13 −2 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.net.Uri; import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; import android.text.TextUtils; Loading Loading @@ -130,6 +131,7 @@ public class LoaderTask implements Runnable { private final Set<PackageUserKey> mPendingPackages = new HashSet<>(); private boolean mItemsDeleted = false; private String mDbName; public LoaderTask(LauncherAppState app, AllAppsList bgAllAppsList, BgDataModel dataModel, ModelDelegate modelDelegate, LoaderResults results) { Loading Loading @@ -274,7 +276,14 @@ public class LoaderTask implements Runnable { if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) { 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(); Loading Loading @@ -349,7 +358,9 @@ public class LoaderTask implements Runnable { final LoaderCursor c = new LoaderCursor( contentResolver.query(contentUri, null, selection, null, null), contentUri, mApp, mUserManagerState); final Bundle extras = c.getExtras(); mDbName = extras == null ? null : extras.getString(LauncherSettings.Settings.EXTRA_DB_NAME); try { final int appWidgetIdIndex = c.getColumnIndexOrThrow( LauncherSettings.Favorites.APPWIDGET_ID); Loading Loading
src/com/android/launcher3/LauncherProvider.java +3 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,9 @@ public class LauncherProvider extends ContentProvider { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); Cursor result = qb.query(db, projection, args.where, args.args, null, null, sortOrder); final Bundle extra = new Bundle(); extra.putString(LauncherSettings.Settings.EXTRA_DB_NAME, mOpenHelper.getDatabaseName()); result.setExtras(extra); result.setNotificationUri(getContext().getContentResolver(), uri); return result; Loading
src/com/android/launcher3/LauncherSettings.java +2 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,8 @@ public class LauncherSettings { public static final String EXTRA_VALUE = "value"; public static final String EXTRA_DB_NAME = "db_name"; public static Bundle call(ContentResolver cr, String method) { return call(cr, method, null /* arg */); } Loading
src/com/android/launcher3/model/LoaderTask.java +13 −2 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.net.Uri; import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; import android.text.TextUtils; Loading Loading @@ -130,6 +131,7 @@ public class LoaderTask implements Runnable { private final Set<PackageUserKey> mPendingPackages = new HashSet<>(); private boolean mItemsDeleted = false; private String mDbName; public LoaderTask(LauncherAppState app, AllAppsList bgAllAppsList, BgDataModel dataModel, ModelDelegate modelDelegate, LoaderResults results) { Loading Loading @@ -274,7 +276,14 @@ public class LoaderTask implements Runnable { if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) { 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(); Loading Loading @@ -349,7 +358,9 @@ public class LoaderTask implements Runnable { final LoaderCursor c = new LoaderCursor( contentResolver.query(contentUri, null, selection, null, null), contentUri, mApp, mUserManagerState); final Bundle extras = c.getExtras(); mDbName = extras == null ? null : extras.getString(LauncherSettings.Settings.EXTRA_DB_NAME); try { final int appWidgetIdIndex = c.getColumnIndexOrThrow( LauncherSettings.Favorites.APPWIDGET_ID); Loading