diff options
author | 2023-01-23 18:22:27 +0000 | |
---|---|---|
committer | 2023-01-23 18:22:27 +0000 | |
commit | 7e62e4aff67de5821d8982e9f412c20d3749cc77 (patch) | |
tree | ce9a6a004887e47b03eebd506086bcef19a12a97 | |
parent | a70b5972add602a148bb94a185159e48f822af4a (diff) | |
parent | 8c72c3c90702b0f6cec2e3db5678d8f2f40db3e9 (diff) |
Merge "Send system user broadcasts in headless system user mode." into tm-qpr-dev am: 8c72c3c907
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20965081
Change-Id: I0433c3ca2d848df8d169cb8596ef13c6f2267d94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index a59f0a36a306..d48723a4bd04 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8197,15 +8197,13 @@ public class ActivityManagerService extends IActivityManager.Stub t.traceEnd(); } + boolean isBootingSystemUser = currentUserId == UserHandle.USER_SYSTEM; + // Some systems - like automotive - will explicitly unlock system user then switch - // to a secondary user. Hence, we don't want to send duplicate broadcasts for - // the system user here. + // to a secondary user. // TODO(b/242195409): this workaround shouldn't be necessary once we move // the headless-user start logic to UserManager-land. - final boolean isBootingSystemUser = (currentUserId == UserHandle.USER_SYSTEM) - && !UserManager.isHeadlessSystemUserMode(); - - if (isBootingSystemUser) { + if (isBootingSystemUser && !UserManager.isHeadlessSystemUserMode()) { t.traceBegin("startHomeOnAllDisplays"); mAtmInternal.startHomeOnAllDisplays(currentUserId, "systemReady"); t.traceEnd(); @@ -8217,6 +8215,10 @@ public class ActivityManagerService extends IActivityManager.Stub if (isBootingSystemUser) { + // Need to send the broadcasts for the system user here because + // UserController#startUserInternal will not send them for the system user starting, + // It checks if the user state already exists, which is always the case for the + // system user. t.traceBegin("sendUserStartBroadcast"); final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); |