diff options
Diffstat (limited to 'core/java/android/app/ActivityManager.java')
-rw-r--r-- | core/java/android/app/ActivityManager.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index a6658cc..d207a0a 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -1471,6 +1471,24 @@ public class ActivityManager { } /** + * Returns the usage statistics of each installed package. + * + * @hide + */ + public PkgUsageStats[] getAllPackageUsageStats() { + try { + IUsageStats usageStatsService = IUsageStats.Stub.asInterface( + ServiceManager.getService("usagestats")); + if (usageStatsService != null) { + return usageStatsService.getAllPkgUsageStats(); + } + } catch (RemoteException e) { + Log.w(TAG, "Could not query usage stats", e); + } + return new PkgUsageStats[0]; + } + + /** * @param userid the user's id. Zero indicates the default user * @hide */ |