diff options
author | CNSS_WLAN Service <cnssbldsw@qualcomm.com> | 2022-02-01 13:40:04 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2022-02-01 13:40:04 -0800 |
commit | 764ab48c0858414bcfc2d34e9847624adcae8228 (patch) | |
tree | 94eeb1a855681600a23f7d4c2da76419b44a9476 | |
parent | 6081b1c048e9f56d6fd4524d5d8e24b4caf9f641 (diff) | |
parent | 4f7f05a9764d963f360f31dbb50f84b394e09b10 (diff) |
Merge "Route profile connection retry through APM" into bt-sys.lnx.12.0
-rw-r--r-- | src/com/android/bluetooth/btservice/PhonePolicy.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/bluetooth/btservice/PhonePolicy.java b/src/com/android/bluetooth/btservice/PhonePolicy.java index c461d4aef..d9b2a6eff 100644 --- a/src/com/android/bluetooth/btservice/PhonePolicy.java +++ b/src/com/android/bluetooth/btservice/PhonePolicy.java @@ -41,6 +41,7 @@ import com.android.bluetooth.a2dp.A2dpService; import com.android.bluetooth.a2dpsink.A2dpSinkService; import com.android.bluetooth.apm.ApmConstIntf; import com.android.bluetooth.apm.MediaAudioIntf; +import com.android.bluetooth.apm.CallAudioIntf; import com.android.bluetooth.btservice.InteropUtil; import com.android.bluetooth.btservice.storage.DatabaseManager; import com.android.bluetooth.hearingaid.HearingAidService; @@ -932,7 +933,12 @@ class PhonePolicy { (hsService.getConnectionPolicy(device) >= BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { debugLog("Retrying connection to HS with device " + device); mHeadsetRetrySet.add(device); - hsService.connect(device); + if (ApmConstIntf.getLeAudioEnabled()) { + CallAudioIntf mCallAudio = CallAudioIntf.get(); + mCallAudio.connect(device); + } else { + hsService.connect(device); + } } else { debugLog("do not initiate connect as A2dp is not connected"); } @@ -962,8 +968,12 @@ class PhonePolicy { (a2dpService.getConnectionPolicy(device) >= BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { debugLog("Retrying connection to A2DP with device " + device); mA2dpRetrySet.add(device); - a2dpService.connect(device); - } else { + if (ApmConstIntf.getLeAudioEnabled()) { + MediaAudioIntf mMediaAudio = MediaAudioIntf.get(); + mMediaAudio.connect(device); + } else { + a2dpService.connect(device); + } debugLog("do not initiate connect as HFP is not connected"); } } |