Merge "Allow permissions to be runtime-only." into oc-dev am: 941e9e2b38

am: 57a9464831

Change-Id: Ibf8b8f13ff5a8819671142e77ee238ba08805d40
This commit is contained in:
Chad Brubaker
2017-04-06 19:27:22 +00:00
committed by android-build-merger
9 changed files with 32 additions and 3 deletions

View File

@@ -3114,6 +3114,7 @@ public class PackageParser {
if ((perm.info.protectionLevel&PermissionInfo.PROTECTION_MASK_FLAGS) != 0) {
if ( (perm.info.protectionLevel&PermissionInfo.PROTECTION_FLAG_EPHEMERAL) == 0
&& (perm.info.protectionLevel&PermissionInfo.PROTECTION_FLAG_RUNTIME_ONLY) == 0
&& (perm.info.protectionLevel&PermissionInfo.PROTECTION_MASK_BASE) !=
PermissionInfo.PROTECTION_SIGNATURE) {
outError[0] = "<permission> protectionLevel specifies a non-ephemeral flag but is "

View File

@@ -130,6 +130,13 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
@TestApi
public static final int PROTECTION_FLAG_EPHEMERAL = 0x1000;
/**
* Additional flag for {@link #protectionLevel}, corresponding
* to the <code>runtime</code> value of
* {@link android.R.attr#protectionLevel}.
*/
public static final int PROTECTION_FLAG_RUNTIME_ONLY = 0x2000;
/**
* Mask for {@link #protectionLevel}: the basic protection type.
*/
@@ -250,6 +257,9 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
if ((level&PermissionInfo.PROTECTION_FLAG_EPHEMERAL) != 0) {
protLevel += "|ephemeral";
}
if ((level&PermissionInfo.PROTECTION_FLAG_RUNTIME_ONLY) != 0) {
protLevel += "|runtime";
}
return protLevel;
}