Bug 1029389: Asynchronous Bluetooth Handsfree voice-recognition functions, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Tue, 15 Jul 2014 10:56:54 +0200
changeset 216020 41d0167e390574c2eb20a8a69adfa1991e714b0e
parent 216019 a1a2aa084ce06fcc7b3b851a19ea9134a0f2cc50
child 216021 76083991c73d00d77d5fb63ddbfb548c8d8ef171
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1029389
milestone33.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 1029389: Asynchronous Bluetooth Handsfree voice-recognition functions, r=shuang
dom/bluetooth/bluedroid/BluetoothInterface.cpp
dom/bluetooth/bluedroid/BluetoothInterface.h
--- a/dom/bluetooth/bluedroid/BluetoothInterface.cpp
+++ b/dom/bluetooth/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/bluetooth/bluedroid/BluetoothInterface.h
+++ b/dom/bluetooth/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,