Bug 1029390: Asynchronous |BluetoothAvrcpInterface::SetVolume|, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Wed, 23 Jul 2014 07:56:23 +0200
changeset 195577 99870e191644c8d06700b81a8e7c9d347ad4a8ed
parent 195576 1a8d196dfcc1d08b13ed3d723e5653235093ba15
child 195578 8723c41b7e66ee4845619b510f578b120959a1da
push id27187
push usercbook@mozilla.com
push dateWed, 23 Jul 2014 10:59:56 +0000
treeherdermozilla-central@d0f6259e8446 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1029390
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1029390: Asynchronous |BluetoothAvrcpInterface::SetVolume|, r=shuang
dom/bluetooth/bluedroid/BluetoothInterface.cpp
dom/bluetooth/bluedroid/BluetoothInterface.h
--- a/dom/bluetooth/bluedroid/BluetoothInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothInterface.cpp
@@ -1124,24 +1124,30 @@ BluetoothAvrcpInterface::RegisterNotific
   bt_status_t status = mInterface->register_notification_rsp(aEventId, aType,
                                                              aPParam);
   if (aRes) {
     DispatchBluetoothAvrcpResult(
       aRes, &BluetoothAvrcpResultHandler::RegisterNotificationRsp, status);
   }
 }
 
-bt_status_t
-BluetoothAvrcpInterface::SetVolume(uint8_t aVolume)
+void
+BluetoothAvrcpInterface::SetVolume(uint8_t aVolume,
+                                   BluetoothAvrcpResultHandler* aRes)
 {
 #if ANDROID_VERSION >= 19
-  return mInterface->set_volume(aVolume);
+  bt_status_t status = mInterface->set_volume(aVolume);
 #else
-  return BT_STATUS_UNSUPPORTED;
+  bt_status_t status = BT_STATUS_UNSUPPORTED;
 #endif
+
+  if (aRes) {
+    DispatchBluetoothAvrcpResult(
+      aRes, &BluetoothAvrcpResultHandler::SetVolume, status);
+  }
 }
 #endif
 
 //
 // Bluetooth Core Interface
 //
 
 typedef
--- a/dom/bluetooth/bluedroid/BluetoothInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothInterface.h
@@ -292,17 +292,17 @@ public:
   void SetPlayerAppValueRsp(btrc_status_t aRspStatus,
                             BluetoothAvrcpResultHandler* aRes);
 
   void RegisterNotificationRsp(btrc_event_id_t aEventId,
                                btrc_notification_type_t aType,
                                btrc_register_notification_t* aPParam,
                                BluetoothAvrcpResultHandler* aRes);
 
-  bt_status_t SetVolume(uint8_t aVolume);
+  void SetVolume(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes);
 
 protected:
   BluetoothAvrcpInterface(const btrc_interface_t* aInterface);
   ~BluetoothAvrcpInterface();
 
 private:
   const btrc_interface_t* mInterface;
 #endif