Merge "Allow permissions to be runtime-only." into oc-dev am: 941e9e2b38
am: 57a9464831
Change-Id: Ibf8b8f13ff5a8819671142e77ee238ba08805d40
This commit is contained in:
@@ -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 "
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user