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

Commit c12ee77b authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by android-build-merger
Browse files

Merge "Fix dumpsys for appops proxy field" into qt-qpr1-dev am: 30c48bb5

am: d69f2f1b

Change-Id: I75efa3cb1cbd86bd697188e34ae51c75866a44e3
parents 40701532 d69f2f1b
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -2671,7 +2671,7 @@ public class AppOpsManager {
         * @return The proxy UID.
         */
        public int getProxyUid() {
            return (int) findFirstNonNegativeForFlagsInStates(mDurations,
            return (int) findFirstNonNegativeForFlagsInStates(mProxyUids,
                    MAX_PRIORITY_UID_STATE, MIN_PRIORITY_UID_STATE, OP_FLAGS_ALL);
        }

@@ -2693,7 +2693,7 @@ public class AppOpsManager {
         * @return The proxy UID.
         */
        public int getProxyUid(@UidState int uidState, @OpFlags int flags) {
            return (int) findFirstNonNegativeForFlagsInStates(mDurations,
            return (int) findFirstNonNegativeForFlagsInStates(mProxyUids,
                    uidState, uidState, flags);
        }

@@ -4254,8 +4254,8 @@ public class AppOpsManager {
     * end UID states.
     *
     * @param counts The data array.
     * @param beginUidState The beginning UID state (exclusive).
     * @param endUidState The end UID state.
     * @param beginUidState The beginning UID state (inclusive).
     * @param endUidState The end UID state (inclusive).
     * @param flags The UID flags.
     * @return The sum.
     */
@@ -4284,13 +4284,13 @@ public class AppOpsManager {
     * end UID states.
     *
     * @param counts The data array.
     * @param beginUidState The beginning UID state (inclusive).
     * @param endUidState The end UID state (inclusive).
     * @param flags The UID flags.
     * @param beginUidState The beginning UID state (exclusive).
     * @param endUidState The end UID state.
     * @return The non-negative value or -1.
     */
    private static long findFirstNonNegativeForFlagsInStates(@Nullable LongSparseLongArray counts,
            @OpFlags int flags, @UidState int beginUidState, @UidState int endUidState) {
            @UidState int beginUidState, @UidState int endUidState, @OpFlags int flags) {
        if (counts == null) {
            return -1;
        }
@@ -4316,14 +4316,14 @@ public class AppOpsManager {
     * end UID states.
     *
     * @param counts The data array.
     * @param beginUidState The beginning UID state (inclusive).
     * @param endUidState The end UID state (inclusive).
     * @param flags The UID flags.
     * @param beginUidState The beginning UID state (exclusive).
     * @param endUidState The end UID state.
     * @return The non-negative value or -1.
     */
    private static @Nullable String findFirstNonNullForFlagsInStates(
            @Nullable LongSparseArray<String> counts, @OpFlags int flags,
            @UidState int beginUidState, @UidState int endUidState) {
            @Nullable LongSparseArray<String> counts, @UidState int beginUidState,
            @UidState int endUidState, @OpFlags int flags) {
        if (counts == null) {
            return null;
        }
+4 −0
Original line number Diff line number Diff line
@@ -608,6 +608,10 @@ public class AppOpsService extends IAppOpsService.Stub {

        private void updateProxyState(long key, int proxyUid,
            @Nullable String proxyPackageName) {
            if (proxyUid == Process.INVALID_UID) {
                return;
            }

            if (mProxyUids == null) {
                mProxyUids = new LongSparseLongArray();
            }