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
This commit is contained in:
@@ -275,6 +275,7 @@ public class IconCache {
|
|||||||
ComponentName component = ComponentName.unflattenFromString(cn);
|
ComponentName component = ComponentName.unflattenFromString(cn);
|
||||||
PackageInfo info = pkgInfoMap.get(component.getPackageName());
|
PackageInfo info = pkgInfoMap.get(component.getPackageName());
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
|
remove(component, user);
|
||||||
itemsToRemove.add(c.getInt(rowIndex));
|
itemsToRemove.add(c.getInt(rowIndex));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -291,6 +292,7 @@ public class IconCache {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (app == null) {
|
if (app == null) {
|
||||||
|
remove(component, user);
|
||||||
itemsToRemove.add(c.getInt(rowIndex));
|
itemsToRemove.add(c.getInt(rowIndex));
|
||||||
} else {
|
} else {
|
||||||
appsToUpdate.add(app);
|
appsToUpdate.add(app);
|
||||||
@@ -562,9 +564,10 @@ public class IconCache {
|
|||||||
*/
|
*/
|
||||||
private CacheEntry getEntryForPackageLocked(String packageName, UserHandleCompat user,
|
private CacheEntry getEntryForPackageLocked(String packageName, UserHandleCompat user,
|
||||||
boolean useLowResIcon) {
|
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);
|
ComponentKey cacheKey = new ComponentKey(cn, user);
|
||||||
CacheEntry entry = mCache.get(cacheKey);
|
CacheEntry entry = mCache.get(cacheKey);
|
||||||
|
|
||||||
if (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
|
if (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
|
||||||
entry = new CacheEntry();
|
entry = new CacheEntry();
|
||||||
boolean entryUpdated = true;
|
boolean entryUpdated = true;
|
||||||
|
|||||||
@@ -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) {
|
void enqueuePackageUpdated(PackageUpdatedTask task) {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import android.util.Log;
|
|||||||
import com.android.launcher3.IconCache;
|
import com.android.launcher3.IconCache;
|
||||||
import com.android.launcher3.LauncherAppState;
|
import com.android.launcher3.LauncherAppState;
|
||||||
import com.android.launcher3.LauncherAppWidgetProviderInfo;
|
import com.android.launcher3.LauncherAppWidgetProviderInfo;
|
||||||
|
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.compat.AlphabeticIndexCompat;
|
import com.android.launcher3.compat.AlphabeticIndexCompat;
|
||||||
import com.android.launcher3.compat.UserHandleCompat;
|
import com.android.launcher3.compat.UserHandleCompat;
|
||||||
|
|||||||
Reference in New Issue
Block a user