зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1100883: Replace most instances of |ToggleBtAck| with calls to |AcknowledgeToggleBt|, r=btian
|AcknowledgeToggleBt| completes a Bluetooth start or stop operation in the context of |BluetoothService|; That was done by |ToggleBtAck| before. This patch replaces |ToggleBtAck| with calls to |AcknowledgeToggleBt| in |BluetoothServiceBluedroid| for all the trivial cases.
This commit is contained in:
Родитель
e7b6dea79d
Коммит
d305868eed
|
@ -318,10 +318,7 @@ public:
|
|||
|
||||
BT_LOGR("BluetoothInterface::Enable failed: %d", aStatus);
|
||||
|
||||
nsRefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -394,10 +391,7 @@ public:
|
|||
|
||||
sBtInterface = nullptr;
|
||||
|
||||
nsRefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -413,10 +407,7 @@ BluetoothServiceBluedroid::StartGonkBluetooth()
|
|||
|
||||
if (bs->IsEnabled()) {
|
||||
// Keep current enable status
|
||||
nsRefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(true);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -436,10 +427,7 @@ public:
|
|||
|
||||
BT_LOGR("BluetoothInterface::Disable failed: %d", aStatus);
|
||||
|
||||
nsRefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(true);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -455,10 +443,7 @@ BluetoothServiceBluedroid::StopGonkBluetooth()
|
|||
|
||||
if (!bs->IsEnabled()) {
|
||||
// Keep current enable status
|
||||
nsRefPtr<nsRunnable> runnable = new BluetoothService::ToggleBtAck(false);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(false);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -518,11 +503,7 @@ BluetoothServiceBluedroid::StartInternal()
|
|||
|
||||
nsresult ret = StartGonkBluetooth();
|
||||
if (NS_FAILED(ret)) {
|
||||
nsRefPtr<nsRunnable> runnable =
|
||||
new BluetoothService::ToggleBtAck(false);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(false);
|
||||
BT_LOGR("Error");
|
||||
}
|
||||
|
||||
|
@ -536,11 +517,7 @@ BluetoothServiceBluedroid::StopInternal()
|
|||
|
||||
nsresult ret = StopGonkBluetooth();
|
||||
if (NS_FAILED(ret)) {
|
||||
nsRefPtr<nsRunnable> runnable =
|
||||
new BluetoothService::ToggleBtAck(true);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
BluetoothService::AcknowledgeToggleBt(true);
|
||||
BT_LOGR("Error");
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче