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

Commit c98e5c55 authored by Ajay Panicker's avatar Ajay Panicker Committed by Android Git Automerger
Browse files

am ad7b0e4c: am 51600f7f: HFP/A2DP: Remove pending auto-connect messages when connected

* commit 'ad7b0e4c':
  HFP/A2DP: Remove pending auto-connect messages when connected
parents 2a459265 ad7b0e4c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -479,6 +479,12 @@ final class A2dpStateMachine extends StateMachine {
    private class Connected extends State {
        @Override
        public void enter() {
            // Remove pending connection attempts that were deferred during the pending
            // state. This is to prevent auto connect attempts from disconnecting
            // devices that previously successfully connected.
            // TODO: This needs to check for multiple A2DP connections, once supported...
            removeDeferredMessages(CONNECT);

            log("Enter Connected: " + getCurrentMessage().what);
            // Upon connected, the audio starts out as stopped
            broadcastAudioState(mCurrentDevice, BluetoothA2dp.STATE_NOT_PLAYING,
+10 −4
Original line number Diff line number Diff line
@@ -741,6 +741,12 @@ final class HeadsetStateMachine extends StateMachine {
    private class Connected extends State {
        @Override
        public void enter() {
            // Remove pending connection attempts that were deferred during the pending
            // state. This is to prevent auto connect attempts from disconnecting
            // devices that previously successfully connected.
            // TODO: This needs to check for multiple HFP connections, once supported...
            removeDeferredMessages(CONNECT);

            log("Enter Connected: " + getCurrentMessage().what +
                           ", size: " + mConnectedDevicesList.size());
            // start phone state listener here so that the CIND response as part of SLC can be