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

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

am c98e5c55: am ad7b0e4c: am 51600f7f: HFP/A2DP: Remove pending auto-connect...

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

* commit 'c98e5c55':
  HFP/A2DP: Remove pending auto-connect messages when connected
parents deb4c772 c98e5c55
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