Merge "Merge "Sets the PlaybackState to STOPPED after initialization." am: d4fdff45a1 am: 807df1ef57 am: 103864f15c am: 2ddfe90464" into qt-dev am: ddc4bd0b23
am: de5d551af5
Change-Id: Iab669399ab7d6f14498fb8c8398b53def155a379
diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/media/BluetoothSL4AAudioSrcMBS.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/media/BluetoothSL4AAudioSrcMBS.java
index fdc7ec9..4bdca3f 100644
--- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/media/BluetoothSL4AAudioSrcMBS.java
+++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/media/BluetoothSL4AAudioSrcMBS.java
@@ -168,6 +168,15 @@
.build();
mMediaSession.setPlaybackState(state);
mMediaSession.setActive(true);
+
+ // Sets the PlaybackState to STOPPED now that we are able to receive MediaSession callbacks.
+ state = new PlaybackState.Builder()
+ .setActions(PlaybackState.ACTION_PLAY | PlaybackState.ACTION_PAUSE
+ | PlaybackState.ACTION_SKIP_TO_NEXT | PlaybackState.ACTION_SKIP_TO_PREVIOUS
+ | PlaybackState.ACTION_STOP)
+ .setState(PlaybackState.STATE_STOPPED, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1)
+ .build();
+ mMediaSession.setPlaybackState(state);
}
@Override