Fixes issue #249 (Cannot use Kinivo BTC450 bluetooth car kit to play

after pause). 

The problem was that audioManager.abandonAudioFocus() was being called
before remoteControlClient.setPlaybackState(). That seems to have
prevented the BTC450 from knowing that the audio was paused. As a
result, the BTC450 continued to send "pause" instead of "play" for
subsequent button presses. The fix just moves the call to
abandonAudioFocus() until after setPlaybackState() has been called.
This commit is contained in:
Dean Brettle 2013-08-03 18:53:57 -07:00
parent 62961d6594
commit 805512c410
1 changed files with 3 additions and 3 deletions

View File

@ -825,14 +825,14 @@ public class PlaybackService extends Service {
if (AppConfig.DEBUG) if (AppConfig.DEBUG)
Log.d(TAG, "Pausing playback."); Log.d(TAG, "Pausing playback.");
player.pause(); player.pause();
cancelPositionSaver();
saveCurrentPosition();
setStatus(PlayerStatus.PAUSED);
if (abandonFocus) { if (abandonFocus) {
audioManager.abandonAudioFocus(audioFocusChangeListener); audioManager.abandonAudioFocus(audioFocusChangeListener);
pausedBecauseOfTransientAudiofocusLoss = false; pausedBecauseOfTransientAudiofocusLoss = false;
disableSleepTimer(); disableSleepTimer();
} }
cancelPositionSaver();
saveCurrentPosition();
setStatus(PlayerStatus.PAUSED);
stopWidgetUpdater(); stopWidgetUpdater();
stopForeground(true); stopForeground(true);
if (shouldStream && reinit) { if (shouldStream && reinit) {