just_audio icon indicating copy to clipboard operation
just_audio copied to clipboard

Background AudioService Stops After Receiving a Phone Call

Open drahmedgabr opened this issue 4 months ago • 0 comments

Which API doesn't behave as documented, and how does it misbehave?

Android API: Specifically, the AudioManager or AudioService API in Android might be involved here, especially if the documentation suggests that background audio should resume after an interruption like a phone call but it fails to do so.

Misbehavior: After a phone call, the background audio service resumes for approximately 5 minutes and then unexpectedly stops. Additionally, when the audio resumes after the call and the app is reopened from the notification bar, closing the app causes the audio service to be destroyed. This behavior is inconsistent with the expected functionality where the audio service should continue running in the background.

Minimal reproduction project The example

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. Open the app.
  2. Start playing audio.
  3. Close the app (audio continues playing in the background).
  4. Make a phone call and end it.
  5. Wait approximately 5 minutes – the audio service will stop unexpectedly. Or
  6. Reopen the app from the notification.
  7. Close the app again – the audio service stops immediately.

Error messages

If applicable, copy & paste error message here, within the triple quotes to preserve formatting.

Expected behavior Audio service should continue running in the background

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. MacOS + version]
  • Browser [e.g. chrome, safari + version]

Smartphone (please complete the following information):

  • Device: Realme 10 android 14 & pixel emulator android 14
  • OS: Android 14

Flutter SDK version 3.24.3

insert output of "flutter doctor" here

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.4894], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.2.5) ! Unable to locate a Windows 10 SDK. If building fails, install the Windows 10 SDK in Visual Studio. [√] Android Studio (version 2023.1) [√] Android Studio (version 2023.2) [√] VS Code (version 1.93.1) [√] Connected device (3 available) [√] Network resources

Additional context Add any other context about the problem here.

drahmedgabr avatar Sep 28 '24 15:09 drahmedgabr