diff options
author | Jeff Hao <jeffhao@google.com> | 2014-10-22 15:57:32 -0700 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2014-10-23 11:27:42 -0700 |
commit | 7eb599b267d00cbde891c0a87924f2f5086f4497 (patch) | |
tree | 01978b12641d7c03ff3edecc8e2f8d672246a5a8 /services/usage/java/com/android/server | |
parent | f6e297398ba23ce7d26cf2e0efaf0d8a2230fe1c (diff) | |
download | frameworks_base-7eb599b267d00cbde891c0a87924f2f5086f4497.zip frameworks_base-7eb599b267d00cbde891c0a87924f2f5086f4497.tar.gz frameworks_base-7eb599b267d00cbde891c0a87924f2f5086f4497.tar.bz2 |
Get UsageStats if no PackageUsage is available for boot dexopt filtering.
Bug: 17191977
Change-Id: I33e18459e49afa42b8e8218574a2434e5205a6da
Diffstat (limited to 'services/usage/java/com/android/server')
-rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 2ed9745..7ff246a 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -38,6 +38,7 @@ import android.os.Environment; import android.os.Handler; import android.os.Looper; import android.os.Message; +import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; @@ -349,8 +350,12 @@ public class UsageStatsService extends SystemService implements private class BinderService extends IUsageStatsManager.Stub { private boolean hasPermission(String callingPackage) { + final int callingUid = Binder.getCallingUid(); + if (callingUid == Process.SYSTEM_UID) { + return true; + } final int mode = mAppOps.checkOp(AppOpsManager.OP_GET_USAGE_STATS, - Binder.getCallingUid(), callingPackage); + callingUid, callingPackage); if (mode == AppOpsManager.MODE_DEFAULT) { // The default behavior here is to check if PackageManager has given the app // permission. |