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

Unified Diff: components/pairing/bluetooth_host_pairing_controller.cc

Issue 1829453002: Enable bootstrapping feature by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CL format Created 4 years, 9 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 | « components/pairing/bluetooth_host_pairing_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/pairing/bluetooth_host_pairing_controller.cc
diff --git a/components/pairing/bluetooth_host_pairing_controller.cc b/components/pairing/bluetooth_host_pairing_controller.cc
index aa6760aab6363cd5736990c6ecef27e932536116..98f85b731e3a648dc7614a0314b48fea446a4155 100644
--- a/components/pairing/bluetooth_host_pairing_controller.cc
+++ b/components/pairing/bluetooth_host_pairing_controller.cc
@@ -100,13 +100,6 @@ BluetoothHostPairingController::BluetoothHostPairingController()
BluetoothHostPairingController::~BluetoothHostPairingController() {
Reset();
- if (adapter_.get()) {
- if (adapter_->IsDiscoverable()) {
- adapter_->SetDiscoverable(false, base::Closure(), base::Closure());
- }
- adapter_->RemoveObserver(this);
- adapter_ = NULL;
- }
}
void BluetoothHostPairingController::ChangeStage(Stage new_stage) {
@@ -159,6 +152,19 @@ void BluetoothHostPairingController::Reset() {
service_socket_->Close();
service_socket_ = NULL;
}
+
+ if (adapter_.get()) {
+ if (adapter_->IsDiscoverable()) {
+ adapter_->SetDiscoverable(false, base::Bind(&base::DoNothing),
+ base::Bind(&base::DoNothing));
+ }
+ if (!was_powered_) {
+ adapter_->SetPowered(false, base::Bind(&base::DoNothing),
+ base::Bind(&base::DoNothing));
+ }
+ adapter_->RemoveObserver(this);
+ adapter_ = NULL;
+ }
ChangeStage(STAGE_NONE);
}
@@ -194,6 +200,7 @@ void BluetoothHostPairingController::SetName() {
void BluetoothHostPairingController::OnSetName() {
DCHECK(thread_checker_.CalledOnValidThread());
if (adapter_->IsPowered()) {
+ was_powered_ = true;
OnSetPowered();
} else {
adapter_->SetPowered(
« no previous file with comments | « components/pairing/bluetooth_host_pairing_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698