work around bug in LauncherAppsCompat to find restored icons

Bug: 14895464
Change-Id: Iff4f1a9a2e8edf789231be7a1c20e277e18eb05c
This commit is contained in:
Chris Wren committed 2014-05-13 16:18:21 -04:00
1 parent 418dcb881a
commit 075f9f5b66
1 file changed
+11 -2
+11 -2
View File
@@ -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);
}