-
-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service stops when activity closes and it's foreground #834
Comments
EDIT: edited wrong comment, just reproduced on Android 9 |
I'm wondering about which of
I think it should either be no and yes, or yes and no. |
Why not avoid passing in invalid states to the API? |
Is it |
I'm just thinking about it from the perspective of the way the Android API's work where it is the app's responsibility to coordinate these two things. Alternatively, maybe there is a clever way of making the plugin do something reasonable in this state, such as showing a notification without entering the foreground state. |
Submitted a PR to fix the original issue. I think it sounds good to let Extracted this into #847 |
I've spent some time thinking about it, and while I originally thought I should just let the I think this would be less surprising to the average user and it tries to do something reasonable in weird states like I haven't fully tested it, so feel free to see if it works properly on your own example. |
Which API doesn't behave as documented, and how does it misbehave?
If processing state was
idle
, then becameready
andplaying
didn't change, something goes wrong, not sure what exactly, perhaps MediaSession should be reactivated.Minimal reproduction project
https://github.com/nt4f04unds-archive/issues/tree/audio_service_834
To Reproduce (i.e. user steps, not code)
Error messages
n/a
Expected behavior
Service shouldn't stop
Screenshots
n/a
Runtime Environment (please complete the following information if relevant):
Flutter SDK version
Additional context
This causes other side effects, e.g. the service gets destroyed while the activity is reattaching to it, which prevents proper patching of #671
The text was updated successfully, but these errors were encountered: