Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c1f7b10 authored by Alex Leung's avatar Alex Leung Committed by Gerrit Code Review
Browse files

Merge "Fix bug with broadcasting the wrong audio state"

parents 54ee3c15 6721e55c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -627,16 +627,16 @@ public class A2dpSinkStateMachine extends StateMachine {
                    mStreaming.obtainMessage(A2dpSinkStreamHandler.SRC_STR_START).sendToTarget();
                    if (mPlayingDevice == null) {
                        mPlayingDevice = device;
                        broadcastAudioState(device, BluetoothA2dpSink.STATE_NOT_PLAYING,
                                BluetoothA2dpSink.STATE_PLAYING);
                        broadcastAudioState(device, BluetoothA2dpSink.STATE_PLAYING,
                                BluetoothA2dpSink.STATE_NOT_PLAYING);
                    }
                    break;
                case AUDIO_STATE_REMOTE_SUSPEND:
                case AUDIO_STATE_STOPPED:
                    mStreaming.obtainMessage(A2dpSinkStreamHandler.SRC_STR_STOP).sendToTarget();
                    if (mPlayingDevice != null) {
                        broadcastAudioState(device, BluetoothA2dpSink.STATE_PLAYING,
                                BluetoothA2dpSink.STATE_NOT_PLAYING);
                        broadcastAudioState(device, BluetoothA2dpSink.STATE_NOT_PLAYING,
                                BluetoothA2dpSink.STATE_PLAYING);
                        mPlayingDevice = null;
                    }
                    break;