Merge "Fixing isOpRestricted in AppOpsService" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
653e7bedb4
@@ -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
|
// For each client, check that the given op is not restricted, or that the given
|
||||||
// package is exempt from the restriction.
|
// package is exempt from the restriction.
|
||||||
ClientRestrictionState restrictionState = mOpUserRestrictions.valueAt(i);
|
ClientRestrictionState restrictionState = mOpUserRestrictions.valueAt(i);
|
||||||
if (restrictionState.hasRestriction(code, packageName, userHandle)
|
if (restrictionState.hasRestriction(code, packageName, userHandle)) {
|
||||||
&& AppOpsManager.opAllowSystemBypassRestriction(code)) {
|
if (AppOpsManager.opAllowSystemBypassRestriction(code)) {
|
||||||
// If we are the system, bypass user restrictions for certain codes
|
// If we are the system, bypass user restrictions for certain codes
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
Ops ops = getOpsRawLocked(uid, packageName, true);
|
Ops ops = getOpsRawLocked(uid, packageName, true);
|
||||||
if ((ops != null) && ops.isPrivileged) {
|
if ((ops != null) && ops.isPrivileged) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user