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

Commit f750c256 authored by Yuyang Huang's avatar Yuyang Huang Committed by Automerger Merge Worker
Browse files

Merge "Prefer LE audio profile over ASHA for dual mode hearing aid profile...

Merge "Prefer LE audio profile over ASHA for dual mode hearing aid profile connection" am: 0a89afe0

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2553050



Change-Id: Idc13f68172fbb241dd9446458becea7be046b244
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5d845852 0a89afe0
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -5699,11 +5699,17 @@ public class AdapterService extends Service {
        }
        if (mHearingAidService != null && isProfileSupported(
                device, BluetoothProfile.HEARING_AID)) {
            if (mHapClientService != null && isProfileSupported(
                    device, BluetoothProfile.HAP_CLIENT)) {
                Log.i(TAG, "connectAllEnabledProfiles: Hearing Access Client Profile is enabled"
                        + " at the same time with Hearing Aid Profile, ignore Hearing Aid Profile");
            } else {
                Log.i(TAG, "connectAllEnabledProfiles: Connecting Hearing Aid Profile");
                mHearingAidService.setConnectionPolicy(device,
                    BluetoothProfile.CONNECTION_POLICY_ALLOWED);
                numProfilesConnected++;
            }
        }
        if (mHapClientService != null && isProfileSupported(
                device, BluetoothProfile.HAP_CLIENT)) {
            Log.i(TAG, "connectAllEnabledProfiles: Connecting Hearing Access Client Profile");
+2 −0
Original line number Diff line number Diff line
@@ -420,6 +420,8 @@ class PhonePolicy {
                == BluetoothProfile.CONNECTION_POLICY_UNKNOWN)) {
            if (isLeAudioProfileAllowed) {
                debugLog("LE Audio preferred over ASHA for device " + device);
                mAdapterService.getDatabase().setProfileConnectionPolicy(device,
                        BluetoothProfile.HEARING_AID, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN);
            } else {
                debugLog("setting hearing aid profile priority for device " + device);
                if (mAutoConnectProfilesSupported) {