File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
services/java/com/android/server/pm Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public class UserManagerService extends IUserManager.Stub {
8888
8989 private static final int MIN_USER_ID = 10 ;
9090
91- private static final int USER_VERSION = 1 ;
91+ private static final int USER_VERSION = 2 ;
9292
9393 private static final long EPOCH_PLUS_30_YEARS = 30L * 365 * 24 * 60 * 60 * 1000L ; // ms
9494
@@ -484,8 +484,7 @@ private void readUserListLocked() {
484484 }
485485
486486 /**
487- * This fixes an incorrect initialization of user name for the owner.
488- * TODO: Remove in the next release.
487+ * Upgrade steps between versions, either for fixing bugs or changing the data format.
489488 */
490489 private void upgradeIfNecessary () {
491490 int userVersion = mUserVersion ;
@@ -499,6 +498,16 @@ private void upgradeIfNecessary() {
499498 userVersion = 1 ;
500499 }
501500
501+ if (userVersion < 2 ) {
502+ // Owner should be marked as initialized
503+ UserInfo user = mUsers .get (UserHandle .USER_OWNER );
504+ if ((user .flags & UserInfo .FLAG_INITIALIZED ) == 0 ) {
505+ user .flags |= UserInfo .FLAG_INITIALIZED ;
506+ writeUserLocked (user );
507+ }
508+ userVersion = 2 ;
509+ }
510+
502511 if (userVersion < USER_VERSION ) {
503512 Slog .w (LOG_TAG , "User version " + mUserVersion + " didn't upgrade as expected to "
504513 + USER_VERSION );
You can’t perform that action at this time.
0 commit comments