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

Commit c0a4c71b authored by Evan Severson's avatar Evan Severson Committed by Automerger Merge Worker
Browse files

Merge "Reduce unnecessary callbacks in AppOpsService." into main am: baa658bc

parents 0707f885 baa658bc
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -221,20 +221,24 @@ public class AppOpsCheckingServiceImpl implements AppOpsCheckingServiceInterface
        synchronized (mLock) {
            SparseIntArray opModes = mUidModes.get(uid, null);
            if (opModes == null) {
                if (mode != defaultMode) {
                if (mode == defaultMode) {
                    return false;
                }
                opModes = new SparseIntArray();
                mUidModes.put(uid, opModes);
                opModes.put(op, mode);
                scheduleWriteLocked();
                }
            } else {
                if (opModes.indexOfKey(op) >= 0 && opModes.get(op) == mode) {
                if (opModes.indexOfKey(op) >= 0) {
                    if (opModes.get(op) == mode) {
                        return false;
                    }
                } else if (mode == defaultMode) {
                    return false;
                }
                if (mode == defaultMode) {
                    opModes.delete(op);
                    if (opModes.size() <= 0) {
                        opModes = null;
                        mUidModes.delete(uid);
                    }
                } else {