java.lang.Object | |
↳ | android.os.UserManager |
Manages users and user details on a multi-user system.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DISALLOW_CONFIG_BLUETOOTH | Key for user restrictions. | |||||||||
String | DISALLOW_CONFIG_CREDENTIALS | Key for user restrictions. | |||||||||
String | DISALLOW_CONFIG_WIFI | Key for user restrictions. | |||||||||
String | DISALLOW_INSTALL_APPS | Key for user restrictions. | |||||||||
String | DISALLOW_INSTALL_UNKNOWN_SOURCES | Key for user restrictions. | |||||||||
String | DISALLOW_MODIFY_ACCOUNTS | Key for user restrictions. | |||||||||
String | DISALLOW_REMOVE_USER | Key for user restrictions. | |||||||||
String | DISALLOW_SHARE_LOCATION | Key for user restrictions. | |||||||||
String | DISALLOW_UNINSTALL_APPS | Key for user restrictions. | |||||||||
String | DISALLOW_USB_FILE_TRANSFER | Key for user restrictions. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Returns a Bundle containing any saved application restrictions for this user, for the
given package name.
|
||||||||||
|
Return the serial number for a user.
|
||||||||||
|
Return the number of users currently created on the device.
|
||||||||||
|
Return the user associated with a serial number previously
returned by
getSerialNumberForUser(UserHandle)
.
|
||||||||||
|
Returns the user name of the user making this call.
|
||||||||||
|
Returns the user-wide restrictions imposed on this user.
|
||||||||||
|
Returns the user-wide restrictions imposed on the user specified by
userHandle
.
|
||||||||||
|
Used to determine whether the user making this call is subject to
teleportations.
|
||||||||||
|
Return whether the given user is actively running.
|
||||||||||
|
Return whether the given user is actively running
or
stopping.
|
||||||||||
|
Sets a new challenge PIN for restrictions.
|
||||||||||
|
Sets the value of a specific restriction.
|
||||||||||
|
Sets all the user-wide restrictions for this user.
|
||||||||||
|
Sets all the user-wide restrictions for the specified user.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Key for user restrictions. Specifies if a user is disallowed from configuring bluetooth.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from configuring user
credentials. The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from changing Wi-Fi
access points.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from installing applications.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from enabling the
"Unknown Sources" setting, that allows installation of apps from unknown sources.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from adding and removing
accounts.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from removing users.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from toggling location sharing.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from uninstalling applications.
The default value is
false
.
Type: Boolean
Key for user restrictions. Specifies if a user is disallowed from transferring files over
USB. The default value is
false
.
Type: Boolean
Returns a Bundle containing any saved application restrictions for this user, for the given package name. Only an application with this package name can call this method.
packageName | the package name of the calling application |
---|
Return the serial number for a user. This is a device-unique number assigned to that user; if the user is deleted and then a new user created, the new users will not be given the same serial number.
user | The user whose serial number is to be retrieved. |
---|
Return the number of users currently created on the device.
Return the user associated with a serial number previously
returned by
getSerialNumberForUser(UserHandle)
.
serialNumber | The serial number of the user that is being retrieved. |
---|
Returns the user name of the user making this call. This call is only available to applications on the system image; it requires the MANAGE_USERS permission.
Returns the user-wide restrictions imposed on this user.
Returns the user-wide restrictions imposed on the user specified by
userHandle
.
userHandle | the UserHandle of the user for whom to retrieve the restrictions. |
---|
Used to determine whether the user making this call is subject to teleportations.
Return whether the given user is actively running. This means that the user is in the "started" state, not "stopped" -- it is currently 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.
user | The user to retrieve the running state for. |
---|
Return whether the given user is actively running
or
stopping.
This is like
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).
user | The user to retrieve the running state for. |
---|
Sets a new challenge PIN for restrictions. This is only for use by pre-installed apps and requires the MANAGE_USERS permission.
newPin | the PIN to use for challenge dialogs. |
---|
Sets the value of a specific restriction. Requires the MANAGE_USERS permission.
key | the key of the restriction |
---|---|
value | the value for the restriction |
Sets all the user-wide restrictions for this user. Requires the MANAGE_USERS permission.
restrictions | the Bundle containing all the restrictions. |
---|
Sets all the user-wide restrictions for the specified user. Requires the MANAGE_USERS permission.
restrictions | the Bundle containing all the restrictions. |
---|---|
userHandle | the UserHandle of the user for whom to set the restrictions. |