mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Using add/replace instead of update when updating an entry.
Update operation was not including version and updateTime columns leading to a update operation getting called wheneven launcher loads. Bug: 32004297 Change-Id: I5f1793633ce3bb72d5641a82502b3ba8b9cdff7d
This commit is contained in:
@@ -772,13 +772,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(
|
||||
|
||||
Reference in New Issue
Block a user