Data usage API: any uid is accessible to system apps running in any user

This CL mostly affects Settings app as it can run in a user different
than UserHandle.OWNER. Since it is a system app it should have access
to all uid's data usage, regardless of which user it is currently running
in.

Bug: 19967498
Change-Id: I4a7787134d998457f7e2a1029183d44d9584083e
This commit is contained in:
Zoltan Szatmary-Ban
2015-03-31 18:09:20 +01:00
parent 6f2ba5ec43
commit fec3d1ff1c

View File

@@ -571,7 +571,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
} }
private static boolean isAccessibleToUser(int uid, int callerUid) { private static boolean isAccessibleToUser(int uid, int callerUid) {
return callerUid == android.os.Process.SYSTEM_UID || return UserHandle.getAppId(callerUid) == android.os.Process.SYSTEM_UID ||
uid == android.os.Process.SYSTEM_UID || uid == UID_REMOVED || uid == UID_TETHERING uid == android.os.Process.SYSTEM_UID || uid == UID_REMOVED || uid == UID_TETHERING
|| UserHandle.getUserId(uid) == UserHandle.getUserId(callerUid); || UserHandle.getUserId(uid) == UserHandle.getUserId(callerUid);
} }