Loading core/java/android/content/pm/UserInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ public class UserInfo implements Parcelable { lastLoggedInTime = orig.lastLoggedInTime; partial = orig.partial; profileGroupId = orig.profileGroupId; restrictedProfileParentId = orig.restrictedProfileParentId; guestToRemove = orig.guestToRemove; } Loading services/core/java/com/android/server/pm/UserManagerService.java +27 −9 Original line number Diff line number Diff line Loading @@ -458,7 +458,7 @@ public class UserManagerService extends IUserManager.Stub { continue; } if (!excludeDying || !mRemovingUserIds.get(ui.id)) { users.add(ui); users.add(userWithName(ui)); } } return users; Loading Loading @@ -500,7 +500,7 @@ public class UserManagerService extends IUserManager.Stub { if (mRemovingUserIds.get(profile.id)) { continue; } users.add(profile); users.add(userWithName(profile)); } return users; } Loading Loading @@ -653,7 +653,21 @@ public class UserManagerService extends IUserManager.Stub { public UserInfo getUserInfo(int userId) { checkManageUsersPermission("query user"); synchronized (mUsersLock) { return getUserInfoLU(userId); return userWithName(getUserInfoLU(userId)); } } /** * Returns a UserInfo object with the name filled in, for Owner, or the original * if the name is already set. */ private UserInfo userWithName(UserInfo orig) { if (orig != null && orig.name == null && orig.id == UserHandle.USER_SYSTEM) { UserInfo withName = new UserInfo(orig); withName.name = getOwnerName(); return withName; } else { return orig; } } Loading Loading @@ -1459,9 +1473,7 @@ public class UserManagerService extends IUserManager.Stub { flags |= UserInfo.FLAG_ADMIN | UserInfo.FLAG_PRIMARY; } // Create the system user UserInfo system = new UserInfo(UserHandle.USER_SYSTEM, mContext.getResources().getString(com.android.internal.R.string.owner_name), null, flags); UserInfo system = new UserInfo(UserHandle.USER_SYSTEM, null, null, flags); UserData userData = new UserData(); userData.info = system; synchronized (mUsersLock) { Loading @@ -1482,6 +1494,10 @@ public class UserManagerService extends IUserManager.Stub { writeUserLP(userData); } private String getOwnerName() { return mContext.getResources().getString(com.android.internal.R.string.owner_name); } private void scheduleWriteUser(UserData UserData) { if (DBG) { debug("scheduleWriteUser"); Loading Loading @@ -1551,9 +1567,11 @@ public class UserManagerService extends IUserManager.Stub { serializer.attribute(null, ATTR_SEED_ACCOUNT_TYPE, userData.seedAccountType); } } if (userInfo.name != null) { serializer.startTag(null, TAG_NAME); serializer.text(userInfo.name); serializer.endTag(null, TAG_NAME); } synchronized (mRestrictionsLock) { UserRestrictionsUtils.writeRestrictions(serializer, mBaseUserRestrictions.get(userInfo.id), TAG_RESTRICTIONS); Loading Loading
core/java/android/content/pm/UserInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ public class UserInfo implements Parcelable { lastLoggedInTime = orig.lastLoggedInTime; partial = orig.partial; profileGroupId = orig.profileGroupId; restrictedProfileParentId = orig.restrictedProfileParentId; guestToRemove = orig.guestToRemove; } Loading
services/core/java/com/android/server/pm/UserManagerService.java +27 −9 Original line number Diff line number Diff line Loading @@ -458,7 +458,7 @@ public class UserManagerService extends IUserManager.Stub { continue; } if (!excludeDying || !mRemovingUserIds.get(ui.id)) { users.add(ui); users.add(userWithName(ui)); } } return users; Loading Loading @@ -500,7 +500,7 @@ public class UserManagerService extends IUserManager.Stub { if (mRemovingUserIds.get(profile.id)) { continue; } users.add(profile); users.add(userWithName(profile)); } return users; } Loading Loading @@ -653,7 +653,21 @@ public class UserManagerService extends IUserManager.Stub { public UserInfo getUserInfo(int userId) { checkManageUsersPermission("query user"); synchronized (mUsersLock) { return getUserInfoLU(userId); return userWithName(getUserInfoLU(userId)); } } /** * Returns a UserInfo object with the name filled in, for Owner, or the original * if the name is already set. */ private UserInfo userWithName(UserInfo orig) { if (orig != null && orig.name == null && orig.id == UserHandle.USER_SYSTEM) { UserInfo withName = new UserInfo(orig); withName.name = getOwnerName(); return withName; } else { return orig; } } Loading Loading @@ -1459,9 +1473,7 @@ public class UserManagerService extends IUserManager.Stub { flags |= UserInfo.FLAG_ADMIN | UserInfo.FLAG_PRIMARY; } // Create the system user UserInfo system = new UserInfo(UserHandle.USER_SYSTEM, mContext.getResources().getString(com.android.internal.R.string.owner_name), null, flags); UserInfo system = new UserInfo(UserHandle.USER_SYSTEM, null, null, flags); UserData userData = new UserData(); userData.info = system; synchronized (mUsersLock) { Loading @@ -1482,6 +1494,10 @@ public class UserManagerService extends IUserManager.Stub { writeUserLP(userData); } private String getOwnerName() { return mContext.getResources().getString(com.android.internal.R.string.owner_name); } private void scheduleWriteUser(UserData UserData) { if (DBG) { debug("scheduleWriteUser"); Loading Loading @@ -1551,9 +1567,11 @@ public class UserManagerService extends IUserManager.Stub { serializer.attribute(null, ATTR_SEED_ACCOUNT_TYPE, userData.seedAccountType); } } if (userInfo.name != null) { serializer.startTag(null, TAG_NAME); serializer.text(userInfo.name); serializer.endTag(null, TAG_NAME); } synchronized (mRestrictionsLock) { UserRestrictionsUtils.writeRestrictions(serializer, mBaseUserRestrictions.get(userInfo.id), TAG_RESTRICTIONS); Loading