Bug 1045461: Fix HFP fallback code to work with latest Bluetooth changes (under bluetooth2/), r=btian
authorThomas Zimmermann <tdz@users.sourceforge.net>
Tue, 29 Jul 2014 10:47:31 +0200
changeset 196542 447914859ecd0122876c476c38813fd82d9bd081
parent 196541 fd7b28405e87f46da5cfb3b8da16c4990c813ad7
child 196543 7a19287696465e3a8429bbb3d2f1958543511cd9
push id27219
push userkwierso@gmail.com
push dateTue, 29 Jul 2014 23:42:32 +0000
treeherdermozilla-central@3b682051f3ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtian
bugs1045461
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 1045461: Fix HFP fallback code to work with latest Bluetooth changes (under bluetooth2/), r=btian Recent patches to Bluetooth introduced asynchronous initialization of profile manager. The code in hfp-fallback was not adapted then. This patch updates the broken code.
dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.cpp
dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.h
--- a/dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.cpp
+++ b/dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.cpp
@@ -143,38 +143,46 @@ BluetoothHfpManager::Init()
     return false;
   }
 
   return true;
 }
 
 // static
 void
-BluetoothHfpManager::InitHfpInterface()
+BluetoothHfpManager::InitHfpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   /**
    * TODO:
    *   Implement InitHfpInterface() for applications that want to create SCO
    *   link without a HFP connection (e.g., VoIP).
    */
+
+  if (aRes) {
+    aRes->Init();
+  }
 }
 
 // static
 void
-BluetoothHfpManager::DeinitHfpInterface()
+BluetoothHfpManager::DeinitHfpInterface(BluetoothProfileResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   /**
    * TODO:
    *   Implement DeinitHfpInterface() for applications that want to create SCO
    *   link without a HFP connection (e.g., VoIP).
    */
+
+  if (aRes) {
+    aRes->Deinit();
+  }
 }
 
 void
 BluetoothHfpManager::HandleShutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
   sInShutdown = true;
   sBluetoothHfpManager = nullptr;
--- a/dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.h
+++ b/dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.h
@@ -25,18 +25,18 @@ public:
   BT_DECL_HFP_MGR_BASE
   virtual void GetName(nsACString& aName)
   {
     aName.AssignLiteral("Fallback HFP/HSP");
   }
 
   static BluetoothHfpManager* Get();
   virtual ~BluetoothHfpManager() { }
-  static void InitHfpInterface();
-  static void DeinitHfpInterface();
+  static void InitHfpInterface(BluetoothProfileResultHandler* aRes);
+  static void DeinitHfpInterface(BluetoothProfileResultHandler* aRes);
 
   bool ConnectSco();
   bool DisconnectSco();
 
 private:
   BluetoothHfpManager() { }
   bool Init();
   void HandleShutdown();