Move communal MediaHost init call to view model
MediaHosts need to be initialized before the MediaHierarchyManager
attempts to move the UMO to said host or else a crash occurs.
MediaHosts can only be initialized once, which just registers them with
the MediaHierarchyManager. This CL moves the init from the AndroidView
factory, which only runs if media is active, to the ViewModel init, to
match the behavior of other MediaHosts.
Bug: 311234666
Fixed: 311234666
Test: atest CommunalViewModelTest
Flag: ACONFIG com.android.systemui.communal_hub DEVELOPMENT
Change-Id: I27b7ef1ff83e6dd48b0225ad920a8ca1e78b59c5
3 files changed