Add 'Up Next Shuffle' to automotive UI#5421
Open
ArcticZeroo wants to merge 2 commits into
Open
Conversation
Adds a dedicated shuffle toggle button to the AAOS player's custom action layout, mirroring the mobile Up Next shuffle control. The button toggles the persistent upNextShuffle mode (icon reflects on/off state) and is only shown to paid subscribers when the Up Next queue is non-empty. Implemented in the Media3 session path only, since AAOS always uses the Media3 MediaLibrarySession regardless of the MEDIA3_SESSION flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an “Up Next Shuffle” custom media-session action, including AAOS (automotive) UI support, settings-driven layout updates, and analytics tracking for shuffle toggling.
Changes:
- Introduces a new Media3 custom command (
APP_ACTION_SHUFFLE) and routes it to a new toggle action. - Adds AAOS layout support for a shuffle toggle button (paid users only) with enabled/disabled icons.
- Updates session layout refresh triggers and adds tests covering the new command/action behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionActions.kt | Adds a suspend action to toggle Up Next shuffle and track analytics. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/Media3SessionCallback.kt | Exposes a new custom session command and routes it to the toggle action. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/Media3AutomotiveStrategy.kt | Adds an AAOS shuffle toggle button gated behind subscription status. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionManager.kt | Refreshes Media3 custom layout on additional settings/subscription changes. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionActionsTest.kt | Adds unit tests for toggling shuffle and analytics tracking. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/Media3SessionCallbackTest.kt | Adds tests verifying command exposure and routing for shuffle toggle. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/Media3AutomotiveStrategyTest.kt | Adds AAOS layout tests for paid gating and icon state. |
Comment on lines
+138
to
+147
| suspend fun toggleUpNextShuffleSuspend() { | ||
| val newValue = !settings.upNextShuffle.value | ||
| settings.upNextShuffle.set(newValue, updateModifiedAt = false) | ||
| eventHorizon.track( | ||
| UpNextShuffleEnabledEvent( | ||
| value = newValue, | ||
| source = UpNextSourceType.Player, | ||
| ), | ||
| ) | ||
| } |
Author
There was a problem hiding this comment.
Shrug, doesn't feel like a likely scenario but the check is easy since we already have settings so I can make the change
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.
Description
I frequently use Pocket Casts on my Polestar 2 running AAOS. I use shuffle 100% of the time on my Android phone, but there is no shuffle option in the car.
Changes:
Note: All changes in this PR were fully written by AI, but I have reviewed them myself. This PR description was not AI-written.
Testing Instructions
Screenshots or Screencast
I tried recording but it is hard to follow because I don't have Up Next UI on my AAOS emulators as far as I can tell. But here's what the shuffle button looks like:
Checklist
If this is a user-facing change, I have added an entry in CHANGELOG.md
Ensure the linter passes (
./gradlew spotlessApplyto automatically apply formatting/linting)I have considered whether it makes sense to add tests for my changes
All strings that need to be localized are in
modules/services/localization/src/main/res/values/strings.xmlAny jetpack compose components I added or changed are covered by compose previews
I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.
I have tested any UI changes...
Only in the polestar emulator. In the base Android Automotive OS emulator all control buttons seem to be missing anyway (even on main) and I was having trouble getting other automotive emulators.