用戶信息
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_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
公共構造函數
用戶信息
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 |
公共方法
isCloneProfile
public boolean isCloneProfile ()
是短暫的
public boolean isEphemeral ()
是客人
public boolean isGuest ()
是主要的
public boolean isMain ()
isManagedProfile
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 ()