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:
parent
62961d6594
commit
805512c410
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue