Tương tự với lớp UserInfo từ nền tảng.
Điều này nhằm mục đích tương tự như android.content.pm.UserInfo.
Lưu trữ dữ liệu và logic cơ bản xung quanh thông tin cho một người dùng.
Các lớp lồng nhau |
---|
enum | UserInfo.UserType Các biến thể được hỗ trợ của loại người dùng trong các API bên ngoài. |
Các nhà xây dựng công cộng |
---|
UserInfo (int userId, String userName, int flag, boolean isRunning) |
Hằng số
FLAGS_NOT_SECONDARY
public static final int FLAGS_NOT_SECONDARY
Giá trị không đổi: 45 (0x0000002d)
FLAG_EPHEMERAL
public static final int FLAG_EPHEMERAL
Giá trị không đổi: 256 (0x00000100)
FLAG_GUEST
public static final int FLAG_GUEST
Giá trị không đổi: 4 (0x00000004)
FLAG_MANAGED_PROFILE
public static final int FLAG_MANAGED_PROFILE
Giá trị không đổi: 32 (0x00000020)
FLAG_PRIMARY
public static final int FLAG_PRIMARY
Giá trị không đổi: 1 (0x00000001)
FLAG_RESTRICTED
public static final int FLAG_RESTRICTED
Giá trị không đổi: 8 (0x00000008)
USER_SYSTEM
public static final int USER_SYSTEM
Giá trị không đổi: 0 (0x00000000)
Các nhà xây dựng công cộng
Thông tin người dùng
public UserInfo (int userId,
String userName,
int flag,
boolean isRunning)
Thông số |
---|
userId | int |
userName | String |
flag | int |
isRunning | boolean |
Phương pháp công khai
isEphemeral
public boolean isEphemeral ()
isGuest
public boolean isGuest ()
isManagedProfile
public boolean isManagedProfile ()
isPrimary
public boolean isPrimary ()
đang chạy
public boolean isRunning ()
isSecondary
public boolean isSecondary ()
isSystem
public boolean isSystem ()
isUserType
public boolean isUserType (UserInfo.UserType userType,
int currentUserId)
Trả lại xem trường hợp này có thuộc loại được chỉ định hay không.
Thông số |
---|
userType | UserInfo.UserType |
currentUserId | int |
tên người dùng
public int userId ()
tên tài khoản
public String userName ()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-08-15 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Thiếu thông tin tôi cần"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Quá phức tạp/quá nhiều bước"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Đã lỗi thời"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Vấn đề về bản dịch"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Vấn đề về mẫu/mã"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Khác"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Dễ hiểu"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Giúp tôi giải quyết được vấn đề"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Khác"
}]