mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 03:05:34 +00:00
Backout 8288c4940d1e (bug 818696) for crashes
This commit is contained in:
parent
5940a5c8f1
commit
ac14c441b0
@ -151,7 +151,6 @@ static const char* sBluetoothDBusSignals[] =
|
||||
static nsAutoPtr<RawDBusConnection> gThreadConnection;
|
||||
static nsDataHashtable<nsStringHashKey, DBusMessage* > sPairingReqTable;
|
||||
static nsDataHashtable<nsStringHashKey, DBusMessage* > sAuthorizeReqTable;
|
||||
static bool sIsPairing = false;
|
||||
typedef void (*UnpackFunc)(DBusMessage*, DBusError*, BluetoothValue&, nsAString&);
|
||||
|
||||
class DistributeBluetoothSignalTask : public nsRunnable {
|
||||
@ -820,12 +819,8 @@ RunDBusCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable,
|
||||
void
|
||||
GetObjectPathCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable)
|
||||
{
|
||||
if (sIsPairing) {
|
||||
RunDBusCallback(aMsg, aBluetoothReplyRunnable,
|
||||
UnpackObjectPathMessage);
|
||||
|
||||
sIsPairing = false;
|
||||
}
|
||||
RunDBusCallback(aMsg, aBluetoothReplyRunnable,
|
||||
UnpackObjectPathMessage);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1571,8 +1566,6 @@ BluetoothDBusService::StopInternal()
|
||||
sAuthorizeReqTable.EnumerateRead(UnrefDBusMessages, nullptr);
|
||||
sAuthorizeReqTable.Clear();
|
||||
|
||||
sIsPairing = false;
|
||||
|
||||
StopDBus();
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2094,21 +2087,6 @@ BluetoothDBusService::CreatePairedDeviceInternal(const nsAString& aAdapterPath,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* FIXME: Bug 820274
|
||||
*
|
||||
* If the user turns off Bluetooth in the middle of pairing process, the
|
||||
* callback function GetObjectPathCallback (see the third argument of the
|
||||
* function call above) may still be called while enabling next time by
|
||||
* dbus daemon. To prevent this from happening, added a flag to distinguish
|
||||
* if Bluetooth has been turned off. Nevertheless, we need a check if there
|
||||
* is a better solution.
|
||||
*
|
||||
* Please see Bug 818696 for more information.
|
||||
*/
|
||||
sIsPairing = true;
|
||||
|
||||
runnable.forget();
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user