unregister PlaybackService on the media button intent receiver

This commit is contained in:
Domingos Lopes 2016-04-08 20:02:07 -04:00
parent 5105cdd7c3
commit 4b4743fbb9
1 changed files with 2 additions and 1 deletions

View File

@ -284,6 +284,7 @@ public class PlaybackService extends Service implements SharedPreferences.OnShar
PreferenceManager.getDefaultSharedPreferences(this)
.unregisterOnSharedPreferenceChangeListener(this);
MediaButtonIntentReceiver.setMediaPlayer(null);
unregisterReceiver(headsetDisconnected);
unregisterReceiver(shutdownReceiver);
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
@ -857,7 +858,7 @@ public class PlaybackService extends Service implements SharedPreferences.OnShar
private Thread notificationSetupThread;
/**
* Updates the Media Session with current media player info.
* Updates the Media Session for the corresponding status.
* @param playerStatus the current {@link PlayerStatus}
*/
private void updateMediaSession(final PlayerStatus playerStatus) {