Fixing label cache issue due to different ResolveInfos being returned in different parts of loading, saves 1-10% on AllApps load. (5042022)
Change-Id: I17166bd6a50858ff76c475688fff9a9eaeba6010
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java
index b2ebe2a..247e164 100644
--- a/src/com/android/launcher2/IconCache.java
+++ b/src/com/android/launcher2/IconCache.java
@@ -183,12 +183,13 @@
mCache.put(componentName, entry);
- if (labelCache != null && labelCache.containsKey(info)) {
- entry.title = labelCache.get(info).toString();
+ ComponentName key = LauncherModel.getComponentNameFromResolveInfo(info);
+ if (labelCache != null && labelCache.containsKey(key)) {
+ entry.title = labelCache.get(key).toString();
} else {
entry.title = info.loadLabel(mPackageManager).toString();
if (labelCache != null) {
- labelCache.put(info, entry.title);
+ labelCache.put(key, entry.title);
}
}
if (entry.title == null) {