Merge "Fixing isOpRestricted in AppOpsService" into nyc-dev am: 653e7bedb4

am: 1c49c33f3e

* commit '1c49c33f3e71a283beeeb6c4496bb99270052c79':
  Fixing isOpRestricted in AppOpsService

Change-Id: I30bfb72ba0f90228d3e82ea88ad0e85e0ad0ace1
This commit is contained in:
Suprabh Shukla
2016-05-23 18:07:29 +00:00
committed by android-build-merger

View File

@@ -1316,13 +1316,14 @@ public class AppOpsService extends IAppOpsService.Stub {
// For each client, check that the given op is not restricted, or that the given
// package is exempt from the restriction.
ClientRestrictionState restrictionState = mOpUserRestrictions.valueAt(i);
if (restrictionState.hasRestriction(code, packageName, userHandle)
&& AppOpsManager.opAllowSystemBypassRestriction(code)) {
// If we are the system, bypass user restrictions for certain codes
synchronized (this) {
Ops ops = getOpsRawLocked(uid, packageName, true);
if ((ops != null) && ops.isPrivileged) {
return false;
if (restrictionState.hasRestriction(code, packageName, userHandle)) {
if (AppOpsManager.opAllowSystemBypassRestriction(code)) {
// If we are the system, bypass user restrictions for certain codes
synchronized (this) {
Ops ops = getOpsRawLocked(uid, packageName, true);
if ((ops != null) && ops.isPrivileged) {
return false;
}
}
}
return true;