Backed out changeset 150544a28405 (bug 1167064) for B2G mochitest failures.

This commit is contained in:
Ryan VanderMeulen 2015-06-08 15:41:26 -04:00
parent 7e860af399
commit 1899ebf24d
15 changed files with 147 additions and 147 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 1167064: Switch to bluetooth APIv2.
Bug 1165422 - Updated the Android SDK versions

View File

@ -436,13 +436,13 @@ LOCAL_INCLUDES += [
'/xpcom/ds',
]
if CONFIG['MOZ_B2G_BT_API_V1']:
if CONFIG['MOZ_B2G_BT_API_V2']:
LOCAL_INCLUDES += [
'../bluetooth/bluetooth1',
'../bluetooth/bluetooth2',
]
else:
LOCAL_INCLUDES += [
'../bluetooth/bluetooth2',
'../bluetooth/bluetooth1',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':

View File

@ -91,13 +91,13 @@ if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
'/dom/system/gonk',
]
if CONFIG['MOZ_B2G_BT_API_V1']:
if CONFIG['MOZ_B2G_BT_API_V2']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
'/dom/bluetooth/bluetooth2',
]
else:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth2',
'/dom/bluetooth/bluetooth1',
]
FINAL_LIBRARY = 'xul'

View File

@ -297,7 +297,7 @@ DispatchReplyError(BluetoothReplyRunnable* aRunnable,
MOZ_ASSERT(!aErrorStr.IsEmpty());
// Reply will be deleted by the runnable after running on main thread
#ifndef MOZ_B2G_BT_API_V1
#if MOZ_B2G_BT_API_V2
BluetoothReply* reply =
new BluetoothReply(BluetoothReplyError(STATUS_FAIL, nsString(aErrorStr)));
#else
@ -317,7 +317,7 @@ DispatchReplyError(BluetoothReplyRunnable* aRunnable,
MOZ_ASSERT(aStatus != STATUS_SUCCESS);
// Reply will be deleted by the runnable after running on main thread
#ifndef MOZ_B2G_BT_API_V1
#if MOZ_B2G_BT_API_V2
BluetoothReply* reply =
new BluetoothReply(BluetoothReplyError(aStatus, EmptyString()));
#else
@ -344,7 +344,7 @@ DispatchStatusChangedEvent(const nsAString& aType,
BluetoothService* bs = BluetoothService::Get();
NS_ENSURE_TRUE_VOID(bs);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
bs->DistributeSignal(aType, NS_LITERAL_STRING(KEY_ADAPTER), data);
#else
BluetoothSignal signal(nsString(aType), NS_LITERAL_STRING(KEY_ADAPTER), data);

View File

@ -1065,7 +1065,7 @@ BluetoothA2dpManager::GetPlayStatusNotification()
return;
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
bs->DistributeSignal(NS_LITERAL_STRING(REQUEST_MEDIA_PLAYSTATUS_ID),
NS_LITERAL_STRING(KEY_ADAPTER));
#else

View File

@ -19,13 +19,13 @@
#include "BluetoothServiceBluedroid.h"
#include "BluetoothA2dpManager.h"
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
#include "BluetoothGattManager.h"
#else
// TODO: Support GATT
#endif
#include "BluetoothHfpManager.h"
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
#include "BluetoothHidManager.h"
#else
// TODO: Support HID
@ -41,7 +41,7 @@
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/unused.h"
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
#include "nsDataHashtable.h"
#endif
@ -63,7 +63,7 @@
} \
} while(0)
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
#define ENSURE_GATT_MGR_IS_READY_VOID(gatt, runnable) \
do { \
@ -947,7 +947,7 @@ BluetoothServiceBluedroid::StopInternal()
}
#endif
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
nsresult
BluetoothServiceBluedroid::GetAdaptersInternal(
BluetoothReplyRunnable* aRunnable)
@ -1039,7 +1039,7 @@ public:
{
MOZ_ASSERT(NS_IsMainThread());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
BT_WARNING("GetRemoteDeviceProperties(%s) failed: %d",
NS_ConvertUTF16toUTF8(mDeviceAddress).get(), aStatus);
@ -1083,7 +1083,7 @@ BluetoothServiceBluedroid::GetConnectedDevicePropertiesInternal(
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
BluetoothProfileManagerBase* profile =
BluetoothUuidHelper::GetBluetoothProfileManager(aServiceUuid);
if (!profile) {
@ -1148,7 +1148,7 @@ BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
int requestedDeviceCount = aDeviceAddress.Length();
if (requestedDeviceCount == 0) {
DispatchReplySuccess(aRunnable);
@ -1182,7 +1182,7 @@ public:
: mRunnable(aRunnable)
{ }
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void OnError(BluetoothStatus aStatus) override
{
MOZ_ASSERT(NS_IsMainThread());
@ -1214,7 +1214,7 @@ BluetoothServiceBluedroid::StartDiscoveryInternal(
MOZ_ASSERT(NS_IsMainThread());
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
sChangeDiscoveryRunnableArray.AppendElement(aRunnable);
#else
// Missing in bluetooth1
@ -1231,7 +1231,7 @@ public:
: mRunnable(aRunnable)
{ }
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void OnError(BluetoothStatus aStatus) override
{
MOZ_ASSERT(NS_IsMainThread());
@ -1256,7 +1256,7 @@ private:
BluetoothReplyRunnable* mRunnable;
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
class BluetoothServiceBluedroid::GetRemoteServicesResultHandler final
: public BluetoothResultHandler
{
@ -1310,7 +1310,7 @@ BluetoothServiceBluedroid::StopDiscoveryInternal(
MOZ_ASSERT(NS_IsMainThread());
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
sChangeDiscoveryRunnableArray.AppendElement(aRunnable);
#else
// Missing in bluetooth1
@ -1331,7 +1331,7 @@ public:
{
MOZ_ASSERT(NS_IsMainThread());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
sSetPropertyRunnableArray.RemoveElement(mRunnable);
DispatchReplyError(mRunnable, aStatus);
#else
@ -1388,7 +1388,7 @@ public:
void OnError(BluetoothStatus aStatus) override
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
sBondingRunnableArray.RemoveElement(mRunnable);
DispatchReplyError(mRunnable, aStatus);
#else
@ -1429,7 +1429,7 @@ public:
void OnError(BluetoothStatus aStatus) override
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
sUnbondingRunnableArray.RemoveElement(mRunnable);
DispatchReplyError(mRunnable, aStatus);
#else
@ -1458,7 +1458,7 @@ BluetoothServiceBluedroid::RemoveDeviceInternal(
return NS_OK;
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
class BluetoothServiceBluedroid::PinReplyResultHandler final
: public BluetoothResultHandler
{
@ -1540,7 +1540,7 @@ BluetoothServiceBluedroid::SetPinCodeInternal(
}
#endif
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothServiceBluedroid::SetPasskeyInternal(
const nsAString& aDeviceAddress, uint32_t aPasskey,
@ -1558,7 +1558,7 @@ BluetoothServiceBluedroid::SetPasskeyInternal(
}
#endif
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
class BluetoothServiceBluedroid::SspReplyResultHandler final
: public BluetoothResultHandler
{
@ -1641,7 +1641,7 @@ BluetoothServiceBluedroid::SetPairingConfirmationInternal(
}
#endif
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
bool
@ -1659,7 +1659,7 @@ BluetoothServiceBluedroid::PrepareAdapterInternal()
}
#endif
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothServiceBluedroid::NextBluetoothProfileController()
#else
@ -1679,7 +1679,7 @@ NextBluetoothProfileController()
}
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothServiceBluedroid::ConnectDisconnect(
bool aConnect, const nsAString& aDeviceAddress,
@ -1728,7 +1728,7 @@ BluetoothServiceBluedroid::Disconnect(
ConnectDisconnect(false, aDeviceAddress, aRunnable, aServiceUuid);
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
bool
BluetoothServiceBluedroid::IsConnected(uint16_t aProfileId)
{
@ -1953,7 +1953,7 @@ BluetoothServiceBluedroid::ToggleCalls(BluetoothReplyRunnable* aRunnable)
{
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
uint16_t
@ -2062,7 +2062,7 @@ public:
void
BluetoothServiceBluedroid::AdapterStateChangedNotification(bool aState)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
BT_LOGR("BT_STATE: %d", aState);
@ -2235,7 +2235,7 @@ BluetoothServiceBluedroid::AdapterPropertiesNotification(
BluetoothStatus aStatus, int aNumProperties,
const BluetoothProperty* aProperties)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
InfallibleTArray<BluetoothNamedValue> propertiesArray;
@ -2390,7 +2390,7 @@ BluetoothServiceBluedroid::RemoteDevicePropertiesNotification(
BluetoothStatus aStatus, const nsAString& aBdAddr,
int aNumProperties, const BluetoothProperty* aProperties)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
InfallibleTArray<BluetoothNamedValue> propertiesArray;
@ -2596,7 +2596,7 @@ void
BluetoothServiceBluedroid::DeviceFoundNotification(
int aNumProperties, const BluetoothProperty* aProperties)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
BluetoothValue propertyValue;
@ -2684,7 +2684,7 @@ BluetoothServiceBluedroid::DeviceFoundNotification(
void
BluetoothServiceBluedroid::DiscoveryStateChangedNotification(bool aState)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
sAdapterDiscovering = aState;
@ -2727,7 +2727,7 @@ BluetoothServiceBluedroid::PinRequestNotification(const nsAString& aRemoteBdAddr
const nsAString& aBdName,
uint32_t aCod)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
InfallibleTArray<BluetoothNamedValue> propertiesArray;
@ -2766,7 +2766,7 @@ BluetoothServiceBluedroid::SspRequestNotification(
{
MOZ_ASSERT(NS_IsMainThread());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
InfallibleTArray<BluetoothNamedValue> propertiesArray;
nsAutoString passkey;
nsAutoString pairingType;
@ -2826,7 +2826,7 @@ BluetoothServiceBluedroid::BondStateChangedNotification(
BluetoothStatus aStatus, const nsAString& aRemoteBdAddr,
BluetoothBondState aState)
{
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(NS_IsMainThread());
if (aState == BOND_STATE_BONDING) {
@ -3023,7 +3023,7 @@ BluetoothServiceBluedroid::LeTestModeNotification(BluetoothStatus aStatus,
// FIXME: This will be implemented in the later patchset
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// TODO: Support EnergyInfoNotification
#else
void
@ -3059,7 +3059,7 @@ BluetoothServiceBluedroid::BackendErrorNotification(bool aCrashed)
sIsRestart = true;
BT_LOGR("Recovery step2: stop bluetooth");
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
StopBluetooth(false, nullptr);
#else
StopBluetooth(false);

View File

@ -7,7 +7,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothservicebluedroid_h__
#define mozilla_dom_bluetooth_bluetoothservicebluedroid_h__
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
#include "BluetoothCommon.h"
#include "BluetoothInterface.h"

View File

@ -91,7 +91,7 @@ USING_BLUETOOTH_NAMESPACE
#define TIMEOUT_FORCE_TO_DISABLE_BT 5
#define BT_LAZY_THREAD_TIMEOUT_MS 3000
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// missing on blutooth2
#else
// Set Class of Device value bit
@ -149,7 +149,7 @@ public:
return true;
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// TODO: This is the wrong place for handling manager classes
BluetoothProfileManagerBase* profile;
profile = BluetoothHfpManager::Get();
@ -627,7 +627,7 @@ public:
BluetoothService* bs = BluetoothService::Get();
NS_ENSURE_TRUE_VOID(bs);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
bs->AdapterAddedReceived();
@ -663,7 +663,7 @@ private:
bool mDelay;
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
class InternalStopDiscoveryTask : public nsRunnable
@ -918,7 +918,7 @@ HasAudioService(uint32_t aCodValue)
return ((aCodValue & 0x200000) == 0x200000);
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
static bool
ContainsIcon(const InfallibleTArray<BluetoothNamedValue>& aProperties)
{
@ -1782,7 +1782,7 @@ public:
{
MOZ_ASSERT(NS_IsMainThread());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
BluetoothService* bs = BluetoothService::Get();
NS_ENSURE_TRUE(bs, NS_ERROR_FAILURE);
@ -1886,7 +1886,7 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
BluetoothNamedValue(NS_LITERAL_STRING("Path"),
GetObjectPathFromAddress(signalPath, address)));
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
if (!ContainsIcon(properties)) {
#else
if (FindProperty(properties, "Icon") < 0) {
@ -1908,7 +1908,7 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
}
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
if (FindProperty(properties, "Class") < 0) {
@ -1987,7 +1987,7 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
sAdapterProperties,
ArrayLength(sAdapterProperties));
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
BluetoothNamedValue& property = v.get_ArrayOfBluetoothNamedValue()[0];
@ -2020,7 +2020,7 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
// "bluetooth-pairedstatuschanged" from BluetoothService.
BluetoothValue newValue(v);
ToLowerCase(newValue.get_ArrayOfBluetoothNamedValue()[0].name());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
BluetoothSignal signal(NS_LITERAL_STRING("pairedstatuschanged"),
NS_LITERAL_STRING(KEY_LOCAL_AGENT),
newValue);
@ -2294,7 +2294,7 @@ public:
}
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
nsresult
BluetoothDBusService::StartInternal(BluetoothReplyRunnable* aRunnable)
{
@ -2429,7 +2429,7 @@ public:
}
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
nsresult
BluetoothDBusService::StopInternal(BluetoothReplyRunnable* aRunnable)
{
@ -2587,7 +2587,7 @@ private:
nsRefPtr<BluetoothReplyRunnable> mRunnable;
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
nsresult
BluetoothDBusService::GetAdaptersInternal(BluetoothReplyRunnable* aRunnable)
{
@ -2639,7 +2639,7 @@ OnSendDiscoveryMessageReply(DBusMessage *aReply, void *aData)
errorStr.AssignLiteral("SendDiscovery failed");
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in blueooth2
#else
// aData may be a nullptr because we may call StopDiscovery internally when
@ -2672,7 +2672,7 @@ public:
, mRunnable(aRunnable)
{
MOZ_ASSERT(!mMessageName.IsEmpty());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
MOZ_ASSERT(mRunnable);
#else
// Missing in bluetooth1
@ -2710,7 +2710,7 @@ BluetoothDBusService::SendDiscoveryMessage(const char* aMessageName,
MOZ_ASSERT(!sAdapterPath.IsEmpty());
if (!IsReady()) {
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
#else
@ -2910,7 +2910,7 @@ public:
// Icon as audio-card. This is for PTS test TC_AG_COD_BV_02_I.
// As HFP specification defined that
// service class is "Audio" can be considered as HFP AG.
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
if (!ContainsIcon(devicePropertiesArray)) {
#else
if (FindProperty(devicePropertiesArray, "Icon") < 0) {
@ -2928,7 +2928,7 @@ public:
}
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
// Check whether the properties array contains CoD. If it doesn't, fallback to restore
@ -3111,7 +3111,7 @@ BluetoothDBusService::GetPairedDevicePropertiesInternal(
return NS_OK;
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
nsresult
BluetoothDBusService::FetchUuidsInternal(const nsAString& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
@ -3496,7 +3496,7 @@ private:
nsRefPtr<BluetoothReplyRunnable> mRunnable;
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothDBusService::PinReplyInternal(
const nsAString& aDeviceAddress, bool aAccept,
@ -3601,7 +3601,7 @@ private:
nsRefPtr<BluetoothReplyRunnable> mRunnable;
};
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothDBusService::SetPasskeyInternal(const nsAString& aDeviceAddress,
uint32_t aPasskey,
@ -3627,7 +3627,7 @@ BluetoothDBusService::SetPasskeyInternal(const nsAString& aDeviceAddress,
}
#endif
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothDBusService::SetPairingConfirmationInternal(
const nsAString& aDeviceAddress,
@ -3714,7 +3714,7 @@ BluetoothDBusService::Disconnect(const nsAString& aDeviceAddress,
ConnectDisconnect(false, aDeviceAddress, aRunnable, aServiceUuid);
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
bool
BluetoothDBusService::IsConnected(const uint16_t aServiceUuid)
{
@ -3787,7 +3787,7 @@ BluetoothDBusService::ToggleCalls(BluetoothReplyRunnable* aRunnable)
class OnUpdateSdpRecordsRunnable : public nsRunnable
{
public:
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
OnUpdateSdpRecordsRunnable(const nsAString& aObjectPath,
BluetoothProfileManagerBase* aManager)
: mManager(aManager)
@ -3818,7 +3818,7 @@ public:
return NS_OK;
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
void
@ -4013,7 +4013,7 @@ public:
MOZ_ASSERT(sDBusConnection);
MOZ_ASSERT(!sAdapterPath.IsEmpty());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
const nsString objectPath =
GetObjectPathFromAddress(sAdapterPath, mDeviceAddress);
@ -4055,7 +4055,7 @@ public:
}
protected:
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
// Missing in bluetooth2
#else
static void CreateDeviceCallback(DBusMessage* aMsg, void* aData)
@ -4096,7 +4096,7 @@ protected:
{
MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
nsRefPtr<OnUpdateSdpRecordsRunnable> r(
static_cast<OnUpdateSdpRecordsRunnable*>(aData));
NS_DispatchToMainThread(r);
@ -4124,7 +4124,7 @@ BluetoothDBusService::UpdateSdpRecords(const nsAString& aDeviceAddress,
{
MOZ_ASSERT(NS_IsMainThread());
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
Task* task = new UpdateSdpRecordsTask(aDeviceAddress, aManager);
DispatchToDBusThread(task);
#else
@ -4379,7 +4379,7 @@ BluetoothDBusService::SendMetaData(const nsAString& aTitle,
a2dp->GetTitle(prevTitle);
a2dp->GetAlbum(prevAlbum);
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
uint64_t mediaNumber = static_cast<uint64_t>(aMediaNumber);
if (mediaNumber != a2dp->GetMediaNumber() ||
!aTitle.Equals(prevTitle) ||
@ -4690,7 +4690,7 @@ BluetoothDBusService::UpdateNotification(ControlEventId aEventId,
DispatchToDBusThread(task);
}
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
void
BluetoothDBusService::StartLeScanInternal(
const nsTArray<nsString>& aServiceUuids,

View File

@ -47,7 +47,7 @@ public:
bool IsReady();
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
virtual nsresult StartInternal(BluetoothReplyRunnable* aRunnable) override;
virtual nsresult StopInternal(BluetoothReplyRunnable* aRunnable) override;
@ -109,7 +109,7 @@ public:
RemoveDeviceInternal(const nsAString& aDeviceObjectPath,
BluetoothReplyRunnable* aRunnable) override;
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
virtual void
PinReplyInternal(const nsAString& aDeviceAddress,
bool aAccept,
@ -153,7 +153,7 @@ public:
uint16_t aServiceUuid,
BluetoothReplyRunnable* aRunnable) override;
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
virtual bool
IsConnected(uint16_t aServiceUuid) override;
#else
@ -233,7 +233,7 @@ public:
SendInputMessage(const nsAString& aDeviceAddresses,
const nsAString& aMessage) override;
#ifndef MOZ_B2G_BT_API_V1
#ifdef MOZ_B2G_BT_API_V2
virtual void
StartLeScanInternal(const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable) override;

View File

@ -24,25 +24,7 @@ if CONFIG['MOZ_B2G_BT']:
'BluetoothRilListener.cpp'
]
if CONFIG['MOZ_B2G_BT_API_V1']:
SOURCES += [
'bluetooth1/BluetoothAdapter.cpp',
'bluetooth1/BluetoothDevice.cpp',
'bluetooth1/BluetoothManager.cpp',
'bluetooth1/BluetoothProfileController.cpp',
'bluetooth1/BluetoothPropertyContainer.cpp',
'bluetooth1/BluetoothReplyRunnable.cpp',
'bluetooth1/BluetoothService.cpp',
'bluetooth1/ipc/BluetoothChild.cpp',
'bluetooth1/ipc/BluetoothParent.cpp',
'bluetooth1/ipc/BluetoothServiceChildProcess.cpp',
]
LOCAL_INCLUDES += [
'bluetooth1',
'bluetooth1/ipc',
]
DEFINES['MOZ_B2G_BT_API_V1'] = True
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
SOURCES += [
'bluetooth2/BluetoothAdapter.cpp',
'bluetooth2/BluetoothClassOfDevice.cpp',
@ -67,6 +49,24 @@ if CONFIG['MOZ_B2G_BT']:
'bluetooth2',
'bluetooth2/ipc',
]
DEFINES['MOZ_B2G_BT_API_V2'] = True
else:
SOURCES += [
'bluetooth1/BluetoothAdapter.cpp',
'bluetooth1/BluetoothDevice.cpp',
'bluetooth1/BluetoothManager.cpp',
'bluetooth1/BluetoothProfileController.cpp',
'bluetooth1/BluetoothPropertyContainer.cpp',
'bluetooth1/BluetoothReplyRunnable.cpp',
'bluetooth1/BluetoothService.cpp',
'bluetooth1/ipc/BluetoothChild.cpp',
'bluetooth1/ipc/BluetoothParent.cpp',
'bluetooth1/ipc/BluetoothServiceChildProcess.cpp',
]
LOCAL_INCLUDES += [
'bluetooth1',
'bluetooth1/ipc',
]
#
# Bluetooth backends
@ -130,7 +130,7 @@ if CONFIG['MOZ_B2G_BT']:
LOCAL_INCLUDES += [
'bluedroid/hfp-fallback',
]
if not CONFIG['MOZ_B2G_BT_API_V1']:
if CONFIG['MOZ_B2G_BT_API_V2']:
SOURCES += [
'bluedroid/BluetoothGattManager.cpp',
]
@ -163,21 +163,7 @@ EXPORTS.mozilla.dom.bluetooth += [
'BluetoothCommon.h'
]
if CONFIG['MOZ_B2G_BT_API_V1']:
EXPORTS.mozilla.dom.bluetooth.ipc += [
'bluetooth1/ipc/BluetoothMessageUtils.h',
]
EXPORTS.mozilla.dom.bluetooth += [
'bluetooth1/BluetoothAdapter.h',
'bluetooth1/BluetoothDevice.h',
'bluetooth1/BluetoothManager.h',
]
IPDL_SOURCES += [
'bluetooth1/ipc/BluetoothTypes.ipdlh',
'bluetooth1/ipc/PBluetooth.ipdl',
'bluetooth1/ipc/PBluetoothRequest.ipdl',
]
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
EXPORTS.mozilla.dom.bluetooth.ipc += [
'bluetooth2/ipc/BluetoothMessageUtils.h',
]
@ -200,6 +186,20 @@ else:
'bluetooth2/ipc/PBluetooth.ipdl',
'bluetooth2/ipc/PBluetoothRequest.ipdl',
]
else:
EXPORTS.mozilla.dom.bluetooth.ipc += [
'bluetooth1/ipc/BluetoothMessageUtils.h',
]
EXPORTS.mozilla.dom.bluetooth += [
'bluetooth1/BluetoothAdapter.h',
'bluetooth1/BluetoothDevice.h',
'bluetooth1/BluetoothManager.h',
]
IPDL_SOURCES += [
'bluetooth1/ipc/BluetoothTypes.ipdlh',
'bluetooth1/ipc/PBluetooth.ipdl',
'bluetooth1/ipc/PBluetoothRequest.ipdl',
]
FAIL_ON_WARNINGS = True

View File

@ -162,16 +162,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk', 'qt'):
if CONFIG['MOZ_TOOLKIT_SEARCH']:
DEFINES['MOZ_TOOLKIT_SEARCH'] = True
if CONFIG['MOZ_B2G_BT_API_V1']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
'/dom/bluetooth/bluetooth1/ipc',
]
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth2',
'/dom/bluetooth/bluetooth2/ipc',
]
else:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
'/dom/bluetooth/bluetooth1/ipc',
]
JAR_MANIFESTS += ['jar.mn']

View File

@ -125,13 +125,13 @@ LOCAL_INCLUDES += [
'/dom/wifi',
]
if CONFIG['MOZ_B2G_BT_API_V1']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
]
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth2',
]
else:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
]
FINAL_LIBRARY = 'xul'

View File

@ -646,13 +646,7 @@ if CONFIG['MOZ_DEBUG']:
WEBIDL_FILES += ['TestInterfaceJS.webidl', 'TestInterfaceJSDictionaries.webidl']
if CONFIG['MOZ_B2G_BT']:
if CONFIG['MOZ_B2G_BT_API_V1']:
WEBIDL_FILES += [
'BluetoothAdapter.webidl',
'BluetoothDevice.webidl',
'BluetoothManager.webidl',
]
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
WEBIDL_FILES += [
'BluetoothAdapter2.webidl',
'BluetoothClassOfDevice.webidl',
@ -667,6 +661,12 @@ if CONFIG['MOZ_B2G_BT']:
'BluetoothPairingHandle.webidl',
'BluetoothPairingListener.webidl',
]
else:
WEBIDL_FILES += [
'BluetoothAdapter.webidl',
'BluetoothDevice.webidl',
'BluetoothManager.webidl',
]
if CONFIG['MOZ_SIMPLEPUSH']:
WEBIDL_FILES += [
@ -797,17 +797,17 @@ if CONFIG['MOZ_GAMEPAD']:
]
if CONFIG['MOZ_B2G_BT']:
if CONFIG['MOZ_B2G_BT_API_V1']:
GENERATED_EVENTS_WEBIDL_FILES += [
'BluetoothDiscoveryStateChangedEvent.webidl',
]
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
GENERATED_EVENTS_WEBIDL_FILES += [
'BluetoothAdapterEvent.webidl',
'BluetoothAttributeEvent.webidl',
'BluetoothGattCharacteristicEvent.webidl',
'BluetoothPairingEvent.webidl',
]
else:
GENERATED_EVENTS_WEBIDL_FILES += [
'BluetoothDiscoveryStateChangedEvent.webidl',
]
GENERATED_EVENTS_WEBIDL_FILES += [
'BluetoothDeviceEvent.webidl',

View File

@ -73,11 +73,11 @@ if CONFIG['MOZ_B2G_BT']:
LOCAL_INCLUDES += [
'/dom/bluetooth',
]
if CONFIG['MOZ_B2G_BT_API_V1']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
]
else:
if CONFIG['MOZ_B2G_BT_API_V2']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth2',
]
else:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
]

View File

@ -108,13 +108,13 @@ if CONFIG['MOZ_B2G_BT']:
LOCAL_INCLUDES += [
'/dom/bluetooth',
]
if CONFIG['MOZ_B2G_BT_API_V1']:
if CONFIG['MOZ_B2G_BT_API_V2']:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth1',
'/dom/bluetooth/bluetooth2',
]
else:
LOCAL_INCLUDES += [
'/dom/bluetooth/bluetooth2',
'/dom/bluetooth/bluetooth1',
]
if CONFIG['MOZ_WEBSPEECH']: