summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-06-04 15:19:31 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-06-04 15:21:23 -0700
commit091f0ffd929f7a0a9a6af7d202eae13c48c07daa (patch)
tree8657acbf549f60b6a8942bdbf0cc998b2dccb58e /src
parenta56eab41fbfe26b185cc8240d50d231d0db41837 (diff)
downloadandroid_packages_apps_Trebuchet-091f0ffd929f7a0a9a6af7d202eae13c48c07daa.tar.gz
android_packages_apps_Trebuchet-091f0ffd929f7a0a9a6af7d202eae13c48c07daa.tar.bz2
android_packages_apps_Trebuchet-091f0ffd929f7a0a9a6af7d202eae13c48c07daa.zip
Updating widget list when iconCache updates
> Fixing bug where items were not getting removed from the memcache > Fixing bug where package entries were not getting removing because of component mismatch. Bug: 21612532 Change-Id: Ie56f3272f7fb7e1a37c5ff9bfa523d814edc1a02
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/IconCache.java5
-rw-r--r--src/com/android/launcher3/LauncherModel.java3
-rw-r--r--src/com/android/launcher3/model/WidgetsModel.java1
3 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index fe25bb9a0..3165337c2 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -275,6 +275,7 @@ public class IconCache {
ComponentName component = ComponentName.unflattenFromString(cn);
PackageInfo info = pkgInfoMap.get(component.getPackageName());
if (info == null) {
+ remove(component, user);
itemsToRemove.add(c.getInt(rowIndex));
continue;
}
@@ -291,6 +292,7 @@ public class IconCache {
continue;
}
if (app == null) {
+ remove(component, user);
itemsToRemove.add(c.getInt(rowIndex));
} else {
appsToUpdate.add(app);
@@ -562,9 +564,10 @@ public class IconCache {
*/
private CacheEntry getEntryForPackageLocked(String packageName, UserHandleCompat user,
boolean useLowResIcon) {
- ComponentName cn = new ComponentName(packageName, EMPTY_CLASS_NAME);
+ ComponentName cn = new ComponentName(packageName, packageName + EMPTY_CLASS_NAME);
ComponentKey cacheKey = new ComponentKey(cn, user);
CacheEntry entry = mCache.get(cacheKey);
+
if (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
entry = new CacheEntry();
boolean entryUpdated = true;
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 4974dafab..53966a58f 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -2932,6 +2932,9 @@ public class LauncherModel extends BroadcastReceiver
}
});
}
+
+ // Reload widget list. No need to refresh, as we only want to update the icons and labels.
+ loadAndBindWidgetsAndShortcuts(mApp.getContext(), callbacks, false);
}
void enqueuePackageUpdated(PackageUpdatedTask task) {
diff --git a/src/com/android/launcher3/model/WidgetsModel.java b/src/com/android/launcher3/model/WidgetsModel.java
index 76e6a9dd5..625d4d696 100644
--- a/src/com/android/launcher3/model/WidgetsModel.java
+++ b/src/com/android/launcher3/model/WidgetsModel.java
@@ -8,7 +8,6 @@ import android.util.Log;
import com.android.launcher3.IconCache;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherAppWidgetProviderInfo;
-
import com.android.launcher3.Utilities;
import com.android.launcher3.compat.AlphabeticIndexCompat;
import com.android.launcher3.compat.UserHandleCompat;