diff options
author | Dianne Hackborn <hackbod@google.com> | 2015-08-18 11:08:10 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2015-08-18 11:08:10 -0700 |
commit | af75c17bca8b2f017e254131393cd72e2fe7c6e8 (patch) | |
tree | e083068e1a6b7f77a89f1b2a11eeb14b6ea3a176 /services/usage | |
parent | 9a010d0a4157f97870bc38bd3dd0a8f4fd18a172 (diff) | |
download | frameworks_base-af75c17bca8b2f017e254131393cd72e2fe7c6e8.zip frameworks_base-af75c17bca8b2f017e254131393cd72e2fe7c6e8.tar.gz frameworks_base-af75c17bca8b2f017e254131393cd72e2fe7c6e8.tar.bz2 |
Fix issue #23270878: NPE in UsageStatsService while running UserManagementTest
Change-Id: I34d4fcdc103b3a6ea5c4ed78895f2fe18597237a
Diffstat (limited to 'services/usage')
-rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 85f0665..4146c1c 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -848,6 +848,9 @@ public class UsageStatsService extends SystemService implements try { ParceledListSlice<ApplicationInfo> slice = AppGlobals.getPackageManager().getInstalledApplications(0, userId); + if (slice == null) { + return new int[0]; + } apps = slice.getList(); } catch (RemoteException e) { return new int[0]; |