Bluetooth: Multi HF support
Add multi hf support in Telecomm service.
Returns AudioOn state and Connection state for
specific HS.
bug 16519158
Change-Id: Id174621b31895773a9dc655edb38fa6084586462
diff --git a/src/com/android/telecomm/BluetoothManager.java b/src/com/android/telecomm/BluetoothManager.java
index efdb724..25adbf5 100644
--- a/src/com/android/telecomm/BluetoothManager.java
+++ b/src/com/android/telecomm/BluetoothManager.java
@@ -140,12 +140,12 @@
List<BluetoothDevice> deviceList = mBluetoothHeadset.getConnectedDevices();
if (deviceList.size() > 0) {
- BluetoothDevice device = deviceList.get(0);
isConnected = true;
-
- Log.v(this, " - headset state = " + mBluetoothHeadset.getConnectionState(device));
- Log.v(this, " - headset address: " + device);
- Log.v(this, " - isConnected: " + isConnected);
+ for (int i = 0; i < deviceList.size(); i++) {
+ BluetoothDevice device = deviceList.get(i);
+ Log.v(this, "state = " + mBluetoothHeadset.getConnectionState(device)
+ + "for headset: " + device);
+ }
}
}
@@ -166,10 +166,16 @@
if (deviceList.isEmpty()) {
return false;
}
- BluetoothDevice device = deviceList.get(0);
- boolean isAudioOn = mBluetoothHeadset.isAudioConnected(device);
- Log.v(this, "isBluetoothAudioConnected: ==> isAudioOn = " + isAudioOn);
- return isAudioOn;
+ for (int i = 0; i < deviceList.size(); i++) {
+ BluetoothDevice device = deviceList.get(i);
+ boolean isAudioOn = mBluetoothHeadset.isAudioConnected(device);
+ Log.v(this, "isBluetoothAudioConnected: ==> isAudioOn = " + isAudioOn
+ + "for headset: " + device);
+ if (isAudioOn) {
+ return true;
+ }
+ }
+ return false;
}
/**