Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Unified Diff: device/bluetooth/bluez/bluetooth_adapter_bluez.cc

Issue 2279853002: Make BluetoothAdapterBlueZ::Init early out if shutdown (Closed)
Patch Set: move conditional Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluez/bluetooth_adapter_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
index 5dd44416a7c794d914733e7bfbac7e29418aea5a..8ccf592003db5454dfcd83f6904b1b28bcfeea83 100644
--- a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
@@ -208,9 +208,11 @@ BluetoothAdapterBlueZ::BluetoothAdapterBlueZ(const InitCallback& init_callback)
}
void BluetoothAdapterBlueZ::Init() {
- // If the platform doesn't support Object Manager then Bluez 5 is probably
- // not present. In this case we just return without initializing anything.
- if (!bluez::BluezDBusManager::Get()->IsObjectManagerSupported()) {
+ // We may have been shutdown already, in which case do nothing. If the
+ // platform doesn't support Object Manager then Bluez 5 is probably not
+ // present. In this case we just return without initializing anything.
+ if (dbus_is_shutdown_ ||
+ !bluez::BluezDBusManager::Get()->IsObjectManagerSupported()) {
initialized_ = true;
init_callback_.Run();
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698