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

Commit 6cfe34b5 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Łukasz Rymanowski
Browse files

LE Audio: connect CSIP profile first

CSIP is responsible for connecting other devices in set, and have
potential to improve pairing speed if connected earlier

Bug: 262560396
Test: manual
Change-Id: Iad185e969f06fc086d564323274511d4cf266f22
parent 78fcd2e0
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1376,6 +1376,13 @@ public class AdapterService extends Service {
            android.Manifest.permission.MODIFY_PHONE_STATE,
    })
    private int connectEnabledProfiles(BluetoothDevice device) {
        if (mCsipSetCoordinatorService != null
                && isProfileSupported(device, BluetoothProfile.CSIP_SET_COORDINATOR)
                && mCsipSetCoordinatorService.getConnectionPolicy(device)
                        > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) {
            Log.i(TAG, "connectEnabledProfiles: Connecting Coordinated Set Profile");
            mCsipSetCoordinatorService.connect(device);
        }
        if (mA2dpService != null && isProfileSupported(
                device, BluetoothProfile.A2DP) && mA2dpService.getConnectionPolicy(device)
                > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) {
@@ -1448,14 +1455,6 @@ public class AdapterService extends Service {
            Log.i(TAG, "connectEnabledProfiles: Connecting Volume Control Profile");
            mVolumeControlService.connect(device);
        }
        if (mCsipSetCoordinatorService != null
                && isProfileSupported(
                device, BluetoothProfile.CSIP_SET_COORDINATOR)
                && mCsipSetCoordinatorService.getConnectionPolicy(device)
                        > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) {
            Log.i(TAG, "connectEnabledProfiles: Connecting Coordinated Set Profile");
            mCsipSetCoordinatorService.connect(device);
        }
        if (mLeAudioService != null && isProfileSupported(
                device, BluetoothProfile.LE_AUDIO)
                && mLeAudioService.getConnectionPolicy(device)