Loading services/core/java/com/android/server/pm/UserManagerService.java +16 −15 Original line number Diff line number Diff line Loading @@ -1677,26 +1677,27 @@ public class UserManagerService extends IUserManager.Stub { public void setUserAdmin(@UserIdInt int userId) { checkManageUserAndAcrossUsersFullPermission("set user admin"); mUserJourneyLogger.logUserJourneyBegin(userId, USER_JOURNEY_GRANT_ADMIN); UserInfo info; UserData user; synchronized (mPackagesLock) { synchronized (mUsersLock) { info = getUserInfoLU(userId); } if (info == null) { user = getUserDataLU(userId); if (user == null) { // Exit if no user found with that id, mUserJourneyLogger.logNullUserJourneyError(USER_JOURNEY_GRANT_ADMIN, getCurrentUserId(), userId, /* userType */ "", /* userFlags */ -1); return; } else if (info.isAdmin()) { } else if (user.info.isAdmin()) { // Exit if the user is already an Admin. mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), info, USER_JOURNEY_GRANT_ADMIN, ERROR_CODE_USER_ALREADY_AN_ADMIN); mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), user.info, USER_JOURNEY_GRANT_ADMIN, ERROR_CODE_USER_ALREADY_AN_ADMIN); return; } info.flags ^= UserInfo.FLAG_ADMIN; writeUserLP(getUserDataLU(info.id)); user.info.flags ^= UserInfo.FLAG_ADMIN; writeUserLP(user); } mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), info, } mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), user.info, USER_JOURNEY_GRANT_ADMIN, ERROR_CODE_UNSPECIFIED); } Loading Loading
services/core/java/com/android/server/pm/UserManagerService.java +16 −15 Original line number Diff line number Diff line Loading @@ -1677,26 +1677,27 @@ public class UserManagerService extends IUserManager.Stub { public void setUserAdmin(@UserIdInt int userId) { checkManageUserAndAcrossUsersFullPermission("set user admin"); mUserJourneyLogger.logUserJourneyBegin(userId, USER_JOURNEY_GRANT_ADMIN); UserInfo info; UserData user; synchronized (mPackagesLock) { synchronized (mUsersLock) { info = getUserInfoLU(userId); } if (info == null) { user = getUserDataLU(userId); if (user == null) { // Exit if no user found with that id, mUserJourneyLogger.logNullUserJourneyError(USER_JOURNEY_GRANT_ADMIN, getCurrentUserId(), userId, /* userType */ "", /* userFlags */ -1); return; } else if (info.isAdmin()) { } else if (user.info.isAdmin()) { // Exit if the user is already an Admin. mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), info, USER_JOURNEY_GRANT_ADMIN, ERROR_CODE_USER_ALREADY_AN_ADMIN); mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), user.info, USER_JOURNEY_GRANT_ADMIN, ERROR_CODE_USER_ALREADY_AN_ADMIN); return; } info.flags ^= UserInfo.FLAG_ADMIN; writeUserLP(getUserDataLU(info.id)); user.info.flags ^= UserInfo.FLAG_ADMIN; writeUserLP(user); } mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), info, } mUserJourneyLogger.logUserJourneyFinishWithError(getCurrentUserId(), user.info, USER_JOURNEY_GRANT_ADMIN, ERROR_CODE_UNSPECIFIED); } Loading