mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
40a3688ae6
commit
77ad1b350f
@ -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()
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user