public abstract class UserManagerInternal extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
UserManagerInternal.UserRestrictionsListener |
Constructor and Description |
---|
UserManagerInternal() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addUserRestrictionsListener(UserManagerInternal.UserRestrictionsListener listener)
Adds a listener to user restriction changes.
|
abstract UserInfo |
createUserEvenWhenDisallowed(String name,
int flags)
Same as UserManager.createUser(), but bypasses the check for DISALLOW_ADD_USER.
|
abstract Bundle |
getBaseUserRestrictions(int userId)
Returns the "base" user restrictions.
|
abstract boolean |
getUserRestriction(int userId,
String key)
Return a user restriction.
|
abstract boolean |
isUserRunning(int userId)
Return whether the given user is running
|
abstract boolean |
isUserUnlockingOrUnlocked(int userId)
Return whether the given user is running in an
UserState.STATE_RUNNING_UNLOCKING or
UserState.STATE_RUNNING_UNLOCKED state. |
abstract void |
onEphemeralUserStop(int userId)
Called by the activity manager when the ephemeral user goes to background and its removal
starts as a result.
|
abstract void |
removeAllUsers()
Switches to the system user and deletes all other users.
|
abstract void |
removeUserRestrictionsListener(UserManagerInternal.UserRestrictionsListener listener)
|
abstract void |
removeUserState(int userId)
Remove user's running state
|
abstract void |
setBaseUserRestrictionsByDpmsForMigration(int userId,
Bundle baseRestrictions)
Called by
DevicePolicyManagerService for upgrading
from MNC. |
abstract void |
setDeviceManaged(boolean isManaged)
Called by
DevicePolicyManagerService to update
whether the device is managed by device owner. |
abstract void |
setDevicePolicyUserRestrictions(int userId,
Bundle localRestrictions,
Bundle globalRestrictions)
Called by
DevicePolicyManagerService
to set per-user as well as global user restrictions. |
abstract void |
setForceEphemeralUsers(boolean forceEphemeralUsers)
Called by
DevicePolicyManagerService to inform the
user manager whether all users should be created ephemeral. |
abstract void |
setUserIcon(int userId,
Bitmap bitmap)
Called by
DevicePolicyManagerService to omit
restriction check, because DevicePolicyManager must always be able to set user icon
regardless of any restriction. |
abstract void |
setUserManaged(int userId,
boolean isManaged)
Called by
DevicePolicyManagerService to update
whether the user is managed by profile owner. |
abstract void |
setUserState(int userId,
int userState)
Set user's running state
|
public abstract void setDevicePolicyUserRestrictions(int userId, Bundle localRestrictions, Bundle globalRestrictions)
DevicePolicyManagerService
to set per-user as well as global user restrictions.userId
- target user id for the local restrictions.localRestrictions
- per-user restrictions.
Caller must not change it once passed to this method.globalRestrictions
- global restrictions set by DO. Must be null when PO changed user
restrictions, in which case global restrictions won't change.
Caller must not change it once passed to this method.public abstract Bundle getBaseUserRestrictions(int userId)
DevicePolicyManagerService
for upgrading
from MNC.public abstract void setBaseUserRestrictionsByDpmsForMigration(int userId, Bundle baseRestrictions)
DevicePolicyManagerService
for upgrading
from MNC.public abstract boolean getUserRestriction(int userId, String key)
public abstract void addUserRestrictionsListener(UserManagerInternal.UserRestrictionsListener listener)
public abstract void removeUserRestrictionsListener(UserManagerInternal.UserRestrictionsListener listener)
public abstract void setDeviceManaged(boolean isManaged)
DevicePolicyManagerService
to update
whether the device is managed by device owner.public abstract void setUserManaged(int userId, boolean isManaged)
DevicePolicyManagerService
to update
whether the user is managed by profile owner.public abstract void setUserIcon(int userId, Bitmap bitmap)
DevicePolicyManagerService
to omit
restriction check, because DevicePolicyManager must always be able to set user icon
regardless of any restriction.
Also called by UserManagerService
because the logic of setting
the icon is in this method.public abstract void setForceEphemeralUsers(boolean forceEphemeralUsers)
DevicePolicyManagerService
to inform the
user manager whether all users should be created ephemeral.public abstract void removeAllUsers()
Called by the DevicePolicyManagerService
when
the force-ephemeral-users policy is toggled on to make sure there are no pre-existing
non-ephemeral users left.
public abstract void onEphemeralUserStop(int userId)
It marks the ephemeral user as disabled in order to prevent it from being re-entered before its removal finishes.
userId
- the ID of the ephemeral user.public abstract UserInfo createUserEvenWhenDisallowed(String name, int flags)
Called by the DevicePolicyManagerService
when
createAndManageUser is called by the device owner.
public abstract boolean isUserUnlockingOrUnlocked(int userId)
UserState.STATE_RUNNING_UNLOCKING
or
UserState.STATE_RUNNING_UNLOCKED
state.public abstract boolean isUserRunning(int userId)
public abstract void setUserState(int userId, int userState)
public abstract void removeUserState(int userId)