Small refactoring to eliminate the need to allocate array.
Change-Id: Ib08a16e40c342b12e4f7106376f46d6279f29f2b
This commit is contained in:
@@ -887,20 +887,14 @@ final class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateUserSetupCompleteLocked(int userId) {
|
void updateUserSetupCompleteLocked(int userId) {
|
||||||
int[] users;
|
|
||||||
if (userId != UserHandle.USER_ALL) {
|
|
||||||
users = new int[] {userId};
|
|
||||||
} else {
|
|
||||||
users = new int[mStartedUsers.size()];
|
|
||||||
for (int i = mStartedUsers.size() - 1; i >= 0; i--) {
|
|
||||||
users[i] = mStartedUsers.keyAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final ContentResolver cr = mService.mContext.getContentResolver();
|
final ContentResolver cr = mService.mContext.getContentResolver();
|
||||||
for (int i = 0; i < users.length; i++) {
|
for (int i = mStartedUsers.size() - 1; i >= 0; i--) {
|
||||||
final boolean setupComplete =
|
int startedUser = mStartedUsers.keyAt(i);
|
||||||
Settings.Secure.getIntForUser(cr, USER_SETUP_COMPLETE, 0, users[i]) != 0;
|
if (startedUser == userId || userId == UserHandle.USER_ALL) {
|
||||||
mSetupCompletedUsers.put(users[i], setupComplete);
|
final boolean setupComplete =
|
||||||
|
Settings.Secure.getIntForUser(cr, USER_SETUP_COMPLETE, 0, startedUser) != 0;
|
||||||
|
mSetupCompletedUsers.put(startedUser, setupComplete);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user