mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1050126: Convert Bluetooth A2DP data types in |BluetoothA2dpInterface| (under bluetooth2/), r=btian
With this patch |BluetoothA2dpInterface| is responsible for converting all Bluetooth data types to Bluedroid types. All callers have been adapted.
This commit is contained in:
parent
95f487bc6c
commit
f5815c691d
@ -844,10 +844,7 @@ BluetoothA2dpManager::Connect(const nsAString& aDeviceAddress,
|
||||
return;
|
||||
}
|
||||
|
||||
bt_bdaddr_t remoteAddress;
|
||||
StringToBdAddressType(aDeviceAddress, &remoteAddress);
|
||||
|
||||
sBtA2dpInterface->Connect(&remoteAddress, new ConnectResultHandler());
|
||||
sBtA2dpInterface->Connect(aDeviceAddress, new ConnectResultHandler());
|
||||
}
|
||||
|
||||
void
|
||||
@ -901,10 +898,7 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController)
|
||||
return;
|
||||
}
|
||||
|
||||
bt_bdaddr_t remoteAddress;
|
||||
StringToBdAddressType(mDeviceAddress, &remoteAddress);
|
||||
|
||||
sBtA2dpInterface->Disconnect(&remoteAddress, new DisconnectResultHandler());
|
||||
sBtA2dpInterface->Disconnect(mDeviceAddress, new DisconnectResultHandler());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1382,10 +1382,17 @@ BluetoothA2dpInterface::Cleanup(BluetoothA2dpResultHandler* aRes)
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothA2dpInterface::Connect(bt_bdaddr_t *aBdAddr,
|
||||
BluetoothA2dpInterface::Connect(const nsAString& aBdAddr,
|
||||
BluetoothA2dpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status = mInterface->connect(aBdAddr);
|
||||
bt_status_t status;
|
||||
bt_bdaddr_t bdAddr;
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
|
||||
status = mInterface->connect(&bdAddr);
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothA2dpResult(aRes, &BluetoothA2dpResultHandler::Connect,
|
||||
@ -1394,10 +1401,17 @@ BluetoothA2dpInterface::Connect(bt_bdaddr_t *aBdAddr,
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothA2dpInterface::Disconnect(bt_bdaddr_t *aBdAddr,
|
||||
BluetoothA2dpInterface::Disconnect(const nsAString& aBdAddr,
|
||||
BluetoothA2dpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status = mInterface->disconnect(aBdAddr);
|
||||
bt_status_t status;
|
||||
bt_bdaddr_t bdAddr;
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
|
||||
status = mInterface->disconnect(&bdAddr);
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothA2dpResult(aRes, &BluetoothA2dpResultHandler::Disconnect,
|
||||
|
@ -216,9 +216,9 @@ public:
|
||||
BluetoothA2dpResultHandler* aRes);
|
||||
void Cleanup(BluetoothA2dpResultHandler* aRes);
|
||||
|
||||
void Connect(bt_bdaddr_t *aBdAddr,
|
||||
void Connect(const nsAString& aBdAddr,
|
||||
BluetoothA2dpResultHandler* aRes);
|
||||
void Disconnect(bt_bdaddr_t *aBdAddr,
|
||||
void Disconnect(const nsAString& aBdAddr,
|
||||
BluetoothA2dpResultHandler* aRes);
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user