Merge "Fix dumpsys for appops proxy field" into qt-qpr1-dev
am: 30c48bb54a
Change-Id: Id521633187bce10f41dce10ba4198bc42e9f363c
This commit is contained in:
@@ -2587,7 +2587,7 @@ public class AppOpsManager {
|
|||||||
* @return The proxy UID.
|
* @return The proxy UID.
|
||||||
*/
|
*/
|
||||||
public int getProxyUid() {
|
public int getProxyUid() {
|
||||||
return (int) findFirstNonNegativeForFlagsInStates(mDurations,
|
return (int) findFirstNonNegativeForFlagsInStates(mProxyUids,
|
||||||
MAX_PRIORITY_UID_STATE, MIN_PRIORITY_UID_STATE, OP_FLAGS_ALL);
|
MAX_PRIORITY_UID_STATE, MIN_PRIORITY_UID_STATE, OP_FLAGS_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2609,7 +2609,7 @@ public class AppOpsManager {
|
|||||||
* @return The proxy UID.
|
* @return The proxy UID.
|
||||||
*/
|
*/
|
||||||
public int getProxyUid(@UidState int uidState, @OpFlags int flags) {
|
public int getProxyUid(@UidState int uidState, @OpFlags int flags) {
|
||||||
return (int) findFirstNonNegativeForFlagsInStates(mDurations,
|
return (int) findFirstNonNegativeForFlagsInStates(mProxyUids,
|
||||||
uidState, uidState, flags);
|
uidState, uidState, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4170,8 +4170,8 @@ public class AppOpsManager {
|
|||||||
* end UID states.
|
* end UID states.
|
||||||
*
|
*
|
||||||
* @param counts The data array.
|
* @param counts The data array.
|
||||||
* @param beginUidState The beginning UID state (exclusive).
|
* @param beginUidState The beginning UID state (inclusive).
|
||||||
* @param endUidState The end UID state.
|
* @param endUidState The end UID state (inclusive).
|
||||||
* @param flags The UID flags.
|
* @param flags The UID flags.
|
||||||
* @return The sum.
|
* @return The sum.
|
||||||
*/
|
*/
|
||||||
@@ -4200,13 +4200,13 @@ public class AppOpsManager {
|
|||||||
* end UID states.
|
* end UID states.
|
||||||
*
|
*
|
||||||
* @param counts The data array.
|
* @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 flags The UID flags.
|
||||||
* @param beginUidState The beginning UID state (exclusive).
|
|
||||||
* @param endUidState The end UID state.
|
|
||||||
* @return The non-negative value or -1.
|
* @return The non-negative value or -1.
|
||||||
*/
|
*/
|
||||||
private static long findFirstNonNegativeForFlagsInStates(@Nullable LongSparseLongArray counts,
|
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) {
|
if (counts == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -4232,14 +4232,14 @@ public class AppOpsManager {
|
|||||||
* end UID states.
|
* end UID states.
|
||||||
*
|
*
|
||||||
* @param counts The data array.
|
* @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 flags The UID flags.
|
||||||
* @param beginUidState The beginning UID state (exclusive).
|
|
||||||
* @param endUidState The end UID state.
|
|
||||||
* @return The non-negative value or -1.
|
* @return The non-negative value or -1.
|
||||||
*/
|
*/
|
||||||
private static @Nullable String findFirstNonNullForFlagsInStates(
|
private static @Nullable String findFirstNonNullForFlagsInStates(
|
||||||
@Nullable LongSparseArray<String> counts, @OpFlags int flags,
|
@Nullable LongSparseArray<String> counts, @UidState int beginUidState,
|
||||||
@UidState int beginUidState, @UidState int endUidState) {
|
@UidState int endUidState, @OpFlags int flags) {
|
||||||
if (counts == null) {
|
if (counts == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -510,6 +510,10 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
|
|
||||||
private void updateProxyState(long key, int proxyUid,
|
private void updateProxyState(long key, int proxyUid,
|
||||||
@Nullable String proxyPackageName) {
|
@Nullable String proxyPackageName) {
|
||||||
|
if (proxyUid == Process.INVALID_UID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mProxyUids == null) {
|
if (mProxyUids == null) {
|
||||||
mProxyUids = new LongSparseLongArray();
|
mProxyUids = new LongSparseLongArray();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user