Using add/replace instead of update when updating an entry.

am: caa52918f1

Change-Id: I728322245f07e0bc87e8a0726a22932f57248500
This commit is contained in:
Sunny Goyal authored and android-build-merger committed 2016-10-07 18:13:30 +00:00
commit 97574ede5a
2 files changed
+9 -23

No files matched your search

+9 -7
View File
@@ -773,13 +773,15 @@ public class IconCache {
public void run() {
if (!mAppsToUpdate.isEmpty()) {
LauncherActivityInfoCompat app = mAppsToUpdate.pop();
String cn = app.getComponentName().flattenToString();
ContentValues values = updateCacheAndGetContentValues(app, true);
mIconDb.update(values,
IconDB.COLUMN_COMPONENT + " = ? AND " + IconDB.COLUMN_USER + " = ?",
new String[]{cn, Long.toString(mUserSerial)});
mUpdatedPackages.add(app.getComponentName().getPackageName());
String pkg = app.getComponentName().getPackageName();
PackageInfo info = mPkgInfoMap.get(pkg);
if (info != null) {
synchronized (IconCache.this) {
ContentValues values = updateCacheAndGetContentValues(app, true);
addIconToDB(values, app.getComponentName(), info, mUserSerial);
}
mUpdatedPackages.add(pkg);
}
if (mAppsToUpdate.isEmpty() && !mUpdatedPackages.isEmpty()) {
// No more app to update. Notify model.
LauncherAppState.getInstance().getModel().onPackageIconsUpdated(