Index: device/bluetooth/bluetooth_adapter_bluez.cc |
diff --git a/device/bluetooth/bluetooth_adapter_bluez.cc b/device/bluetooth/bluetooth_adapter_bluez.cc |
index 4424b0229d667befdb432cfc2b17dc4dd88d3040..2a8232cdd4d1e7881d4196312177d42199306f3c 100644 |
--- a/device/bluetooth/bluetooth_adapter_bluez.cc |
+++ b/device/bluetooth/bluetooth_adapter_bluez.cc |
@@ -153,6 +153,7 @@ BluetoothAdapterBlueZ::BluetoothAdapterBlueZ(const InitCallback& init_callback) |
: init_callback_(init_callback), |
initialized_(false), |
dbus_is_shutdown_(false), |
+ is_disabled_(false), |
num_discovery_sessions_(0), |
discovery_request_pending_(false), |
weak_ptr_factory_(this) { |
@@ -254,7 +255,15 @@ bool BluetoothAdapterBlueZ::IsInitialized() const { |
} |
bool BluetoothAdapterBlueZ::IsPresent() const { |
- return !dbus_is_shutdown_ && !object_path_.value().empty(); |
+ return !is_disabled_ && !dbus_is_shutdown_ && !object_path_.value().empty(); |
+} |
+ |
+void BluetoothAdapterBlueZ::SetDisabled(bool disabled) { |
+ if (disabled) { |
+ SetPowered(false, base::Bind(&base::DoNothing), |
Andrew T Wilson (Slow)
2016/04/13 13:55:11
I am slightly nervous that any operations that are
Ivan Šandrk
2016/04/14 18:08:47
https://code.google.com/p/chromium/codesearch#chro
scheib
2016/04/15 17:46:53
At shutdown we believe things won't crash -- handl
Ivan Šandrk
2016/04/15 17:52:28
Okay thanks for your input. I'll ask my supervisor
|
+ base::Bind(&base::DoNothing)); |
Andrew T Wilson (Slow)
2016/04/13 13:55:11
This line is indented wrong.
Ivan Šandrk
2016/04/13 17:19:04
Done.
|
+ } |
+ is_disabled_ = disabled; |
} |
bool BluetoothAdapterBlueZ::IsPowered() const { |