summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2014-05-13 21:55:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-13 21:55:13 +0000
commit244637b59c328b918c6b2e1aef33ba448728207d (patch)
tree5f12419d94f85553f90d8ec9ab076d6cb3600e09 /src
parentc2a2c6238d7bc337f047880166181794b2b9e520 (diff)
parent075f9f5b66e5cee368750b87686f0f3156352c7f (diff)
downloadandroid_packages_apps_Trebuchet-244637b59c328b918c6b2e1aef33ba448728207d.tar.gz
android_packages_apps_Trebuchet-244637b59c328b918c6b2e1aef33ba448728207d.tar.bz2
android_packages_apps_Trebuchet-244637b59c328b918c6b2e1aef33ba448728207d.zip
Merge "work around bug in LauncherAppsCompat to find restored icons" into ub-now-nova
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);
}