From 9e70a422525ba790a5d65df317705b23e8e8e8bf Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Thu, 31 Jan 2019 12:36:54 +0900 Subject: [PATCH] Add UserHandle.getAppId to SystemApi This is consistent with other methods in this class, and unbundled system apps such as the network stack need this API to verify their callers regardless of the userid. The method is already marked as TestApi. Test: m Bug: 123655057 Change-Id: I0ecef4abcd850dc641cd70681a56cb038778c04c --- api/system-current.txt | 1 + core/java/android/os/UserHandle.java | 1 + 2 files changed, 2 insertions(+) diff --git a/api/system-current.txt b/api/system-current.txt index e0801b7acbe18..aaef0406e7476 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4303,6 +4303,7 @@ package android.os { } public final class UserHandle implements android.os.Parcelable { + method public static int getAppId(int); method public int getIdentifier(); method @Deprecated public boolean isOwner(); method public boolean isSystem(); diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java index 648c022d86732..de41ce2e08c5e 100644 --- a/core/java/android/os/UserHandle.java +++ b/core/java/android/os/UserHandle.java @@ -226,6 +226,7 @@ public final class UserHandle implements Parcelable { * @hide */ @TestApi + @SystemApi public static @AppIdInt int getAppId(int uid) { return uid % PER_USER_RANGE; }