UserInfo

public final class UserInfo
extends Object

java.lang.Object 中
   ↳ com.android.tradefed.device.UserInfo


类似于平台中的 UserInfo 类。

其作用与 android.content.pm.UserInfo 类似。

围绕一个用户的信息存储数据和基本逻辑。

摘要

常量

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

字段

public static final String CLONE_PROFILE_TYPE

public static final String COMMUNAL_PROFILE_TYPE

public static final String PRIVATE_PROFILE_TYPE

公共构造函数

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

公共方法

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)

返回此实例是否属于指定类型。

int userId()
String userName()

常量

FLAGS_NOT_SECONDARY

public static final int FLAGS_NOT_SECONDARY

常量值: 45 (0x0000002d)

FLAG_EPHEMERAL

public static final int FLAG_EPHEMERAL

常量值: 256 (0x00000100)

FLAG_FOR_TESTING

public static final int FLAG_FOR_TESTING

常量值: 32,768,000 (0x00008000)

FLAG_GUEST

public static final int FLAG_GUEST

常量值: 4 (0x00000004)

FLAG_MAIN

public static final int FLAG_MAIN

常量值: 16384 (0x00004000)

FLAG_MANAGED_PROFILE

public static final int FLAG_MANAGED_PROFILE

常量值: 32 个 (0x00000020)

FLAG_PRIMARY

public static final int FLAG_PRIMARY

常量值: 1 次 (0x00000001)

FLAG_PROFILE

public static final int FLAG_PROFILE

常量值: 4096 (0x00001000)

FLAG_RESTRICTED

public static final int FLAG_RESTRICTED

常量值: 8 (0x00000008)

USER_SYSTEM

public static final int USER_SYSTEM

常量值: 0 (0x00000000)

字段

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

公共构造函数

UserInfo

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

参数
userId int

userName String

flag int

isRunning boolean

UserInfo

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

参数
userId int

userName String

flag int

isRunning boolean

userType String

公共方法

标志

public int flag ()

返回
int

isCloneProfile

public boolean isCloneProfile ()

返回
boolean

isCommunalProfile

public boolean isCommunalProfile ()

返回
boolean

是临时

public boolean isEphemeral ()

返回
boolean

isFlagForTesting

public boolean isFlagForTesting ()

返回
boolean

isGuest

public boolean isGuest ()

返回
boolean

isMain

public boolean isMain ()

返回
boolean

isManagedProfile

public boolean isManagedProfile ()

返回
boolean

isPrimary

public boolean isPrimary ()

返回
boolean

isPrivateProfile

public boolean isPrivateProfile ()

返回
boolean

正在运行

public boolean isRunning ()

返回
boolean

是次要的

public boolean isSecondary ()

返回
boolean

isSystem

public boolean isSystem ()

返回
boolean

isUserType

public boolean isUserType (UserInfo.UserType userType, 
                int currentUserId)

返回此实例是否属于指定类型。

参数
userType UserInfo.UserType

currentUserId int

返回
boolean

userId

public int userId ()

返回
int

用户名

public String userName ()

返回
String