Merge "Fixing isOpRestricted in AppOpsService" into nyc-dev

am: 653e7bedb4

* commit '653e7bedb4ea95f69c109d54ddd0b7a49e6530c6':
  Fixing isOpRestricted in AppOpsService

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