summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Bookatz <bookatz@google.com> 2023-06-06 13:26:15 -0700
committer Adam Bookatz <bookatz@google.com> 2023-06-06 13:38:53 -0700
commit954d76ec16e3ebbacbf5af5de313b66747723ee7 (patch)
treed2055cd60c0990447086e3855a17e8e4db47cc54
parentb9f9bc6d5bdea0ca5bcc021c04446cc83a30eed9 (diff)
Update isRestrictedProfile javadoc for QUERY_USERS
isRestrictedProfile only began allowing QUERY_USERS starting in Android V; prior to that, it didn't. So this is mentioned in the javadoc. Bug: 274673121 Test: N/A. It's just documentation. Change-Id: Ic68594d6987cc8796477394f2e2df3411c78a1dd
-rw-r--r--core/java/android/os/UserManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 01a886434376..cfe0da512ed8 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -2869,6 +2869,12 @@ public class UserManager {
* Used to check if the context user is a restricted profile. Restricted profiles
* may have a reduced number of available apps, app restrictions, and account restrictions.
*
+ * <p>The caller must be in the same profile group as the context user or else hold
+ * <li>{@link android.Manifest.permission#MANAGE_USERS},
+ * <li>or {@link android.Manifest.permission#CREATE_USERS},
+ * <li>or, for devices after {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE},
+ * {@link android.Manifest.permission#QUERY_USERS}.
+ *
* @return whether the context user is a restricted profile.
* @hide
*/
@@ -2892,6 +2898,12 @@ public class UserManager {
* Check if a user is a restricted profile. Restricted profiles may have a reduced number of
* available apps, app restrictions, and account restrictions.
*
+ * <p>Requires
+ * <li>{@link android.Manifest.permission#MANAGE_USERS},
+ * <li>or {@link android.Manifest.permission#CREATE_USERS},
+ * <li>or, for devices after {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE},
+ * {@link android.Manifest.permission#QUERY_USERS}.
+ *
* @param user the user to check
* @return whether the user is a restricted profile.
* @hide