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

Commit b420a64e authored by Bruno Martins's avatar Bruno Martins Committed by Philip P. Moltmann
Browse files

AppOpsService: Watch op mode changes when an AppOp restriction dies

On binder death, ensure that any associated watched ops are not left
dangling in an active state.

Test: manual, ops states are now propagated properly after apps are killed
Change-Id: Ied66c7f49e1c483870048563d08fb57410f004ef
parent eba21f1d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -807,7 +807,12 @@ public class AppOpsService extends IAppOpsService.Stub {
        public void binderDied() {
            synchronized (AppOpsService.this) {
                for (int i=mStartedOps.size()-1; i>=0; i--) {
                    finishOperationLocked(mStartedOps.get(i), /*finishNested*/ true);
                    final Op op = mStartedOps.get(i);
                    finishOperationLocked(op, /*finishNested*/ true);
                    if (op.startNesting <= 0) {
                        scheduleOpActiveChangedIfNeededLocked(op.op, op.uidState.uid,
                                op.packageName, false);
                    }
                }
                mClients.remove(mAppToken);
            }