From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Wed, 17 Aug 2022 10:12:42 +0300 Subject: [PATCH] mark UserHandle#get{Uid, UserId} as module SystemApi Needed by packages_modules_Connectivity -> "enforce INTERNET permission per-uid instead of per-appId". --- core/api/module-lib-current.txt | 5 +++++ core/java/android/os/UserHandle.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 190fe9f31f3c..3156a91765ac 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -467,6 +467,11 @@ package android.os { field public static final long TRACE_TAG_NETWORK = 2097152L; // 0x200000L } + public final class UserHandle implements android.os.Parcelable { + method public static int getUid(int, int); + method public static int getUserId(int); + } + } package android.os.storage { diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java index 0644ef1c788f..2804035aef7b 100644 --- a/core/java/android/os/UserHandle.java +++ b/core/java/android/os/UserHandle.java @@ -281,6 +281,7 @@ public final class UserHandle implements Parcelable { * Returns the user id for a given uid. * @hide */ + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @UnsupportedAppUsage @TestApi public static @UserIdInt int getUserId(int uid) { @@ -371,6 +372,7 @@ public final class UserHandle implements Parcelable { * Returns the uid that is composed from the userId and the appId. * @hide */ + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @UnsupportedAppUsage @TestApi public static int getUid(@UserIdInt int userId, @AppIdInt int appId) {