androidx / androidx/media

Session service prevents process from terminating if swiped away from recents while the audio is playing

Open
#1,269 14 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Apr 12, 2024.

bug
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

a154c98faa3290e9ca45a0e8dabd39c0d74842fc

Devices that reproduce the issue

Galaxy S22 ultra running android 14

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps
  1. Modify PlaybackService's onTaskRemoved so that it will terminate even if the music is running (Simply calling pauseAllPlayersAndStopSelf() is mentioned in the documentation, so I used just that)
    image
  2. Optionally add a static integer variable that gets printed and incremented at the start of the app to help with observing the bug
    image
    image
  3. Launch the app and start playing music
  4. Swipe the app away from recents while the music is playing
  5. Launch the app again
Expected result

The static integer value gets reset and prints the same value on both launches

Actual result

The static integer retains it's incremented value and prints different values

Media

Not applicable

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.