diff options
| author | 2019-03-27 18:49:01 +0000 | |
|---|---|---|
| committer | 2019-03-27 18:49:01 +0000 | |
| commit | 9cd24f630cd5143fe410b33a0a6ee4cc5762f49a (patch) | |
| tree | e79f43cdf28a3c14917fa45f430249fee616bbba | |
| parent | b90c4d3b6a600cd15ea51255f519a9821778c5e6 (diff) | |
Revert "Decide the current user after PHASE_THIRD_PARTY boot phase"
This reverts commit b90c4d3b6a600cd15ea51255f519a9821778c5e6.
Reason for revert: created crash loop for 1st boot, needs to update the logic in car side before enforcing this.
Change-Id: I8985e63a1f6f5d743bfe56e1ec6a09e959b5a12a
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 11 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/UserController.java | 18 |
2 files changed, 1 insertions, 28 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 9926de5ce36b..a1f2ac630c04 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8789,6 +8789,7 @@ public class ActivityManagerService extends IActivityManager.Stub mAtmInternal.updateTopComponentForFactoryTest(); retrieveSettings(); + final int currentUserId = mUserController.getCurrentUserId(); mUgmInternal.onSystemReady(); final PowerManagerInternal pmi = LocalServices.getService(PowerManagerInternal.class); @@ -8802,16 +8803,6 @@ public class ActivityManagerService extends IActivityManager.Stub } if (goingCallback != null) goingCallback.run(); - // Check the current user here as a user can be started inside goingCallback.run() from - // other system services. - final int currentUserId = mUserController.getCurrentUserId(); - Slog.i(TAG, "Current user:" + currentUserId); - if (currentUserId != UserHandle.USER_SYSTEM && !mUserController.isSystemUserStarted()) { - // User other than system user has started. Make sure that system user is already - // started before switching user. - throw new RuntimeException("System user not started while current user is:" - + currentUserId); - } traceLog.traceBegin("ActivityManagerStartApps"); mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_USER_RUNNING_START, Integer.toString(currentUserId), currentUserId); diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java index 688020f0cc0c..07c9cca3f6c3 100644 --- a/services/core/java/com/android/server/am/UserController.java +++ b/services/core/java/com/android/server/am/UserController.java @@ -1743,24 +1743,6 @@ class UserController implements Handler.Callback { return state.state != UserState.STATE_STOPPING && state.state != UserState.STATE_SHUTDOWN; } - /** - * Check if system user is already started. Unlike other user, system user is in STATE_BOOTING - * even if it is not explicitly started. So isUserRunning cannot give the right state - * to check if system user is started or not. - * @return true if system user is started. - */ - boolean isSystemUserStarted() { - synchronized (mLock) { - UserState uss = mStartedUsers.get(UserHandle.USER_SYSTEM); - if (uss == null) { - return false; - } - return uss.state == UserState.STATE_RUNNING_LOCKED - || uss.state == UserState.STATE_RUNNING_UNLOCKING - || uss.state == UserState.STATE_RUNNING_UNLOCKED; - } - } - UserInfo getCurrentUser() { if ((mInjector.checkCallingPermission(INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) && ( |