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

Quick and dirty fix for pause on detach on Android O #351

Merged
merged 2 commits into from
Jan 16, 2018

Conversation

EthanArmbrust
Copy link
Contributor

@EthanArmbrust EthanArmbrust commented Dec 25, 2017

As of Android O, WakefulBroadcastReceiver has been deprecated. As such, the MediaButtonIntentReceiver class no longer functions on Android API 26 or greater. To get around this, I have placed a BroadcastReceiver within the MusicService class to handle pause on detach.
#348

if (PreferencesUtility.getInstance(content).pauseEnabledOnDetach()) {
pause();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have you created a new BroadcastReceiver instead of using the existing mIntentReceiver? It looks like you could just have added this code to MusicService.handleCommandIntent.

@EthanArmbrust
Copy link
Contributor Author

Good point. I've fixed it now.

@naman14 naman14 merged commit 5726c55 into naman14:master Jan 16, 2018
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.

3 participants