Merge "Remove setAllPkgModesToDefault"
This commit is contained in:
committed by
Android (Google) Code Review
commit
cc66ee1e93
@@ -90,14 +90,6 @@ public abstract class AppOpsManagerInternal {
|
||||
*/
|
||||
public abstract void setUidMode(int code, int uid, int mode);
|
||||
|
||||
/**
|
||||
* Set all {@link #setMode (package) modes} for this uid to the default value.
|
||||
*
|
||||
* @param code The app-op
|
||||
* @param uid The uid
|
||||
*/
|
||||
public abstract void setAllPkgModesToDefault(int code, int uid);
|
||||
|
||||
/**
|
||||
* Get the (raw) mode of an app-op.
|
||||
*
|
||||
|
||||
@@ -1335,48 +1335,6 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all {@link #setMode (package) modes} for this uid to the default value.
|
||||
*
|
||||
* @param code The app-op
|
||||
* @param uid The uid
|
||||
*/
|
||||
private void setAllPkgModesToDefault(int code, int uid) {
|
||||
synchronized (this) {
|
||||
UidState uidState = getUidStateLocked(uid, false);
|
||||
if (uidState == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayMap<String, Ops> pkgOps = uidState.pkgOps;
|
||||
if (pkgOps == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean scheduleWrite = false;
|
||||
|
||||
int numPkgs = pkgOps.size();
|
||||
for (int pkgNum = 0; pkgNum < numPkgs; pkgNum++) {
|
||||
Ops ops = pkgOps.valueAt(pkgNum);
|
||||
|
||||
Op op = ops.get(code);
|
||||
if (op == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int defaultMode = AppOpsManager.opToDefaultMode(code);
|
||||
if (op.mode != defaultMode) {
|
||||
op.mode = defaultMode;
|
||||
scheduleWrite = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (scheduleWrite) {
|
||||
scheduleWriteLocked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMode(int code, int uid, String packageName, int mode) {
|
||||
setMode(code, uid, packageName, mode, true, false);
|
||||
@@ -4575,11 +4533,6 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
AppOpsService.this.setUidMode(code, uid, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllPkgModesToDefault(int code, int uid) {
|
||||
AppOpsService.this.setAllPkgModesToDefault(code, uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Mode int checkOperationUnchecked(int code, int uid, @NonNull String packageName) {
|
||||
return AppOpsService.this.checkOperationUnchecked(code, uid, packageName, true, false);
|
||||
|
||||
Reference in New Issue
Block a user