用户信息
public final class UserInfo
extends Object
java.lang.Object |
↳ | com.android.tradefed.device.UserInfo |
类似于平台中的 UserInfo 类。
这类似于 android.content.pm.UserInfo。
围绕一个用户的信息存储数据和基本逻辑。
概括
公共构造函数 |
---|
UserInfo (int userId, String userName, int flag, boolean isRunning) |
UserInfo (int userId, String userName, int flag, boolean isRunning, String userType) |
常数
FLAGS_NOT_SECONDARY
public static final int FLAGS_NOT_SECONDARY
常量值:45 (0x0000002d)
FLAG_EPHEMERAL
public static final int FLAG_EPHEMERAL
常量值:256 (0x00000100)
FLAG_FOR_测试
public static final int FLAG_FOR_TESTING
常量值:32768 (0x00008000)
FLAG_GUEST
public static final int FLAG_GUEST
常量值:4 (0x00000004)
标志_主
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)
标志_配置文件
public static final int FLAG_PROFILE
常量值:4096 (0x00001000)
FLAG_RESTRICTED
public static final int FLAG_RESTRICTED
常量值:8 (0x00000008)
用户系统
public static final int USER_SYSTEM
常量值:0 (0x00000000)
领域
克隆_配置文件_类型
public static final String CLONE_PROFILE_TYPE
公共构造函数
用户信息
public UserInfo (int userId,
String userName,
int flag,
boolean isRunning)
参数 |
---|
userId | int |
userName | String |
flag | int |
isRunning | boolean |
用户信息
public UserInfo (int userId,
String userName,
int flag,
boolean isRunning,
String userType)
参数 |
---|
userId | int |
userName | String |
flag | int |
isRunning | boolean |
userType | String |
公共方法
是克隆配置文件
public boolean isCloneProfile ()
是短暂的
public boolean isEphemeral ()
测试标志
public boolean isFlagForTesting ()
是客人
public boolean isGuest ()
是主
public boolean isMain ()
是托管配置文件
public boolean isManagedProfile ()
是主要的
public boolean isPrimary ()
在跑
public boolean isRunning ()
是次要的
public boolean isSecondary ()
是系统
public boolean isSystem ()
是用户类型
public boolean isUserType (UserInfo.UserType userType,
int currentUserId)
返回此实例是否属于指定类型。
参数 |
---|
userType | UserInfo.UserType |
currentUserId | int |
用户身份
public int userId ()
用户名
public String userName ()