Bug 1038645: Asynchronous Bluetooth Handsfree voice-recognition functions (under bluetooth2/), r=btian
authorThomas Zimmermann <tdz@users.sourceforge.net>
Tue, 22 Jul 2014 13:53:28 +0200
changeset 195489 f1ebd0cb6df25a4f49033815678ac38b688a2714
parent 195488 87417c017cee77f30abf43fb0f51eca2884ef4b1
child 195490 833f317b1553f348c8bcb6d33bfe06dab4f59e65
push id27183
push useremorley@mozilla.com
push dateTue, 22 Jul 2014 16:28:10 +0000
treeherdermozilla-central@e5ced39f443b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtian
bugs1038645
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 1038645: Asynchronous Bluetooth Handsfree voice-recognition functions (under bluetooth2/), r=btian
dom/bluetooth2/bluedroid/BluetoothInterface.cpp
dom/bluetooth2/bluedroid/BluetoothInterface.h
--- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp
+++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp
@@ -689,26 +689,38 @@ BluetoothHandsfreeInterface::DisconnectA
   if (aRes) {
     DispatchBluetoothHandsfreeResult(
       aRes, &BluetoothHandsfreeResultHandler::DisconnectAudio, status);
   }
 }
 
 /* Voice Recognition */
 
-bt_status_t
-BluetoothHandsfreeInterface::StartVoiceRecognition()
+void
+BluetoothHandsfreeInterface::StartVoiceRecognition(
+  BluetoothHandsfreeResultHandler* aRes)
 {
-  return mInterface->start_voice_recognition();
+  bt_status_t status = mInterface->start_voice_recognition();
+
+  if (aRes) {
+    DispatchBluetoothHandsfreeResult(
+      aRes, &BluetoothHandsfreeResultHandler::StartVoiceRecognition, status);
+  }
 }
 
-bt_status_t
-BluetoothHandsfreeInterface::StopVoiceRecognition()
+void
+BluetoothHandsfreeInterface::StopVoiceRecognition(
+  BluetoothHandsfreeResultHandler* aRes)
 {
-  return mInterface->stop_voice_recognition();
+  bt_status_t status = mInterface->stop_voice_recognition();
+
+  if (aRes) {
+    DispatchBluetoothHandsfreeResult(
+      aRes, &BluetoothHandsfreeResultHandler::StopVoiceRecognition, status);
+  }
 }
 
 /* Volume */
 
 bt_status_t
 BluetoothHandsfreeInterface::VolumeControl(bthf_volume_type_t aType,
                                            int aVolume)
 {
--- a/dom/bluetooth2/bluedroid/BluetoothInterface.h
+++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h
@@ -124,18 +124,18 @@ public:
                   BluetoothHandsfreeResultHandler* aRes);
   void ConnectAudio(bt_bdaddr_t* aBdAddr,
                     BluetoothHandsfreeResultHandler* aRes);
   void DisconnectAudio(bt_bdaddr_t* aBdAddr,
                        BluetoothHandsfreeResultHandler* aRes);
 
   /* Voice Recognition */
 
-  bt_status_t StartVoiceRecognition();
-  bt_status_t StopVoiceRecognition();
+  void StartVoiceRecognition(BluetoothHandsfreeResultHandler* aRes);
+  void StopVoiceRecognition(BluetoothHandsfreeResultHandler* aRes);
 
   /* Volume */
 
   bt_status_t VolumeControl(bthf_volume_type_t aType, int aVolume);
 
   /* Device status */
 
   bt_status_t DeviceStatusNotification(bthf_network_state_t aNtkState,