RESTRICT AUTOMERGE Validate permission tree size on permission update am: 973c67f7fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20029904 Change-Id: I791f0b51840d23b983551e0716bad8806e8cd044 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -644,8 +644,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
|
|||||||
Permission bp = mRegistry.getPermission(info.name);
|
Permission bp = mRegistry.getPermission(info.name);
|
||||||
added = bp == null;
|
added = bp == null;
|
||||||
int fixedLevel = PermissionInfo.fixProtectionLevel(info.protectionLevel);
|
int fixedLevel = PermissionInfo.fixProtectionLevel(info.protectionLevel);
|
||||||
|
enforcePermissionCapLocked(info, tree);
|
||||||
if (added) {
|
if (added) {
|
||||||
enforcePermissionCapLocked(info, tree);
|
|
||||||
bp = new Permission(info.name, tree.getPackageName(), Permission.TYPE_DYNAMIC);
|
bp = new Permission(info.name, tree.getPackageName(), Permission.TYPE_DYNAMIC);
|
||||||
} else if (!bp.isDynamic()) {
|
} else if (!bp.isDynamic()) {
|
||||||
throw new SecurityException("Not allowed to modify non-dynamic permission "
|
throw new SecurityException("Not allowed to modify non-dynamic permission "
|
||||||
|
|||||||
Reference in New Issue
Block a user