Skip to content

Add 'Up Next Shuffle' to automotive UI#5421

Open
ArcticZeroo wants to merge 2 commits into
Automattic:mainfrom
ArcticZeroo:feat/automotive-up-next-shuffle
Open

Add 'Up Next Shuffle' to automotive UI#5421
ArcticZeroo wants to merge 2 commits into
Automattic:mainfrom
ArcticZeroo:feat/automotive-up-next-shuffle

Conversation

@ArcticZeroo

Copy link
Copy Markdown

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:

  • Shuffle button now appears for users with a subscription. There is no upsell screen on AAOS so it is fully hidden for free users.
  • The shuffle button appears as a control button in the main player because the up next screen is OS-controlled on automotive and we can't add command buttons to it.
  • I chose to make the shuffle button always appear even if the queue is empty. I am open to changing this, but feels like extra unneeded complexity since it lives outside the up next view anyway.

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

  1. Add podcasts to queue from mobile. I don't seem to have Up Next UI in the polestar emulator so I can't see the ordering there.
  2. In AAOS emulator: turn on shuffle, skip to the end of a podcast.
  3. It's possible (but unlikely) that the next in the queue anyway would go due to randomness, so do this 2 or 3 times to see that you're definitely not going through the list in order
  4. Turn off shuffle, do the same thing - you are going again in order

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:

image

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md

    • I have no idea how to figure out what version this change would be in to update changelog.
  • Ensure the linter passes (./gradlew spotlessApply to 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.xml

  • Any jetpack compose components I added or changed are covered by compose previews

    • I believe the command button is rendered by the OS, not compose, so not applicable?
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

    • N/A

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.

ArcticZeroo and others added 2 commits June 13, 2026 10:46
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>
Copilot AI review requested due to automatic review settings June 14, 2026 18:47
@ArcticZeroo ArcticZeroo requested a review from a team as a code owner June 14, 2026 18:47
@ArcticZeroo ArcticZeroo requested review from sztomek and removed request for a team June 14, 2026 18:47
@CLAassistant

CLAassistant commented Jun 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
),
)
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shrug, doesn't feel like a likely scenario but the check is easy since we already have settings so I can make the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants