* commit '9f11f105cd2983021a73b9aa921674fbff3457f3': Fix issue #10226007: Reset apps restores most of the changed settings...
This commit is contained in:
@@ -380,12 +380,14 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
HashMap<Callback, ArrayList<Pair<String, Integer>>> callbacks = null;
|
||||
synchronized (this) {
|
||||
boolean changed = false;
|
||||
for (int i=0; i<mUidOps.size(); i++) {
|
||||
for (int i=mUidOps.size()-1; i>=0; i--) {
|
||||
HashMap<String, Ops> packages = mUidOps.valueAt(i);
|
||||
for (Map.Entry<String, Ops> ent : packages.entrySet()) {
|
||||
Iterator<Map.Entry<String, Ops>> it = packages.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, Ops> ent = it.next();
|
||||
String packageName = ent.getKey();
|
||||
Ops pkgOps = ent.getValue();
|
||||
for (int j=0; j<pkgOps.size(); j++) {
|
||||
for (int j=pkgOps.size()-1; j>=0; j--) {
|
||||
Op curOp = pkgOps.valueAt(j);
|
||||
if (curOp.mode != AppOpsManager.MODE_ALLOWED) {
|
||||
curOp.mode = AppOpsManager.MODE_ALLOWED;
|
||||
@@ -394,9 +396,17 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
mOpModeWatchers.get(curOp.op));
|
||||
callbacks = addCallbacks(callbacks, packageName, curOp.op,
|
||||
mPackageModeWatchers.get(packageName));
|
||||
pruneOp(curOp, mUidOps.keyAt(i), packageName);
|
||||
if (curOp.time == 0 && curOp.rejectTime == 0) {
|
||||
pkgOps.removeAt(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pkgOps.size() == 0) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
if (packages.size() == 0) {
|
||||
mUidOps.removeAt(i);
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
|
||||
Reference in New Issue
Block a user