Skip duplicate USER_SYSTEM start in SystemServiceManager.
On Automotive / Headless System User Mode, the system user will be
started twice - once from ActivityServiceManager and once from an
external/local service that switches the system user to background in
HSUM.
Previously, checking for the current user on the ActivityServiceManager
side helped avoid starting system user twice because
the CarServiceHelperService, which resides in the same process, started
the system user before ActivityServiceManager and switched the user to
the background.
But this doesn't work anymore because the order of these calls are
non-deteministic. The system user start is moved to CarService, which
resides in a separate process (which increases the chances of
the non-deterministic event).
Avoid starting system user twice by explicitly checking against the list
of previously started users on the SystemServiceManager side.
On the ActivityServiceManager side, protect against starting home
displays, and broadcasting system user start/switch on HSUM by
explicitly checking for HSUM.
Test: Build and system bootup is okay.
Bug: 258532055
Change-Id: Ic0af6b030c08995715dd3195801ed271c690ce4a
Merged-In: Ic0af6b030c08995715dd3195801ed271c690ce4a
(cherry picked from commit 123aa680d1bd664b481a26748e0d900496edaea7)
2 files changed