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

Nested classes

enum UserInfo.UserType

Supported variants of a user's type in external APIs. 

Constants

int FLAGS_NOT_SECONDARY

int FLAG_GUEST

int FLAG_MANAGED_PROFILE

int FLAG_PRIMARY

int FLAG_RESTRICTED

int USER_SYSTEM

Public constructors

UserInfo(int userId, String userName, int flag, boolean isRunning)

Public methods

int flag()
boolean isGuest()
boolean isPrimary()
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_GUEST

public static final int FLAG_GUEST

Constant Value: 4 (0x00000004)

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_RESTRICTED

public static final int FLAG_RESTRICTED

Constant Value: 8 (0x00000008)

USER_SYSTEM

public static final int USER_SYSTEM

Constant Value: 0 (0x00000000)

Public constructors

UserInfo

public UserInfo (int userId, 
                String userName, 
                int flag, 
                boolean isRunning)

Parameters
userId int

userName String

flag int

isRunning boolean

Public methods

flag

public int flag ()

Returns
int

isGuest

public boolean isGuest ()

Returns
boolean

isPrimary

public boolean isPrimary ()

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