mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1038645: Asynchronous |BluetoothHandsfreeInterface::VolumeControl| (under bluetooth2/), r=btian
This commit is contained in:
parent
2f9bac6204
commit
c6f9bb3981
@ -720,11 +720,16 @@ BluetoothHandsfreeInterface::StopVoiceRecognition(
|
||||
|
||||
/* Volume */
|
||||
|
||||
bt_status_t
|
||||
BluetoothHandsfreeInterface::VolumeControl(bthf_volume_type_t aType,
|
||||
int aVolume)
|
||||
void
|
||||
BluetoothHandsfreeInterface::VolumeControl(
|
||||
bthf_volume_type_t aType, int aVolume, BluetoothHandsfreeResultHandler* aRes)
|
||||
{
|
||||
return mInterface->volume_control(aType, aVolume);
|
||||
bt_status_t status = mInterface->volume_control(aType, aVolume);
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothHandsfreeResult(
|
||||
aRes, &BluetoothHandsfreeResultHandler::VolumeControl, status);
|
||||
}
|
||||
}
|
||||
|
||||
/* Device status */
|
||||
|
@ -134,7 +134,8 @@ public:
|
||||
|
||||
/* Volume */
|
||||
|
||||
bt_status_t VolumeControl(bthf_volume_type_t aType, int aVolume);
|
||||
void VolumeControl(bthf_volume_type_t aType, int aVolume,
|
||||
BluetoothHandsfreeResultHandler* aRes);
|
||||
|
||||
/* Device status */
|
||||
|
||||
|
@ -968,6 +968,17 @@ BluetoothHfpManager::NotifyDialer(const nsAString& aCommand)
|
||||
BT_ENSURE_TRUE_VOID_BROADCAST_SYSMSG(type, parameters);
|
||||
}
|
||||
|
||||
class VolumeControlResultHandler MOZ_FINAL
|
||||
: public BluetoothHandsfreeResultHandler
|
||||
{
|
||||
public:
|
||||
void OnError(bt_status_t aStatus) MOZ_OVERRIDE
|
||||
{
|
||||
BT_WARNING("BluetoothHandsfreeInterface::VolumeControl failed: %d",
|
||||
(int)aStatus);
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData)
|
||||
{
|
||||
@ -1012,9 +1023,8 @@ BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData)
|
||||
// Only send volume back when there's a connected headset
|
||||
if (IsConnected()) {
|
||||
NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
|
||||
NS_ENSURE_TRUE_VOID(BT_STATUS_SUCCESS ==
|
||||
sBluetoothHfpInterface->VolumeControl(BTHF_VOLUME_TYPE_SPK,
|
||||
mCurrentVgs));
|
||||
sBluetoothHfpInterface->VolumeControl(BTHF_VOLUME_TYPE_SPK, mCurrentVgs,
|
||||
new VolumeControlResultHandler());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user