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

Commit baa658bc authored by Evan Severson's avatar Evan Severson Committed by Gerrit Code Review
Browse files

Merge "Reduce unnecessary callbacks in AppOpsService." into main

parents 4c8c31ae d0729ba9
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 {