diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp index 78fd03d7b247..df53d145e1f9 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp @@ -656,17 +656,31 @@ BluetoothInterface::SetRemoteDeviceProperty(bt_bdaddr_t* aRemoteAddr, /* Remote Services */ -int +void BluetoothInterface::GetRemoteServiceRecord(bt_bdaddr_t* aRemoteAddr, - bt_uuid_t* aUuid) + bt_uuid_t* aUuid, + BluetoothResultHandler* aRes) { - return mInterface->get_remote_service_record(aRemoteAddr, aUuid); + int status = mInterface->get_remote_service_record(aRemoteAddr, aUuid); + + if (aRes) { + DispatchBluetoothResult(aRes, + &BluetoothResultHandler::GetRemoteServiceRecord, + status); + } } -int -BluetoothInterface::GetRemoteServices(bt_bdaddr_t* aRemoteAddr) +void +BluetoothInterface::GetRemoteServices(bt_bdaddr_t* aRemoteAddr, + BluetoothResultHandler* aRes) { - return mInterface->get_remote_services(aRemoteAddr); + int status = mInterface->get_remote_services(aRemoteAddr); + + if (aRes) { + DispatchBluetoothResult(aRes, + &BluetoothResultHandler::GetRemoteServices, + status); + } } /* Discovery */ diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.h b/dom/bluetooth2/bluedroid/BluetoothInterface.h index db9fb6d481d2..73dc674d576e 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.h +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h @@ -258,9 +258,11 @@ public: /* Remote Services */ - int GetRemoteServiceRecord(bt_bdaddr_t* aRemoteAddr, - bt_uuid_t* aUuid); - int GetRemoteServices(bt_bdaddr_t* aRemoteAddr); + void GetRemoteServiceRecord(bt_bdaddr_t* aRemoteAddr, + bt_uuid_t* aUuid, + BluetoothResultHandler* aRes); + void GetRemoteServices(bt_bdaddr_t* aRemoteAddr, + BluetoothResultHandler* aRes); /* Discovery */