Merge "Fixed NPE in ActivityManager's launch count service."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1dda71ae36
@@ -1253,8 +1253,13 @@ public class ActivityManager {
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
PkgUsageStats[] allPkgUsageStats = usageStatsService.getAllPkgUsageStats();
|
||||
if (allPkgUsageStats == null) {
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
Map<String, Integer> launchCounts = new HashMap<String, Integer>();
|
||||
for (PkgUsageStats pkgUsageStats : usageStatsService.getAllPkgUsageStats()) {
|
||||
for (PkgUsageStats pkgUsageStats : allPkgUsageStats) {
|
||||
launchCounts.put(pkgUsageStats.packageName, pkgUsageStats.launchCount);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user