Merge "Bluetooth Multi Connect" into oc-dev

This commit is contained in:
Joseph Pirozzo
2017-04-06 15:19:24 +00:00
committed by Android (Google) Code Review
4 changed files with 4 additions and 15 deletions

View File

@@ -122,9 +122,6 @@ final class A2dpSinkProfile implements LocalBluetoothProfile {
return true;
}
}
for (BluetoothDevice src : srcs) {
mService.disconnect(src);
}
}
return mService.connect(device);
}

View File

@@ -132,11 +132,6 @@ final class HfpClientProfile implements LocalBluetoothProfile {
return true;
}
}
// Handsfree HF only supports one source connection and hence it is OK to disconnect
// the only connected device here.
for (BluetoothDevice src : srcs) {
mService.disconnect(src);
}
}
return mService.connect(device);
}

View File

@@ -115,10 +115,10 @@ public final class MapClientProfile implements LocalBluetoothProfile {
public boolean connect(BluetoothDevice device) {
if (mService == null) return false;
List<BluetoothDevice> connectedDevices = getConnectedDevices();
if (connectedDevices != null) {
for (BluetoothDevice connectedDevice : connectedDevices) {
mService.disconnect(connectedDevice);
}
if (connectedDevices != null && connectedDevices.contains(device)) {
// Connect to same device, Ignore it
Log.d(TAG,"Ignoring Connect");
return true;
}
return mService.connect(device);
}

View File

@@ -144,9 +144,6 @@ final class PbapClientProfile implements LocalBluetoothProfile {
return true;
}
}
for (BluetoothDevice src : srcs) {
mService.disconnect(src);
}
}
Log.d(TAG,"PBAPClientProfile attempting to connect to " + device.getAddress());