summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/IconCache.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-08-18 12:12:41 -0700
committerWinson Chung <winsonc@google.com>2011-08-18 12:15:28 -0700
commit5308f24d4b66b020202b88eff672f5a89096ebb6 (patch)
tree6c7e9f4c633cd3e7d2bef552c2e53fc3951f6c9c /src/com/android/launcher2/IconCache.java
parentc273c5814d7b312628107ad4a7bff9cc64e89eae (diff)
downloadandroid_packages_apps_Trebuchet-5308f24d4b66b020202b88eff672f5a89096ebb6.tar.gz
android_packages_apps_Trebuchet-5308f24d4b66b020202b88eff672f5a89096ebb6.tar.bz2
android_packages_apps_Trebuchet-5308f24d4b66b020202b88eff672f5a89096ebb6.zip
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
Diffstat (limited to 'src/com/android/launcher2/IconCache.java')
-rw-r--r--src/com/android/launcher2/IconCache.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java
index b2ebe2ac3..247e164ec 100644
--- a/src/com/android/launcher2/IconCache.java
+++ b/src/com/android/launcher2/IconCache.java
@@ -183,12 +183,13 @@ public class IconCache {
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) {