From: Remi NGUYEN VAN Date: Wed, 23 Jan 2019 02:06:18 +0000 (+0900) Subject: Add UserHandle constants to SystemApi X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6c7877b7bb1cc8c5425eede2d462285f1567c14c;p=android-x86%2Fframeworks-base.git Add UserHandle constants to SystemApi The affected constants are already SystemApi in internal. Bug: 112869080 Test: m Change-Id: Iacefdefa59346eaebd8b92743fe8710845edcc29 Merged-In: I261dfcc5cfdfc76bda5d70181785e11c2715a558 --- diff --git a/api/system-current.txt b/api/system-current.txt index 7cade61d9ad5..40070b51068e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4137,6 +4137,9 @@ package android.os { method public boolean isSystem(); method public static int myUserId(); method public static android.os.UserHandle of(int); + field public static final android.os.UserHandle ALL; + field public static final android.os.UserHandle CURRENT; + field public static final android.os.UserHandle SYSTEM; } public class UserManager { diff --git a/api/test-current.txt b/api/test-current.txt index 1c00cc4ae70c..ad78c53e580a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -1053,6 +1053,8 @@ package android.os { public final class UserHandle implements android.os.Parcelable { method public static int getAppId(int); method public int getIdentifier(); + field public static final android.os.UserHandle ALL; + field public static final android.os.UserHandle CURRENT; field public static final android.os.UserHandle SYSTEM; } diff --git a/config/hiddenapi-greylist.txt b/config/hiddenapi-greylist.txt index cfcb58d396cf..a140db0fd9f6 100644 --- a/config/hiddenapi-greylist.txt +++ b/config/hiddenapi-greylist.txt @@ -1120,8 +1120,6 @@ Landroid/os/UserHandle;->AID_APP_START:I Landroid/os/UserHandle;->AID_CACHE_GID_START:I Landroid/os/UserHandle;->AID_ROOT:I Landroid/os/UserHandle;->AID_SHARED_GID_START:I -Landroid/os/UserHandle;->ALL:Landroid/os/UserHandle; -Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle; Landroid/os/UserHandle;->CURRENT_OR_SELF:Landroid/os/UserHandle; Landroid/os/UserHandle;->ERR_GID:I Landroid/os/UserHandle;->getAppIdFromSharedAppGid(I)I diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java index 4d4f31de0077..648c022d8673 100644 --- a/core/java/android/os/UserHandle.java +++ b/core/java/android/os/UserHandle.java @@ -38,12 +38,16 @@ public final class UserHandle implements Parcelable { public static final @UserIdInt int USER_ALL = -1; /** @hide A user handle to indicate all users on the device */ + @SystemApi + @TestApi public static final UserHandle ALL = new UserHandle(USER_ALL); /** @hide A user id to indicate the currently active user */ public static final @UserIdInt int USER_CURRENT = -2; /** @hide A user handle to indicate the current user of the device */ + @SystemApi + @TestApi public static final UserHandle CURRENT = new UserHandle(USER_CURRENT); /** @hide A user id to indicate that we would like to send to the current @@ -82,6 +86,7 @@ public final class UserHandle implements Parcelable { public static final int USER_SERIAL_SYSTEM = 0; /** @hide A user handle to indicate the "system" user of the device */ + @SystemApi @TestApi public static final UserHandle SYSTEM = new UserHandle(USER_SYSTEM);