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.
This commit is contained in:
Thomas Zimmermann 2014-07-29 10:47:31 +02:00
parent 8936fb4f3b
commit 11e265c36c
2 changed files with 12 additions and 4 deletions

View File

@ -148,7 +148,7 @@ BluetoothHfpManager::Init()
// static
void
BluetoothHfpManager::InitHfpInterface()
BluetoothHfpManager::InitHfpInterface(BluetoothProfileResultHandler* aRes)
{
MOZ_ASSERT(NS_IsMainThread());
@ -157,11 +157,15 @@ BluetoothHfpManager::InitHfpInterface()
* 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());
@ -170,6 +174,10 @@ BluetoothHfpManager::DeinitHfpInterface()
* Implement DeinitHfpInterface() for applications that want to create SCO
* link without a HFP connection (e.g., VoIP).
*/
if (aRes) {
aRes->Deinit();
}
}
void

View File

@ -30,8 +30,8 @@ public:
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();