summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-12-13 17:38:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-12-13 17:38:06 +0000
commit19df6fdad15015590ef424c8b2c2fe617ec2e3a4 (patch)
tree57eb4f4e61d0aa576009f7e4b4f147a028c4d4e5 /core/java
parent46fab815a75b6c96047cdf7209702ebef38b87ea (diff)
parentd15b2f727995160190af1448810c3d566b853222 (diff)
Merge changes Idfec610d,I68011fd3
* changes: Allow setting User Restrictions per user type Support custom user types (profiles)
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/UserManager.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 137f53782124..d099629f735d 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -2391,19 +2391,11 @@ public class UserManager {
*/
public @Nullable UserInfo createUser(@Nullable String name, @NonNull String userType,
@UserInfoFlag int flags) {
- UserInfo user = null;
- try {
- user = mService.createUser(name, userType, flags);
- // TODO: Keep this in sync with
- // UserManagerService.LocalService.createUserEvenWhenDisallowed
- if (user != null && !user.isAdmin() && !user.isDemo()) {
- mService.setUserRestriction(DISALLOW_SMS, true, user.id);
- mService.setUserRestriction(DISALLOW_OUTGOING_CALLS, true, user.id);
- }
+ try {
+ return mService.createUser(name, userType, flags);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
- return user;
}
/**
@@ -2748,8 +2740,7 @@ public class UserManager {
/**
* Assigns admin privileges to the user, if such a user exists.
*
- * <p>Requires {@link android.Manifest.permission#MANAGE_USERS} and
- * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permissions.
+ * <p>Note that this does not alter the user's pre-existing user restrictions.
*
* @param userId the id of the user to become admin
* @hide