Snap for 6222814 from 359c0fd41319d6d99495610a6a012cbdeacc47b4 to q-keystone-qcom-release
Change-Id: Ic0ae8eaaffd00fadf3b584206ccf59284fc283fc
diff --git a/src/com/android/bluetooth/hfp/HeadsetA2dpSync.java b/src/com/android/bluetooth/hfp/HeadsetA2dpSync.java
index 8adbdf2..d21d8b6 100644
--- a/src/com/android/bluetooth/hfp/HeadsetA2dpSync.java
+++ b/src/com/android/bluetooth/hfp/HeadsetA2dpSync.java
@@ -38,6 +38,8 @@
import android.util.Log;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
+import com.android.bluetooth.hearingaid.HearingAidService;
+import java.util.List;
/**
* Defines methods used for synchronization between HFP and A2DP
@@ -113,6 +115,17 @@
*/
public boolean suspendA2DP(int reason, BluetoothDevice device){
int a2dpState = isA2dpPlaying();
+
+ List<BluetoothDevice> HAActiveDevices = null;
+ HearingAidService mHaService = HearingAidService.getHearingAidService();
+ if (mHaService != null) {
+ HAActiveDevices = mHaService.getActiveDevices();
+ }
+ if (HAActiveDevices != null) {
+ Log.d(TAG,"Ignore suspendA2DP if active device is HearingAid");
+ return false;
+ }
+
Log.d(TAG," suspendA2DP currPlayingState = "+ a2dpState + " for reason " + reason
+ "mA2dpSuspendTriggered = " + mA2dpSuspendTriggered + " for device " + device);
if (mA2dpSuspendTriggered != A2DP_SUSPENDED_NOT_TRIGGERED) {