Skip to content

Android lockscreen media notification shows Play button twice, missing Next #509

Open

Description

@libravault-xyz

Summary

On Android, the lockscreen / status-bar "live notification" media control row for audiobook playback shows a Play button twice, and is missing a "skip to next" button. Screenshot (locked phone, DND on, "The Easy Way to Quit Caffeine" playing):

Control row observed, left to right:
▶ (play) |◀ (skip-previous) ▶ (play) ↺ (seek back) ↻ (seek forward)

Expected row (per the intended 5-button strip):
|◀ (previous) ↺ (seek back) ▶/⏸ (play/pause) ↻ (seek forward) ⏭ (next)

So instead of one Play/Pause glyph plus a genuine "next" action, the tile renders a duplicate Play glyph and drops/misplaces "next".

Likely area

PlaybackService.kt / LibravaultMediaCallback.kt

LibravaultMediaCallback.onConnect publishes a 5-button customLayout ([Prev | −seek | PlayPause | +seek | Next]) and explicitly strips the overlapping standard seek/skip commands from availablePlayerCommands so the system doesn't also derive standard-action buttons for the same controls (see the class KDoc, "What this publishes to the system media tile"). Player.COMMAND_PLAY_PAUSE is deliberately left in availablePlayerCommands, on the documented assumption that "the system tile's central glyph is driven by PlaybackStateCompat.state, not by a separate action slot."

The screenshot suggests that assumption doesn't hold on this device/Android version — the system appears to also derive a standalone play/pause action bit from COMMAND_PLAY_PAUSE being present in availablePlayerCommands, which lands as an extra button in the row alongside the custom-layout's own Play/Pause button, pushing out/misplacing "Next" (tile only has room for 5 slots).

Repro

  1. Start playing an audiobook.
  2. Lock the phone.
  3. Look at the lockscreen media notification control row.

Device/context from report

  • Locked-screen "Live notifications" media card, DND on.
  • Book: "The Easy Way to Quit Caffeine" by Allen Carr.

Suggested triage direction

Try removing Player.COMMAND_PLAY_PAUSE from availablePlayerCommands in LibravaultMediaCallback.onConnect (same treatment as the seek/skip commands) and verify against a real device/emulator whether the central glyph still updates correctly from PlaybackStateCompat.state alone, or whether that breaks something else the KDoc's assumption was protecting against. Needs on-device (or emulator) verification, not just unit tests — this is presentation-layer behavior driven by the OS's own MediaStyle notification rendering, not covered by PlaybackServiceTest/LibravaultMediaCallbackDispatchTest.

Screenshot

Reported inline in chat, not attached to this issue (file not available on disk to upload). Description above is transcribed directly from the screenshot.

Activity

  1. added
    bug
    status:triage
    on Aug 24, 2026
  2. added
    status:ready-for-dev
    status:in-progress
    on Aug 24, 2026
  3. libravault-xyz commented on Aug 26, 2026

    @libravault-xyz
    CollaboratorAuthor

    Still reproducing after the PR #511 fix — reopening

    New screenshot from the reporter, taken Wed 26 Aug, 07:41 (after PR #511 merged to dev on 2026-08-24T16:42:28Z). Verified 15817ea (the #511 merge commit) is an ancestor of the current dev HEAD, so this is not a stale-build report — the fix is in the code the user is running.

    What's different now vs. the original report

    Control row observed this time, left to right:

    ▶ (extra) |◀ (previous) Ⅱ (pause — correct state) ↺ (seek back) ↻ (seek forward)

    So it's no longer a literal duplicate Play glyph (the #511 fix did change the leading icon's appearance), but:

    1. There's still an extra leading icon ahead of the intended 5-button strip [Prev | −seek | PlayPause | +seek | Next], which pushes every custom button one slot to the right.
    2. That extra leading icon is static — it shows a plain "▶" regardless of actual playback state, while the real, state-correct Play/Pause button (showing "Ⅱ" because the book is actively playing) is visible three slots later, in the position the strip's own Play/Pause button occupies.
    3. "Next" is still missing from the row — pushed out because the leading extra icon consumes the 5th slot.

    Why this matters for the #511 fix's reasoning

    PR #511 removed Player.COMMAND_PLAY_PAUSE from availablePlayerCommands, on the theory that the duplicate came from PlayerWrapper.createPlaybackStateCompat deriving a standalone play/pause action bit from that command, and that "the central glyph still tracks PlaybackStateCompat.state independently of availablePlayerCommands." This new evidence suggests that assumption is still not quite right: the leading slot is still being synthesized by something outside customLayout/availablePlayerCommands — and now it's not even following playback state, it's just stuck showing "Play."

    That points away from PlaybackStateCompat/availablePlayerCommands entirely and toward how DefaultMediaNotificationProvider (Media3's stock notification provider, used unmodified here) builds the actual Notification.MediaStyle actions/compact-view on Android 13+ "Live notifications" — that's a separate code path from the legacy PlaybackStateCompat.customActions the KDoc's analysis was reasoning about. Worth checking whether DefaultMediaNotificationProvider always reserves a leading action slot for play/pause independent of customLayout, and whether that needs to be suppressed/overridden (e.g. via a custom MediaNotification.Provider or mediaButtonPreferences) rather than solved purely through availablePlayerCommands.

    Suggested next steps for dev-agent

    • Reproduce on-device/emulator on Android 13+ specifically (the "Live notifications" card is a 13+ feature) — this bug is presentation-layer and won't show up in the existing Robolectric/JVM tests (LibravaultMediaCallbackConnectTest only asserts on availablePlayerCommands/customLayout inputs, not on what DefaultMediaNotificationProvider actually renders).
    • Investigate DefaultMediaNotificationProvider's action-building logic (Media3 1.11) to see whether it always synthesizes its own leading play/pause action regardless of customLayout, and if so, whether Media3 exposes a supported way to suppress it (e.g. setMediaButtonPreferences instead of customLayout, per the AntennaPod migration the class KDoc already flags as not-yet-done).

    Reopening — not resolved.

  4. removed
    status:ready-for-dev
    status:in-progress
    on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidbugstatus:triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions