aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-10-09 01:22:09 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-10-09 01:22:09 +0000
commit4ca81cda00a0bdbebd757b0489cd65f1a1ab5c36 (patch)
treed8436dd3adfb017f9152b400b74e104f9c594367
parent6fde61add319f54b5af83707f38239804b62f758 (diff)
parent18f7a809bd3f1ec45a2b641893697ff686062610 (diff)
downloadsl4a-4ca81cda00a0bdbebd757b0489cd65f1a1ab5c36.tar.gz
Change-Id: If11dbcd0212a900d958d352d3df714bdabe72ca2
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/media/BluetoothSL4AAudioSrcMBS.java9
1 files changed, 9 insertions, 0 deletions
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 fdc7ec9b..4bdca3f7 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 @@ public class BluetoothSL4AAudioSrcMBS extends MediaBrowserService {
.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