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

Commit 28870b1b authored by Alex Leung's avatar Alex Leung Committed by Gerrit Code Review
Browse files

Merge "Broadcast playing state changed events similar to A2dpStateMachine.java"

parents b147a315 24022c9e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -622,10 +622,20 @@ public class A2dpSinkStateMachine extends StateMachine {
            switch (state) {
                case AUDIO_STATE_STARTED:
                    mStreaming.obtainMessage(A2dpSinkStreamHandler.SRC_STR_START).sendToTarget();
                    if (mPlayingDevice == null) {
                        mPlayingDevice = device;
                        broadcastAudioState(device, BluetoothA2dpSink.STATE_NOT_PLAYING,
                                BluetoothA2dpSink.STATE_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);
                        mPlayingDevice = null;
                    }
                    break;
                default:
                    loge("Audio State Device: " + device + " bad state: " + state);