Merge "Relax restrictions on appop protection level" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e5cb2b87a4
@@ -108,17 +108,14 @@ public class ParsedPermissionUtils {
|
|||||||
|
|
||||||
permission.protectionLevel = PermissionInfo.fixProtectionLevel(permission.protectionLevel);
|
permission.protectionLevel = PermissionInfo.fixProtectionLevel(permission.protectionLevel);
|
||||||
|
|
||||||
if (permission.getProtectionFlags() != 0) {
|
final int otherProtectionFlags = permission.getProtectionFlags()
|
||||||
if ((permission.protectionLevel & PermissionInfo.PROTECTION_FLAG_INSTANT) == 0
|
& ~(PermissionInfo.PROTECTION_FLAG_APPOP | PermissionInfo.PROTECTION_FLAG_INSTANT
|
||||||
&& (permission.protectionLevel & PermissionInfo.PROTECTION_FLAG_RUNTIME_ONLY)
|
| PermissionInfo.PROTECTION_FLAG_RUNTIME_ONLY);
|
||||||
== 0
|
if (otherProtectionFlags != 0
|
||||||
&& (permission.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE)
|
&& permission.getProtection() != PermissionInfo.PROTECTION_SIGNATURE
|
||||||
!= PermissionInfo.PROTECTION_SIGNATURE
|
&& permission.getProtection() != PermissionInfo.PROTECTION_INTERNAL) {
|
||||||
&& (permission.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE)
|
return input.error("<permission> protectionLevel specifies a non-instant, non-appop,"
|
||||||
!= PermissionInfo.PROTECTION_INTERNAL) {
|
+ " non-runtimeOnly flag but is not based on signature or internal type");
|
||||||
return input.error("<permission> protectionLevel specifies a non-instant flag "
|
|
||||||
+ "but is not based on signature or internal type");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ComponentParseUtils.parseAllMetaData(pkg, res, parser, tag, permission, input);
|
return ComponentParseUtils.parseAllMetaData(pkg, res, parser, tag, permission, input);
|
||||||
|
|||||||
Reference in New Issue
Block a user