summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-05-07 10:48:44 -0700
committerSvetoslav <svetoslavganov@google.com>2015-05-11 17:13:57 -0700
commit8c7f700a59ad26e75c9791335d78f14322cad49a (patch)
tree151d514ffaf4c6bde3ee650e8f94b7f64eb74fd8 /cmds/pm
parent3ce72722ca14ad9e84ca54920bb2829696f68d53 (diff)
downloadframeworks_base-8c7f700a59ad26e75c9791335d78f14322cad49a.zip
frameworks_base-8c7f700a59ad26e75c9791335d78f14322cad49a.tar.gz
frameworks_base-8c7f700a59ad26e75c9791335d78f14322cad49a.tar.bz2
Add permission meta-state flags to support grant/revoke permission policy.
We now maintain a mata-state with each permission in the form of flags specyfying the policy for this permission. This enables support of the following use cases: 1. The user denies a permission with prejudice in which case an app cannot request the permission at runtime. If an app requests such a permssion it gets a denial unless the user grants the permission from settings. 2. A legacy app with disabled app-ops being upgraded to support runtime permissions. The disabled app ops are converted to permission revocations. The app ops manager is a part of the activity manger which sits on top of the package manager, hence the latter cannot have a dependency on the former. To avoid this the package installer which is the global permission managment authority marks the permission as revoked on upgrade and the package manager revokes it on upgrade. 3. A device policy fixing a permission in a granted or revoked state. This additional information is folded in the meta-state flags and neither apps can request such permissions if revoked not the user can change the permission state in the UI. Change-Id: I443e8a7bb94bfcb4ff6003d158e1408c26149811
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 39de1dc7..eb834f2 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -1609,9 +1609,9 @@ public final class Pm {
try {
if (grant) {
- mPm.grantPermission(pkg, perm, userId);
+ mPm.grantRuntimePermission(pkg, perm, userId);
} else {
- mPm.revokePermission(pkg, perm, userId);
+ mPm.revokeRuntimePermission(pkg, perm, userId);
}
return 0;
} catch (RemoteException e) {