Loading core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -7593,6 +7593,7 @@ package android.os { method @NonNull public static String formatUid(int); method public static int getAppId(int); method public int getIdentifier(); method public static int getUid(@NonNull android.os.UserHandle, int); method @Deprecated public boolean isOwner(); method public boolean isSystem(); method public static int myUserId(); Loading core/java/android/os/UserHandle.java +13 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,19 @@ public final class UserHandle implements Parcelable { } } /** * Returns the uid that is composed from the userHandle and the appId. * * @param userHandle the UserHandle to compose the uid * @param appId the AppId to compose the uid * @return the uid that is composed from the userHandle and the appId * @hide */ @SystemApi public static int getUid(@NonNull UserHandle userHandle, @AppIdInt int appId) { return getUid(userHandle.getIdentifier(), appId); } /** * Returns the app id (or base uid) for a given uid, stripping out the user id from it. * @hide Loading services/core/java/com/android/server/connectivity/PermissionMonitor.java +8 −2 Original line number Diff line number Diff line Loading @@ -265,7 +265,10 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse for (Entry<Integer, Boolean> app : apps.entrySet()) { List<Integer> list = app.getValue() ? system : network; for (int user : users) { list.add(UserHandle.getUid(user, app.getKey())); final UserHandle handle = UserHandle.of(user); if (handle == null) continue; list.add(UserHandle.getUid(handle, app.getKey())); } } try { Loading Loading @@ -550,7 +553,10 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse for (UidRange range : ranges) { for (int userId = range.getStartUser(); userId <= range.getEndUser(); userId++) { for (int appId : appIds) { final int uid = UserHandle.getUid(userId, appId); final UserHandle handle = UserHandle.of(userId); if (handle == null) continue; final int uid = UserHandle.getUid(handle, appId); if (range.contains(uid)) { result.add(uid); } Loading Loading
core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -7593,6 +7593,7 @@ package android.os { method @NonNull public static String formatUid(int); method public static int getAppId(int); method public int getIdentifier(); method public static int getUid(@NonNull android.os.UserHandle, int); method @Deprecated public boolean isOwner(); method public boolean isSystem(); method public static int myUserId(); Loading
core/java/android/os/UserHandle.java +13 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,19 @@ public final class UserHandle implements Parcelable { } } /** * Returns the uid that is composed from the userHandle and the appId. * * @param userHandle the UserHandle to compose the uid * @param appId the AppId to compose the uid * @return the uid that is composed from the userHandle and the appId * @hide */ @SystemApi public static int getUid(@NonNull UserHandle userHandle, @AppIdInt int appId) { return getUid(userHandle.getIdentifier(), appId); } /** * Returns the app id (or base uid) for a given uid, stripping out the user id from it. * @hide Loading
services/core/java/com/android/server/connectivity/PermissionMonitor.java +8 −2 Original line number Diff line number Diff line Loading @@ -265,7 +265,10 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse for (Entry<Integer, Boolean> app : apps.entrySet()) { List<Integer> list = app.getValue() ? system : network; for (int user : users) { list.add(UserHandle.getUid(user, app.getKey())); final UserHandle handle = UserHandle.of(user); if (handle == null) continue; list.add(UserHandle.getUid(handle, app.getKey())); } } try { Loading Loading @@ -550,7 +553,10 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse for (UidRange range : ranges) { for (int userId = range.getStartUser(); userId <= range.getEndUser(); userId++) { for (int appId : appIds) { final int uid = UserHandle.getUid(userId, appId); final UserHandle handle = UserHandle.of(userId); if (handle == null) continue; final int uid = UserHandle.getUid(handle, appId); if (range.contains(uid)) { result.add(uid); } Loading