fix: adaptive icon, tile cold start, back-exit shutdown (#8, #13, #9) - #15
Merged
Merged
Conversation
…aunchers stop drawing a square on a circle
…nstead of idling in the background
…r must go through an activity
…en the app is not running
…a3 swallows a play key on an empty player
…e notification and startForeground follow
…efore the stored mix has loaded
…timing flag, and retire the media-button rationale
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8, fixes #13, fixes #9.
#8 Adaptive icon. The foreground layer had a pale rounded square baked in and the background layer was purple, so launchers drew a square on a circle. The square is keyed out of the foreground at all five densities and the background is a flat fill of the same pale green. Monochrome and legacy icons unchanged.
#13 Quick Settings tile. Media3's
MediaButtonReceivercannot start the service from a background broadcast on Android 12+ (ForegroundServiceStartNotAllowedException, swallowed). When nothing is playing, the tile now starts an invisibleTilePlayActivitythat startsAudioServicewith an explicitACTION_PLAY_STORED_MIX. The service registers its session (addSession) and loads the stored mix, so the last mix plays with no app UI, also from the lock screen. The trampoline's launch intent carries a category thatonTaskRemovedrecognises, since that task is removed the instant the activity finishes. While playing, the tile still broadcasts, so pausing keeps the panel open.Two designs were tried and rejected on the way, both documented in code comments: a media-button intent (Media3 intercepts play on an empty player before it reaches
MixPlayer) and a timing flag around the mix load (racy).#9 Background service. Backing out of the app after Stop now stops the service:
MediaSession.Callback.onDisconnectedstops it when a non-notification controller leaves aSTATE_IDLEplayer. A paused mix keeps its notification and process on purpose.No version bump here; 2.1 is cut once the sibling PR lands.
Verified on an API 36 emulator (Medium_Phone_API36): launcher icon; tile cold start with foreground notification and no app UI; pause and resume from the tile; lock-screen start with a PIN set; Stop then Back leaves no service; pause then Back keeps service and notification.
./gradlew assembleDebug lint test assembleReleasegreen, 484 unit tests.Known, out of scope: pressing Back within the 3 s stop fade cancels the fade's stop and the mix keeps playing (pre-existing, in
AudioServiceConnection). Worth its own issue.