Skip to content

UserScope/Component is managed in the wrong layer #286

@r0adkll

Description

@r0adkll

Issue

As I work on the AudioPlayerService for Android Auto its apparent that managing/creating the UserComponent part of our graph in the UI layer (i.e. UserComponentContent) is the incorrect way to manage this as the UserComponent can be null/missing at critical parts of the apps lifecycle. i.e when AndroidAuto or some other MediaBrowser attempts to initialize our AudioPlayerService to serve content and populate remove browser views.

Solution

We should move the management of this scope/component to the Application initialization step (i.e. CampfireApplication or its related variants for different platforms) and leverage the existing component observability in ComponentHolder.subscribe<UserComponent>() to drive UI changes.

This way when a remote process starts our app process, we will have constructed our full graph and will be available to the service without having to render the entire application.

Metadata

Metadata

Assignees

Labels

AndroidIssues/Bugs/PRs that involve AndroidbugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions