summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremancebo <emancebo@cyngn.com>2015-09-06 14:23:34 -0700
committerHoward Harte <hharte@cyngn.com>2015-09-06 20:10:06 -0700
commitdb6a4e70d0c8dc063f5a2831e3f8e16def16a41c (patch)
treead031dcf04c7d7f468249b36e8391216b0cef85b
parent312f7361e72b39e79f3745d2a9d22cd82bbf444c (diff)
downloadandroid_packages_apps_Trebuchet-db6a4e70d0c8dc063f5a2831e3f8e16def16a41c.tar.gz
android_packages_apps_Trebuchet-db6a4e70d0c8dc063f5a2831e3f8e16def16a41c.tar.bz2
android_packages_apps_Trebuchet-db6a4e70d0c8dc063f5a2831e3f8e16def16a41c.zip
Trebuchet: fix potential NPE when info is null
Previously we were guarding against a null info object, but with the the STK rename patches we will throw an NPE if info is null issue-id: JALEBI-636 Change-Id: I74e95f81b64361c1bb56307c0cc621f24e701648 (cherry picked from commit f3c0e343f0f7c5ce32390e8402519456b32978b2)
-rw-r--r--src/com/android/launcher3/IconCache.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index de53b9718..365f8ed2a 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -332,17 +332,21 @@ public class IconCache {
boolean usePackageIcon, int unreadNum) {
CacheKey cacheKey = new CacheKey(componentName, user);
CacheEntry entry = mCache.get(cacheKey);
- boolean condition = (mContext.getResources().
- getBoolean(R.bool.config_launcher_stkAppRename))
- && info.getComponentName().getPackageName().toString()
- .equalsIgnoreCase(STK_PACKAGE_NAME);
- String activity = info.getComponentName().getClassName().toString();
boolean isCustomTitle = false;
- if (condition
- && !TextUtils.isEmpty(((LauncherApplication) mContext)
- .getStkAppName(activity))) {
- isCustomTitle = true;
+ String activity = null;
+ if (info != null) {
+ boolean condition = (mContext.getResources().
+ getBoolean(R.bool.config_launcher_stkAppRename))
+ && info.getComponentName().getPackageName().toString()
+ .equalsIgnoreCase(STK_PACKAGE_NAME);
+ activity = info.getComponentName().getClassName().toString();
+
+ if (condition
+ && !TextUtils.isEmpty(((LauncherApplication) mContext)
+ .getStkAppName(activity))) {
+ isCustomTitle = true;
+ }
}
if (entry == null || unreadNum >= 0) {
entry = new CacheEntry();