Skip to content
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

Don't start audio service in foreground #1122

Merged
merged 1 commit into from
Apr 3, 2019
Merged

Don't start audio service in foreground #1122

merged 1 commit into from
Apr 3, 2019

Conversation

ahmedre
Copy link
Contributor

@ahmedre ahmedre commented Apr 3, 2019

Since the audio service is always started when the app is in the
foreground, and since there are still many ANRs due to not calling
startForeground quickly enough (though it's the earliest thing that
happens in the service), there is likely a race condition in which at
certain points of time, audio playback is stopped and removes the
notification and stops the service before startForeground is called. As
a workaround, just start the service in the background. This is possible
since the app is in the foreground at this point in time.

Since the audio service is always started when the app is in the
foreground, and since there are still many ANRs due to not calling
startForeground quickly enough (though it's the earliest thing that
happens in the service), there is likely a race condition in which at
certain points of time, audio playback is stopped and removes the
notification and stops the service before startForeground is called. As
a workaround, just start the service in the background. This is possible
since the app is in the foreground at this point in time.
@ahmedre ahmedre merged commit caaadac into quran:master Apr 3, 2019
@ahmedre ahmedre deleted the fix_service branch April 3, 2019 18:35
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.

1 participant