public class UserInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
long |
creationTime |
static Parcelable.Creator<UserInfo> |
CREATOR |
static int |
FLAG_ADMIN
User with administrative privileges.
|
static int |
FLAG_DEMO
User is for demo purposes only and can be removed at any time.
|
static int |
FLAG_DISABLED
Indicates that this user is disabled.
|
static int |
FLAG_EPHEMERAL
Indicates that this user is ephemeral.
|
static int |
FLAG_GUEST
Indicates a guest user that may be transient.
|
static int |
FLAG_INITIALIZED
Indicates that this user has gone through its first-time initialization.
|
static int |
FLAG_MANAGED_PROFILE
Indicates that this user is a profile of another user, for example holding a users
corporate data.
|
static int |
FLAG_MASK_USER_TYPE
16 bits for user type
|
static int |
FLAG_PRIMARY
Primary user.
|
static int |
FLAG_QUIET_MODE |
static int |
FLAG_RESTRICTED
Indicates the user has restrictions in privileges, in addition to those for normal users.
|
int |
flags |
boolean |
guestToRemove |
String |
iconPath |
int |
id |
String |
lastLoggedInFingerprint |
long |
lastLoggedInTime |
String |
name |
static int |
NO_PROFILE_GROUP_ID |
boolean |
partial
User is only partially created.
|
int |
profileGroupId |
int |
restrictedProfileParentId |
int |
serialNumber |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
UserInfo() |
UserInfo(int id,
String name,
int flags) |
UserInfo(int id,
String name,
String iconPath,
int flags) |
UserInfo(UserInfo orig) |
Modifier and Type | Method and Description |
---|---|
boolean |
canHaveProfile() |
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
UserHandle |
getUserHandle() |
boolean |
isAdmin() |
boolean |
isDemo() |
boolean |
isEnabled() |
boolean |
isEphemeral() |
boolean |
isGuest() |
boolean |
isInitialized() |
boolean |
isManagedProfile() |
boolean |
isPrimary() |
boolean |
isQuietModeEnabled() |
boolean |
isRestricted() |
boolean |
isSystemOnly()
Returns true if the user is a split system user.
|
static boolean |
isSystemOnly(int userId)
Returns true if the given user is a split system user.
|
boolean |
supportsSwitchTo() |
boolean |
supportsSwitchToByUser() |
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int parcelableFlags)
Flatten this object in to a Parcel.
|
public static final int FLAG_MASK_USER_TYPE
public static final int FLAG_PRIMARY
public static final int FLAG_ADMIN
public static final int FLAG_GUEST
public static final int FLAG_RESTRICTED
public static final int FLAG_INITIALIZED
public static final int FLAG_MANAGED_PROFILE
public static final int FLAG_DISABLED
Note: If an ephemeral user is disabled, it shouldn't be later re-enabled. Ephemeral users are disabled as their removal is in progress to indicate that they shouldn't be re-entered.
public static final int FLAG_QUIET_MODE
public static final int FLAG_EPHEMERAL
public static final int FLAG_DEMO
public static final int NO_PROFILE_GROUP_ID
public int id
public int serialNumber
public String name
public String iconPath
public int flags
public long creationTime
public long lastLoggedInTime
public String lastLoggedInFingerprint
public int profileGroupId
public int restrictedProfileParentId
public boolean partial
public boolean guestToRemove
public static final Parcelable.Creator<UserInfo> CREATOR
public UserInfo(int id, String name, int flags)
public UserInfo()
public UserInfo(UserInfo orig)
public boolean isPrimary()
public boolean isAdmin()
public boolean isGuest()
public boolean isRestricted()
public boolean isManagedProfile()
public boolean isEnabled()
public boolean isQuietModeEnabled()
public boolean isEphemeral()
public boolean isInitialized()
public boolean isDemo()
public boolean isSystemOnly()
If split system user mode
is not enabled,
the method always returns false.
public static boolean isSystemOnly(int userId)
If split system user mode
is not enabled,
the method always returns false.
public boolean supportsSwitchTo()
public boolean supportsSwitchToByUser()
public boolean canHaveProfile()
public UserHandle getUserHandle()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int parcelableFlags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.parcelableFlags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.