Skip to content

Conversation

@mickael-menu
Copy link
Member

Copy link
Member

@qnga qnga left a comment

Choose a reason for hiding this comment

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

@mickael-menu
Copy link
Member Author

@qnga I guess it would be here:

But I don't think using startForegroundService() here would be helpful, because I guess it will prevent the app from being destroyed while in background as it is started on app launch.

Like with the previous audio navigator, the media service should be started only when actually playing an audiobook, and stopped when we're done. It needs to be started as "foreground" for the issue raised in #92 but also this:

You use startForeground(int, Notification) if killing your service would be disruptive to the user, such as if your service is performing background music playback, so the user would notice if their music stopped playing.

https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)

@qnga
Copy link
Member

qnga commented Mar 30, 2022

Correct, the service is made foreground only when some audiobook is opened. Let's assume that media2 does all the work correctly until proven otherwise.

@mickael-menu
Copy link
Member Author

Fine by me.

@mrifni Did you have time to test this PR?

@mrifni
Copy link
Contributor

mrifni commented Apr 9, 2022

@mickael-menu this seems to work, can we merge it ?

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.

5 participants