diff options
| author | Dianne Hackborn <hackbod@google.com> | 2015-07-07 17:25:25 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2015-07-07 17:25:25 -0700 |
| commit | a90c8def2c6762bc6e5396b78c43e65e4b05079d (patch) | |
| tree | ea3272f28ed7308ec41540d399e454261e51c56c /core/java/android/content/pm | |
| parent | f2474d336a7df696f3897e2cd255d138eb3fac02 (diff) | |
| download | frameworks_base-a90c8def2c6762bc6e5396b78c43e65e4b05079d.zip frameworks_base-a90c8def2c6762bc6e5396b78c43e65e4b05079d.tar.gz frameworks_base-a90c8def2c6762bc6e5396b78c43e65e4b05079d.tar.bz2 | |
Add new "preinstalled" permission flag.
This allows you to specify that a permission can be granted to
any pre-installed system app (not just privileged ones).
And as long as I am doing this, clean up the old "system" permission
flag, renaming it to "privileged" which is what it really is today,
deprecating the old names. And switch the platform's permission
declarations to use the new name.
Change-Id: Iabf484746af232144786851ec7fe90e3de9dddb2
Diffstat (limited to 'core/java/android/content/pm')
| -rw-r--r-- | core/java/android/content/pm/PermissionInfo.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 1857ecf..2828d83 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -48,17 +48,25 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { public static final int PROTECTION_SIGNATURE = 2; /** - * System-level value for {@link #protectionLevel}, corresponding - * to the <code>signatureOrSystem</code> value of - * {@link android.R.attr#protectionLevel}. + * @deprecated Use {@link #PROTECTION_SIGNATURE}|{@link #PROTECTION_FLAG_PRIVILEGED} + * instead. */ + @Deprecated public static final int PROTECTION_SIGNATURE_OR_SYSTEM = 3; /** * Additional flag for {@link #protectionLevel}, corresponding - * to the <code>system</code> value of + * to the <code>privileged</code> value of * {@link android.R.attr#protectionLevel}. */ + public static final int PROTECTION_FLAG_PRIVILEGED = 0x10; + + /** + * @deprecated Old name for {@link #PROTECTION_FLAG_PRIVILEGED}, which + * is now very confusing because it only applies to privileged apps, not all + * apps on the system image. + */ + @Deprecated public static final int PROTECTION_FLAG_SYSTEM = 0x10; /** @@ -97,6 +105,13 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { public static final int PROTECTION_FLAG_VERIFIER = 0x200; /** + * Additional flag for {@link #protectionLevel}, corresponding + * to the <code>preinstalled</code> value of + * {@link android.R.attr#protectionLevel}. + */ + public static final int PROTECTION_FLAG_PREINSTALLED = 0x400; + + /** * Mask for {@link #protectionLevel}: the basic protection type. */ public static final int PROTECTION_MASK_BASE = 0xf; @@ -161,7 +176,7 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { /** @hide */ public static int fixProtectionLevel(int level) { if (level == PROTECTION_SIGNATURE_OR_SYSTEM) { - level = PROTECTION_SIGNATURE | PROTECTION_FLAG_SYSTEM; + level = PROTECTION_SIGNATURE | PROTECTION_FLAG_PRIVILEGED; } return level; } @@ -183,8 +198,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { protLevel = "signatureOrSystem"; break; } - if ((level&PermissionInfo.PROTECTION_FLAG_SYSTEM) != 0) { - protLevel += "|system"; + if ((level&PermissionInfo.PROTECTION_FLAG_PRIVILEGED) != 0) { + protLevel += "|privileged"; } if ((level&PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0) { protLevel += "|development"; |
