summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2014-05-13 16:18:21 -0400
committerChris Wren <cwren@android.com>2014-05-13 16:18:21 -0400
commit075f9f5b66e5cee368750b87686f0f3156352c7f (patch)
tree1e79850837cbb6f7892db35ea624e59765879e63 /src
parent418dcb881a62162b2834321d362c2f8f01962493 (diff)
downloadandroid_packages_apps_Trebuchet-075f9f5b66e5cee368750b87686f0f3156352c7f.tar.gz
android_packages_apps_Trebuchet-075f9f5b66e5cee368750b87686f0f3156352c7f.tar.bz2
android_packages_apps_Trebuchet-075f9f5b66e5cee368750b87686f0f3156352c7f.zip
work around bug in LauncherAppsCompat to find restored icons
Bug: 14895464 Change-Id: Iff4f1a9a2e8edf789231be7a1c20e277e18eb05c
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/IconCache.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 05be2141e..4d953ff10 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -249,11 +249,20 @@ public class IconCache {
public Bitmap getIcon(Intent intent, String title, UserHandleCompat user) {
synchronized (mCache) {
- final LauncherActivityInfoCompat launcherActInfo =
+ LauncherActivityInfoCompat launcherActInfo =
mLauncherApps.resolveActivity(intent, user);
ComponentName component = intent.getComponent();
- if (launcherActInfo == null || component == null) {
+ try {
+ launcherActInfo.getComponentName();
+ } catch (NullPointerException e) {
+ // launcherActInfo is invalid: b/14891460
+ launcherActInfo = null;
+ }
+
+ // null info means not installed, but if we have a component from the intent then
+ // we should still look in the cache for restored app icons.
+ if (launcherActInfo == null && component == null) {
return getDefaultIcon(user);
}