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

Commit 2887c337 authored by Jack He's avatar Jack He
Browse files

HFP: Indicate profile as connected after SLC is established

* HFP profile connection require RFCOMM connection first and then a
  Service Level Connection (SLC) on top of RFCOMM
* HFP profile is only considered fully connected when SLC is
  established
* Bluetooth stack currently sends
   BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED when RFCOMM is
  connected. Instead, it should send it when SLC is established.
* This CL fixes the above issue by sending connection state changed
  intent after SLC is established.
* This CL also removes instances where emitted connection state changed
  intents have same new state and previous state (i.e. no real state
  change)
* Moved processSlcConnected out from headset state machine to
  queryPhoneState()

Bug: 63775402
Test: HFP and HSP PTS tests, HFP regression
Change-Id: I0d4e1c17f502968e4f88f3c11c2b8001dc79f7b9
Merged-In: I0d4e1c17f502968e4f88f3c11c2b8001dc79f7b9
(cherry picked from commit 32cc7ed3)
parent ed3dde86
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -487,12 +487,11 @@ public class HeadsetService extends ProfileService {
        // TODO(BT) BLUETOOTH or BLUETOOTH_ADMIN permission
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        if (!mStateMachine.isConnected()) {
            return false;
        }
        if (!mStateMachine.isSlcConnected()) {
            Log.w(TAG, "connectAudio: profile not connected");
            return false;
        }
        if (mStateMachine.isAudioOn()) {
            Log.w(TAG, "connectAudio: audio is already ON");
            return false;
        }
        mStateMachine.sendMessage(HeadsetStateMachine.CONNECT_AUDIO);
+162 −193

File changed.

Preview size limit exceeded, changes collapsed.