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

Commit 0bfbe6ee 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 8c2ac5061563ce7ea4f919ac6072c2c1b44c5b3c)
parent 1ef76b06
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;