UserInfo
public
final
class
UserInfo
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.UserInfo |
Similar to UserInfo class from platform.
This is intended to be similar to android.content.pm.UserInfo.
Stores data and basic logic around the information for one user.
Summary
Constants | |
---|---|
int |
FLAGS_NOT_SECONDARY
|
int |
FLAG_EPHEMERAL
|
int |
FLAG_FOR_TESTING
|
int |
FLAG_GUEST
|
int |
FLAG_MAIN
|
int |
FLAG_MANAGED_PROFILE
|
int |
FLAG_PRIMARY
|
int |
FLAG_PROFILE
|
int |
FLAG_RESTRICTED
|
int |
USER_SYSTEM
|
Fields | |
---|---|
public
static
final
String |
CLONE_PROFILE_TYPE
|
public
static
final
String |
COMMUNAL_PROFILE_TYPE
|
public
static
final
String |
PRIVATE_PROFILE_TYPE
|
Public constructors | |
---|---|
UserInfo(int userId, String userName, int flag, boolean isRunning)
|
|
UserInfo(int userId, String userName, int flag, boolean isRunning, String userType)
|
Public methods | |
---|---|
int
|
flag()
|
boolean
|
isCloneProfile()
|
boolean
|
isCommunalProfile()
|
boolean
|
isEphemeral()
|
boolean
|
isFlagForTesting()
|
boolean
|
isGuest()
|
boolean
|
isMain()
|
boolean
|
isManagedProfile()
|
boolean
|
isPrimary()
|
boolean
|
isPrivateProfile()
|
boolean
|
isRunning()
|
boolean
|
isSecondary()
|
boolean
|
isSystem()
|
boolean
|
isUserType(UserInfo.UserType userType, int currentUserId)
Return whether this instance is of the specified type. |
int
|
userId()
|
String
|
userName()
|
Constants
FLAGS_NOT_SECONDARY
public static final int FLAGS_NOT_SECONDARY
Constant Value: 45 (0x0000002d)
FLAG_EPHEMERAL
public static final int FLAG_EPHEMERAL
Constant Value: 256 (0x00000100)
FLAG_FOR_TESTING
public static final int FLAG_FOR_TESTING
Constant Value: 32768 (0x00008000)
FLAG_GUEST
public static final int FLAG_GUEST
Constant Value: 4 (0x00000004)
FLAG_MAIN
public static final int FLAG_MAIN
Constant Value: 16384 (0x00004000)
FLAG_MANAGED_PROFILE
public static final int FLAG_MANAGED_PROFILE
Constant Value: 32 (0x00000020)
FLAG_PRIMARY
public static final int FLAG_PRIMARY
Constant Value: 1 (0x00000001)
FLAG_PROFILE
public static final int FLAG_PROFILE
Constant Value: 4096 (0x00001000)
FLAG_RESTRICTED
public static final int FLAG_RESTRICTED
Constant Value: 8 (0x00000008)
USER_SYSTEM
public static final int USER_SYSTEM
Constant Value: 0 (0x00000000)
Fields
CLONE_PROFILE_TYPE
public static final String CLONE_PROFILE_TYPE
COMMUNAL_PROFILE_TYPE
public static final String COMMUNAL_PROFILE_TYPE
PRIVATE_PROFILE_TYPE
public static final String PRIVATE_PROFILE_TYPE
Public constructors
UserInfo
public UserInfo (int userId, String userName, int flag, boolean isRunning)
Parameters | |
---|---|
userId |
int |
userName |
String |
flag |
int |
isRunning |
boolean |
UserInfo
public UserInfo (int userId, String userName, int flag, boolean isRunning, String userType)
Parameters | |
---|---|
userId |
int |
userName |
String |
flag |
int |
isRunning |
boolean |
userType |
String |
Public methods
flag
public int flag ()
Returns | |
---|---|
int |
isCloneProfile
public boolean isCloneProfile ()
Returns | |
---|---|
boolean |
isCommunalProfile
public boolean isCommunalProfile ()
Returns | |
---|---|
boolean |
isEphemeral
public boolean isEphemeral ()
Returns | |
---|---|
boolean |
isFlagForTesting
public boolean isFlagForTesting ()
Returns | |
---|---|
boolean |
isGuest
public boolean isGuest ()
Returns | |
---|---|
boolean |
isMain
public boolean isMain ()
Returns | |
---|---|
boolean |
isManagedProfile
public boolean isManagedProfile ()
Returns | |
---|---|
boolean |
isPrimary
public boolean isPrimary ()
Returns | |
---|---|
boolean |
isPrivateProfile
public boolean isPrivateProfile ()
Returns | |
---|---|
boolean |
isRunning
public boolean isRunning ()
Returns | |
---|---|
boolean |
isSecondary
public boolean isSecondary ()
Returns | |
---|---|
boolean |
isSystem
public boolean isSystem ()
Returns | |
---|---|
boolean |
isUserType
public boolean isUserType (UserInfo.UserType userType, int currentUserId)
Return whether this instance is of the specified type.
Parameters | |
---|---|
userType |
UserInfo.UserType |
currentUserId |
int |
Returns | |
---|---|
boolean |
userId
public int userId ()
Returns | |
---|---|
int |
userName
public String userName ()
Returns | |
---|---|
String |