Bug 1091575: Add support for Bluetooth daemon backend (under bluetooth2/), r=btian

This commit is contained in:
Thomas Zimmermann 2014-11-14 10:04:34 +01:00
parent 4a0e8a500e
commit b59b33a1d8
2 changed files with 19 additions and 3 deletions

View File

@ -8,6 +8,9 @@
#ifdef MOZ_B2G_BT_BLUEDROID
#include "BluetoothHALInterface.h"
#endif
#ifdef MOZ_B2G_BT_DAEMON
#include "BluetoothDaemonInterface.h"
#endif
BEGIN_BLUETOOTH_NAMESPACE
@ -124,15 +127,19 @@ BluetoothInterface*
BluetoothInterface::GetInstance()
{
/* Here's where we decide which implementation to use. Currently
* there is only Bluedroid, but others are possible. Having multiple
* interfaces built-in and selecting the correct one at runtime could
* also be an option.
* there is only Bluedroid and the Bluetooth daemon, but others are
* possible. Having multiple interfaces built-in and selecting the
* correct one at runtime could also be an option.
*/
#ifdef MOZ_B2G_BT_BLUEDROID
return BluetoothHALInterface::GetInstance();
#else
#ifdef MOZ_B2G_BT_DAEMON
return BluetoothDaemonInterface::GetInstance();
#else
return nullptr;
#endif
#endif
}
BluetoothInterface::BluetoothInterface()

View File

@ -52,6 +52,13 @@
/**
* B2G bluedroid:
* MOZ_B2G_BT and MOZ_B2G_BT_BLUEDROID are both defined;
* MOZ_B2G_BLUEZ or MOZ_B2G_DAEMON are not defined.
*/
#include "BluetoothServiceBluedroid.h"
#elif defined(MOZ_B2G_BT_DAEMON)
/**
* B2G Bluetooth daemon:
* MOZ_B2G_BT, MOZ_B2G_BLUEDROID and MOZ_B2G_BT_DAEMON are defined;
* MOZ_B2G_BLUEZ is not defined.
*/
#include "BluetoothServiceBluedroid.h"
@ -228,6 +235,8 @@ BluetoothService::Create()
return new BluetoothDBusService();
#elif defined(MOZ_B2G_BT_BLUEDROID)
return new BluetoothServiceBluedroid();
#elif defined(MOZ_B2G_BT_DAEMON)
return new BluetoothServiceBluedroid();
#endif
#elif defined(MOZ_BLUETOOTH_DBUS)
return new BluetoothDBusService();