diff options
| author | Makoto Onuki <omakoto@google.com> | 2017-03-02 16:38:45 -0800 |
|---|---|---|
| committer | Makoto Onuki <omakoto@google.com> | 2017-03-02 16:38:45 -0800 |
| commit | 5eef50d86bbef65178873303cc03e9ff492c9ba2 (patch) | |
| tree | 38aca7f6461de7147992ab24f46608aeb0f96012 /core/java | |
| parent | d1c7bb771c76bbd24d070821b0734be9a68c3daa (diff) | |
Mention the relaxed security check on UM.isUserRunningOrStopping().
Bug: 35801468
Test: Javadoc only, make.
Change-Id: Iff44217b63e6ce8d354665719a84c37f8c2e569a
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/os/UserManager.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 13a495e57d3b..a638cd43aba9 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -1057,12 +1057,17 @@ public class UserManager { * allowed to run code through scheduled alarms, receiving broadcasts, * etc. A started user may be either the current foreground user or a * background user; the result here does not distinguish between the two. - * <p>Requires {@code android.permission.MANAGE_USERS} or - * {@code android.permission.INTERACT_ACROSS_USERS}, otherwise specified {@link UserHandle user} - * must be the calling user or a managed profile associated with it. + * + * <p>Note prior to Android Nougat MR1 (SDK version <= 24; + * {@link android.os.Build.VERSION_CODES#N), this API required a system permission + * in order to check other profile's status. + * Since Android Nougat MR1 (SDK version >= 25; + * {@link android.os.Build.VERSION_CODES#N_MR1)), the restriction has been relaxed, and now + * it'll accept any {@link UserHandle} within the same profile group as the caller. * * @param user The user to retrieve the running state for. */ + // Note this requires either INTERACT_ACROSS_USERS or MANAGE_USERS. public boolean isUserRunning(UserHandle user) { return isUserRunning(user.getIdentifier()); } @@ -1081,12 +1086,17 @@ public class UserManager { * This is like {@link #isUserRunning(UserHandle)}, but will also return * true if the user had been running but is in the process of being stopped * (but is not yet fully stopped, and still running some code). - * <p>Requires {@code android.permission.MANAGE_USERS} or - * {@code android.permission.INTERACT_ACROSS_USERS}, otherwise specified {@link UserHandle user} - * must be the calling user or a managed profile associated with it. + * + * <p>Note prior to Android Nougat MR1 (SDK version <= 24; + * {@link android.os.Build.VERSION_CODES#N), this API required a system permission + * in order to check other profile's status. + * Since Android Nougat MR1 (SDK version >= 25; + * {@link android.os.Build.VERSION_CODES#N_MR1)), the restriction has been relaxed, and now + * it'll accept any {@link UserHandle} within the same profile group as the caller. * * @param user The user to retrieve the running state for. */ + // Note this requires either INTERACT_ACROSS_USERS or MANAGE_USERS. public boolean isUserRunningOrStopping(UserHandle user) { try { // TODO: reconcile stopped vs stopping? |
