Lines Matching defs:UserData
220 private static class UserData {
244 private final SparseArray<UserData> mUsers = new SparseArray<>();
492 UserData userToUpdate = null;
495 final UserData userData = mUsers.get(userId);
496 if (userData == null) {
500 String currentAccount = userData.account;
502 userData.account = accountName;
503 userToUpdate = userData;
897 final UserData userData = mUsers.get(userId);
899 if (userData != null && userData.info.partial && !mRemovingUserIds.get(userId)) {
903 return userData != null ? userData.info : null;
906 private UserData getUserDataLU(int userId) {
907 final UserData userData = mUsers.get(userId);
909 if (userData != null && userData.info.partial && !mRemovingUserIds.get(userId)) {
912 return userData;
921 final UserData userData = mUsers.get(userId);
922 return userData != null ? userData.info : null;
927 * Obtains {@link #mUsersLock} and return UserData from mUsers.
930 private UserData getUserDataNoChecks(int userId) {
946 UserData userData = getUserDataNoChecks(userId);
947 if (userData == null || userData.info.partial) {
951 if (name != null && !name.equals(userData.info.name)) {
952 userData.info.name = name;
953 writeUserLP(userData);
1018 UserData userData;
1020 userData = mUsers.get(userId);
1021 if (userData == null || userData.info.partial) {
1025 if ((userData.info.flags & UserInfo.FLAG_INITIALIZED) == 0) {
1026 userData.info.flags |= UserInfo.FLAG_INITIALIZED;
1031 scheduleWriteUser(userData);
1650 UserData userData = readUserLP(Integer.parseInt(id));
1652 if (userData != null) {
1654 mUsers.put(userData.info.id, userData);
1656 || mNextSerialNumber <= userData.info.id) {
1657 mNextSerialNumber = userData.info.id + 1;
1706 UserData userData = getUserDataNoChecks(UserHandle.USER_SYSTEM);
1707 if ("Primary".equals(userData.info.name)) {
1708 userData.info.name =
1710 scheduleWriteUser(userData);
1717 UserData userData = getUserDataNoChecks(UserHandle.USER_SYSTEM);
1718 if ((userData.info.flags & UserInfo.FLAG_INITIALIZED) == 0) {
1719 userData.info.flags |= UserInfo.FLAG_INITIALIZED;
1720 scheduleWriteUser(userData);
1739 UserData userData = mUsers.valueAt(i);
1741 if (!splitSystemUser && userData.info.isRestricted()
1742 && (userData.info.restrictedProfileParentId
1744 userData.info.restrictedProfileParentId = UserHandle.USER_SYSTEM;
1745 scheduleWriteUser(userData);
1773 UserData userData = new UserData();
1774 userData.info = system;
1776 mUsers.put(system.id, userData);
1789 writeUserLP(userData);
1797 private void scheduleWriteUser(UserData UserData) {
1803 if (!mHandler.hasMessages(WRITE_USER_MSG, UserData)) {
1804 Message msg = mHandler.obtainMessage(WRITE_USER_MSG, UserData);
1816 private void writeUserLP(UserData userData) {
1818 debug("writeUserLP " + userData);
1821 AtomicFile userFile = new AtomicFile(new File(mUsersDir, userData.info.id + XML_SUFFIX));
1832 final UserInfo userInfo = userData.info;
1862 if (userData.persistSeedData) {
1863 if (userData.seedAccountName != null) {
1864 serializer.attribute(null, ATTR_SEED_ACCOUNT_NAME, userData.seedAccountName);
1866 if (userData.seedAccountType != null) {
1867 serializer.attribute(null, ATTR_SEED_ACCOUNT_TYPE, userData.seedAccountType);
1883 if (userData.account != null) {
1885 serializer.text(userData.account);
1889 if (userData.persistSeedData && userData.seedAccountOptions != null) {
1891 userData.seedAccountOptions.saveToXml(serializer);
1899 Slog.e(LOG_TAG, "Error writing user info " + userData.info.id, ioe);
1969 private UserData readUserLP(int id) {
2078 // Create the UserData object that's internal to this class
2079 UserData userData = new UserData();
2080 userData.info = userInfo;
2081 userData.account = account;
2082 userData.seedAccountName = seedAccountName;
2083 userData.seedAccountType = seedAccountType;
2084 userData.persistSeedData = persistSeedData;
2085 userData.seedAccountOptions = seedAccountOptions;
2091 return userData;
2167 UserData userData;
2171 UserData parent = null;
2244 userData = new UserData();
2245 userData.info = userInfo;
2246 mUsers.put(userId, userData);
2248 writeUserLP(userData);
2273 writeUserLP(userData);
2355 final UserData userData;
2358 userData = mUsers.get(userHandle);
2359 if (userHandle == 0 || userData == null || mRemovingUserIds.get(userHandle)) {
2363 if (!userData.info.isGuest()) {
2371 userData.info.guestToRemove = true;
2374 userData.info.flags |= UserInfo.FLAG_DISABLED;
2375 writeUserLP(userData);
2399 final UserData userData;
2407 userData = mUsers.get(userHandle);
2408 if (userHandle == 0 || userData == null || mRemovingUserIds.get(userHandle)) {
2426 userData.info.partial = true;
2429 userData.info.flags |= UserInfo.FLAG_DISABLED;
2430 writeUserLP(userData);
2433 if (userData.info.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID
2434 && userData.info.isManagedProfile()) {
2437 sendProfileRemovedBroadcast(userData.info.profileGroupId, userData.info.id);
2877 UserData userData = getUserDataNoChecks(userId);
2878 if (userData == null || userData.info.partial) {
2885 userData.info.lastLoggedInTime = now;
2887 userData.info.lastLoggedInFingerprint = Build.FINGERPRINT;
2888 scheduleWriteUser(userData);
2983 final UserData userData;
2985 userData = getUserDataLU(userId);
2986 if (userData == null) {
2990 userData.seedAccountName = accountName;
2991 userData.seedAccountType = accountType;
2992 userData.seedAccountOptions = accountOptions;
2993 userData.persistSeedData = persist;
2996 writeUserLP(userData);
3005 UserData userData = getUserDataLU(UserHandle.getCallingUserId());
3006 return userData.seedAccountName;
3014 UserData userData = getUserDataLU(UserHandle.getCallingUserId());
3015 return userData.seedAccountType;
3023 UserData userData = getUserDataLU(UserHandle.getCallingUserId());
3024 return userData.seedAccountOptions;
3032 UserData userData;
3034 userData = getUserDataLU(UserHandle.getCallingUserId());
3035 if (userData == null) return;
3036 userData.clearSeedAccountData();
3038 writeUserLP(userData);
3049 final UserData data = mUsers.valueAt(i);
3120 UserData userData = mUsers.valueAt(i);
3121 if (userData == null) {
3124 UserInfo userInfo = userData.info;
3169 if (userData.account != null) {
3170 pw.print(" Account name: " + userData.account);
3174 if (userData.seedAccountName != null) {
3175 pw.print(" Seed account name: " + userData.seedAccountName);
3177 if (userData.seedAccountType != null) {
3178 pw.print(" account type: " + userData.seedAccountType);
3181 if (userData.seedAccountOptions != null) {
3225 int userId = ((UserData) msg.obj).info.id;
3226 UserData userData = getUserDataNoChecks(userId);
3227 if (userData != null) {
3228 writeUserLP(userData);
3266 final UserData userData = getUserDataNoChecks(userId);
3268 if (userData != null) {
3269 writeUserLP(userData);
3314 UserData userData = getUserDataNoChecks(userId);
3315 if (userData == null || userData.info.partial) {
3319 writeBitmapLP(userData.info, bitmap);
3320 writeUserLP(userData);