Commit bb4dcd10 authored by Atanas Kirilov's avatar Atanas Kirilov

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
parent 05dc947c
...@@ -276,7 +276,6 @@ import com.android.server.Watchdog; ...@@ -276,7 +276,6 @@ import com.android.server.Watchdog;
import com.android.server.net.NetworkPolicyManagerInternal; import com.android.server.net.NetworkPolicyManagerInternal;
import com.android.server.pm.Installer.InstallerException; import com.android.server.pm.Installer.InstallerException;
import com.android.server.pm.PermissionsState.PermissionState; import com.android.server.pm.PermissionsState.PermissionState;
import com.android.server.pm.PackageSetting;
import com.android.server.pm.Settings.DatabaseVersion; import com.android.server.pm.Settings.DatabaseVersion;
import com.android.server.pm.Settings.VersionInfo; import com.android.server.pm.Settings.VersionInfo;
import com.android.server.pm.dex.DexManager; import com.android.server.pm.dex.DexManager;
...@@ -5356,10 +5355,8 @@ public class PackageManagerService extends IPackageManager.Stub ...@@ -5356,10 +5355,8 @@ public class PackageManagerService extends IPackageManager.Stub
private static void enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission( private static void enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission(
PackageParser.Package pkg, BasePermission bp) { PackageParser.Package pkg, BasePermission bp) {
final PackageSetting pkgSetting = (PackageSetting) pkg.mExtras;
final PermissionsState permsState = pkgSetting.getPermissionsState();
int index = pkg.requestedPermissions.indexOf(bp.name); int index = pkg.requestedPermissions.indexOf(bp.name);
if (!permsState.hasRequestedPermission(bp.name) && index == -1) { if (index == -1) {
throw new SecurityException("Package " + pkg.packageName throw new SecurityException("Package " + pkg.packageName
+ " has not requested permission " + bp.name); + " has not requested permission " + bp.name);
} }
...@@ -290,14 +290,6 @@ public final class PermissionsState { ...@@ -290,14 +290,6 @@ public final class PermissionsState {
return false; 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 * Gets all permissions for a given device user id regardless if they
* are install time or runtime permissions. * are install time or runtime permissions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment