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

am: c168f27c05

* commit 'c168f27c05b9e6f1972ce2cf5f817346963dfe84':
  Fixing isOpRestricted in AppOpsService

Change-Id: I6504a1893f470dc8b083acad9157f6fe6bd490a0
This commit is contained in:
Suprabh Shukla
2016-05-23 18:12:48 +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;