Bug 1159267: Share Bluedroid's OPP manager between Bluetooth v1 and v2, r=btian

Bluedroid's OPP manager is the same for Bluetooth v1 and v2; except
for bug 1118177, which is fixed in v1. So with this patch, the v1
implementation is used for both variants.
This commit is contained in:
Thomas Zimmermann 2015-05-06 09:58:04 +02:00
parent 40a3688ae6
commit 77ad1b350f
2 changed files with 0 additions and 20 deletions

View File

@ -89,15 +89,11 @@ BluetoothOppManager::Observe(nsISupports* aSubject,
{
MOZ_ASSERT(sBluetoothOppManager);
#ifdef MOZ_B2G_BT_API_V2
// Removed in bluetooth2
#else
// if state of any volume was changed
if (!strcmp(aTopic, NS_VOLUME_STATE_CHANGED)) {
HandleVolumeStateChanged(aSubject);
return NS_OK;
}
#endif
if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
HandleShutdown();
@ -226,13 +222,9 @@ BluetoothOppManager::~BluetoothOppManager()
BT_WARNING("Failed to remove shutdown observer!");
}
#ifdef MOZ_B2G_BT_API_V2
// Removed in bluetooth2
#else
if (NS_FAILED(obs->RemoveObserver(this, NS_VOLUME_STATE_CHANGED))) {
BT_WARNING("Failed to remove volume observer!");
}
#endif
}
bool
@ -245,14 +237,10 @@ BluetoothOppManager::Init()
return false;
}
#ifdef MOZ_B2G_BT_API_V2
// Removed in bluetooth2
#else
if (NS_FAILED(obs->AddObserver(this, NS_VOLUME_STATE_CHANGED, false))) {
BT_WARNING("Failed to add ns volume observer!");
return false;
}
#endif
/**
* We don't start listening here as BluetoothServiceBluedroid calls Listen()
@ -321,9 +309,6 @@ BluetoothOppManager::HandleShutdown()
sBluetoothOppManager = nullptr;
}
#ifdef MOZ_B2G_BT_API_V2
// Removed in bluetooth2
#else
void
BluetoothOppManager::HandleVolumeStateChanged(nsISupports* aSubject)
{
@ -357,7 +342,6 @@ BluetoothOppManager::HandleVolumeStateChanged(nsISupports* aSubject)
Disconnect(nullptr);
}
}
#endif
bool
BluetoothOppManager::Listen()

View File

@ -77,11 +77,7 @@ private:
bool Init();
void HandleShutdown();
#ifdef MOZ_B2G_BT_API_V2
// Removed in bluetooth2
#else
void HandleVolumeStateChanged(nsISupports* aSubject);
#endif
void StartFileTransfer();
void StartSendingNextFile();