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

Commit 30c48bb5 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Android (Google) Code Review
Browse files

Merge "Fix dumpsys for appops proxy field" into qt-qpr1-dev

parents ccb43000 4052d36f
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -2587,7 +2587,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);
        }

@@ -2609,7 +2609,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);
        }

@@ -4169,8 +4169,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.
     */
@@ -4199,13 +4199,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;
        }
@@ -4231,14 +4231,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
@@ -510,6 +510,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();
            }