Mini player missing when opening BookWave from active media notification #75
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When playback is already active and BookWave is opened by tapping the media notification, the app can enter the normal navigation UI with no mini player visible.
That leaves the listener without an obvious in-app path to:
Expected behavior
The player chrome has one invariant:
This must hold regardless of how playback was started or how the UI process/activity was entered:
When the full player is open, the mini player does not need to be visible behind it.
Current repository evidence
Observed against
mainat91a742291144204aa1c61403c424a0b4999c27c8.MainActivity.ShelfPlayerContentalways composesMiniPlayer, andMiniPlayeris visible only whenPlaybackUiState.bookId != null.PlayerViewModel.playbackis a direct view ofPlaybackController.state.PlaybackControllerinitializes that state asPlaybackUiState.Idleand establishes itsMediaControllerconnection lazily. The first connection currently happens only through controller operations such as play/toggle/seek/etc.The playback service, however, can own a loaded/playing MediaSession without the UI-side
PlaybackControllerever having connected—for example playback resumption or another system controller can operate the service first. The notification session activity then launches BookWave, but the newly created UI-side controller state can remain Idle even though the service session already contains the book.That explains the missing mini player: the UI has not attached to the already-live MediaSession, so
bookIdstays null.Important implementation constraint
Do not solve this by blindly calling
PlaybackController.connect()on every ordinary app launch.The controller is deliberately lazy because building a MediaController can instantiate/start
PlaybackService. Starting the playback service just because the user opened an idle app would regress the current lifecycle/notification behavior.The implementation should establish/refresh the UI connection when there is a legitimate active-playback/session entry path (including the media notification), while preserving idle cold-launch behavior.
PlaybackService.setSessionActivity(...)currently useslaunchIntent()for notification/session activity. That is a likely seam for explicitly identifying a playback-origin launch without reversing the module dependency from:playbackto:app.Ownership
Primary: Playback & Lifecycle Agent
Required review lens: UI & Experience Agent for the global chrome invariant and navigation behavior.
Required acceptance lens: Test & Acceptance Agent for cold/warm entry, Activity recreation, and real notification/system-surface verification.
Android System & Auto Agent should review if the chosen fix changes
setSessionActivity, notification/session intents, or system-controller lifecycle behavior.Acceptance criteria
Out of scope