Commit f9cc11e6 authored by android-build-team Robot's avatar android-build-team Robot

Merge cherrypicks of [5142118] into oc-m7-release

Change-Id: Ida047fe37543c6cedb5bd8fcea026f05afea46b5
parents bde102fb 1219e377
......@@ -284,7 +284,6 @@ import com.android.server.Watchdog;
import com.android.server.net.NetworkPolicyManagerInternal;
import com.android.server.pm.Installer.InstallerException;
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.VersionInfo;
import com.android.server.pm.dex.DexManager;
......@@ -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(bp.name);
if (!permsState.hasRequestedPermission(bp.name) && index == -1) {
if (index == -1) {
throw new SecurityException("Package " + pkg.packageName
+ " has not requested permission " + bp.name);
}
......@@ -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
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