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

Commit 94faa4a7 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Use setUidMode when reading state

This is better than manually setting the mode as setUidMode also evals
the foregroundOps if needed.

Bug: 148180766
Test: atest CtsAppOpsTestCases
Change-Id: I50932cda1af7f57e91f93efa04051de55522699f
parent e565c7b8
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -3877,11 +3877,7 @@ public class AppOpsService extends IAppOpsService.Stub {
            if (tagName.equals("op")) {
                final int code = Integer.parseInt(parser.getAttributeValue(null, "n"));
                final int mode = Integer.parseInt(parser.getAttributeValue(null, "m"));
                UidState uidState = getUidStateLocked(uid, true);
                if (uidState.opModes == null) {
                    uidState.opModes = new SparseIntArray();
                }
                uidState.opModes.put(code, mode);
                setUidMode(code, uid, mode);
            } else {
                Slog.w(TAG, "Unknown element under <uid-ops>: "
                        + parser.getName());