Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf34a400 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't call into pm with appops lock held"

parents 945d2771 8c50f820
Loading
Loading
Loading
Loading
+23 −21
Original line number Diff line number Diff line
@@ -2188,7 +2188,16 @@ public class AppOpsService extends IAppOpsService.Stub {
            if (op == null) {
                return;
            }
            if (!client.mStartedOps.remove(op)) {
            if (client.mStartedOps.remove(op)) {
                finishOperationLocked(op, /*finishNested*/ false);
                if (op.startNesting <= 0) {
                    scheduleOpActiveChangedIfNeededLocked(code, uid, packageName, false);
                }

                return;
            }
        }

        // We finish ops when packages get removed to guarantee no dangling
        // started ops. However, some part of the system may asynchronously
        // finish ops for an already gone package. Hence, finishing an op
@@ -2205,15 +2214,8 @@ public class AppOpsService extends IAppOpsService.Stub {
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
                Slog.wtf(TAG, "Operation not started: uid=" + op.uidState.uid + " pkg="
                        + op.packageName + " op=" + AppOpsManager.opToName(op.op));
                return;
            }
            finishOperationLocked(op, /*finishNested*/ false);
            if (op.startNesting <= 0) {
                scheduleOpActiveChangedIfNeededLocked(code, uid, packageName, false);
            }
        }
        Slog.wtf(TAG, "Operation not started: uid=" + uid + " pkg="
                + packageName + " op=" + AppOpsManager.opToName(code));
    }

    private void scheduleOpActiveChangedIfNeededLocked(int code, int uid, String packageName,