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

Commit 6721e55c authored by Alex Leung's avatar Alex Leung
Browse files

Fix bug with broadcasting the wrong audio state

Bug: 117576205
Test: Verified that the correct play state events are sent.
Change-Id: I91f0036c7f6c645c065e087dbd05e1e327171e81
(cherry picked from commit aef4ff25ba0847d38f98f95ecac0b7c28a91d550)
parent 54ee3c15
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;