diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-07-22 15:55:50 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2014-07-22 18:21:58 -0700 |
commit | e159e2e0b83f9ea9d48f4c8666f9536e9338a70c (patch) | |
tree | b3da726ce05637a30ec5aa3d8038b92af4e93050 /services/usage/java/com/android/server | |
parent | 921ec8056a3010d0a21400f97312cf3f7d97ffaa (diff) | |
download | frameworks_base-e159e2e0b83f9ea9d48f4c8666f9536e9338a70c.zip frameworks_base-e159e2e0b83f9ea9d48f4c8666f9536e9338a70c.tar.gz frameworks_base-e159e2e0b83f9ea9d48f4c8666f9536e9338a70c.tar.bz2 |
Add test UsageStats App
Also fixed UsageStatsService to do the right thing
when AppOps returns MODE_DEFAULT.
Change-Id: I0bdb28350fb2528daf2859cdcbbf9ca48d96dde9
Diffstat (limited to 'services/usage/java/com/android/server')
-rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 475824a..4018def 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -386,8 +386,8 @@ public class UsageStatsService extends SystemService { private boolean hasPermission(String callingPackage) { final int mode = mAppOps.checkOp(AppOpsManager.OP_GET_USAGE_STATS, Binder.getCallingUid(), callingPackage); - if (mode == AppOpsManager.MODE_IGNORED) { - // If AppOpsManager ignores this, still allow if we have the system level + if (mode == AppOpsManager.MODE_DEFAULT) { + // The default behavior here is to check if PackageManager has given the app // permission. return getContext().checkCallingPermission(Manifest.permission.PACKAGE_USAGE_STATS) == PackageManager.PERMISSION_GRANTED; |