diff options
author | Chris Wren <cwren@android.com> | 2014-05-13 21:55:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-13 21:55:13 +0000 |
commit | 244637b59c328b918c6b2e1aef33ba448728207d (patch) | |
tree | 5f12419d94f85553f90d8ec9ab076d6cb3600e09 /src/com | |
parent | c2a2c6238d7bc337f047880166181794b2b9e520 (diff) | |
parent | 075f9f5b66e5cee368750b87686f0f3156352c7f (diff) | |
download | android_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/com')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 13 |
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); } |