Commit 1219e377 authored by Atanas Kirilov's avatar Atanas Kirilov Committed by android-build-team Robot

RESTRICT AUTOMERGE: Revert "RESTRICT AUTOMERGE: Check both self and shared...

RESTRICT AUTOMERGE: Revert "RESTRICT AUTOMERGE: Check both self and shared user id package for requested permissions."

This reverts commit 05dc947c.

Reason for revert: Not a security fix and the security fix needs this cl is reverted.
Bug: 114365189

Change-Id: Id667b1c4d1a1af27837f553d7461283b22e5e41f
(cherry picked from commit bb4dcd10)
parent bde102fb
......@@ -284,7 +284,6 @@ import;
......@@ -5618,10 +5617,8 @@ public class PackageManagerService extends IPackageManager.Stub
private static void enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission(
PackageParser.Package pkg, BasePermission bp) {
final PackageSetting pkgSetting = (PackageSetting) pkg.mExtras;
final PermissionsState permsState = pkgSetting.getPermissionsState();
int index = pkg.requestedPermissions.indexOf(;
if (!permsState.hasRequestedPermission( && index == -1) {
if (index == -1) {
throw new SecurityException("Package " + pkg.packageName
+ " has not requested permission " +;
......@@ -290,14 +290,6 @@ public final class PermissionsState {
return false;
* Returns whether the state has any known request for the given permission name,
* whether or not it has been granted.
public boolean hasRequestedPermission(String name) {
return mPermissions != null && (mPermissions.get(name) != null);
* Gets all permissions for a given device user id regardless if they
* are install time or runtime permissions.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment