summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/location
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2014-08-07 14:02:41 +0100
committerZoltan Szatmary-Ban <szatmz@google.com>2014-08-14 09:51:58 +0000
commit3aaf0eb457639b52228143b84d9624bf73d862ea (patch)
treed03a05e0159f3a83d958c8b7f14f2063c30993f7 /src/com/android/settings/location
parentf8be13d8ca29a61a97411d9d30cb4b82bb669bcf (diff)
downloadpackages_apps_Settings-3aaf0eb457639b52228143b84d9624bf73d862ea.zip
packages_apps_Settings-3aaf0eb457639b52228143b84d9624bf73d862ea.tar.gz
packages_apps_Settings-3aaf0eb457639b52228143b84d9624bf73d862ea.tar.bz2
Fix app icons on some Settings screens
App icons appeared as the default icon and sometimes without the corp badge on Data Usage and Battery screens for applications that were only installed for the managed profile. This CL fixes the issue. Bug:16705204 Change-Id: I778d36554feb19f28f3cb9321a291cab3d3e17bb
Diffstat (limited to 'src/com/android/settings/location')
-rw-r--r--src/com/android/settings/location/RecentLocationApps.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/settings/location/RecentLocationApps.java b/src/com/android/settings/location/RecentLocationApps.java
index 13d282d..7c59927 100644
--- a/src/com/android/settings/location/RecentLocationApps.java
+++ b/src/com/android/settings/location/RecentLocationApps.java
@@ -203,6 +203,11 @@ public class RecentLocationApps {
IPackageManager ipm = AppGlobals.getPackageManager();
ApplicationInfo appInfo =
ipm.getApplicationInfo(packageName, PackageManager.GET_META_DATA, userId);
+ if (appInfo == null) {
+ Log.w(TAG, "Null application info retrieved for package " + packageName
+ + ", userId " + userId);
+ return null;
+ }
Resources res = mActivity.getResources();
final UserHandle userHandle = new UserHandle(userId);
@@ -214,7 +219,8 @@ public class RecentLocationApps {
appLabel, highBattery, badgedAppLabel,
new PackageEntryClickedListener(packageName));
} catch (RemoteException e) {
- Log.w(TAG, "Error while retrieving application info", e);
+ Log.w(TAG, "Error while retrieving application info for package " + packageName
+ + ", userId " + userId, e);
}
return preference;