Merge "Bluetooth Multi Connect" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3c0f1f1aa2
@@ -122,9 +122,6 @@ final class A2dpSinkProfile implements LocalBluetoothProfile {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (BluetoothDevice src : srcs) {
|
||||
mService.disconnect(src);
|
||||
}
|
||||
}
|
||||
return mService.connect(device);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user