| 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 98f85b731e3a648dc7614a0314b48fea446a4155..aa6760aab6363cd5736990c6ecef27e932536116 100644
|
| --- a/components/pairing/bluetooth_host_pairing_controller.cc
|
| +++ b/components/pairing/bluetooth_host_pairing_controller.cc
|
| @@ -100,6 +100,13 @@
|
|
|
| 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) {
|
| @@ -152,19 +159,6 @@
|
| 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);
|
| }
|
|
|
| @@ -200,7 +194,6 @@
|
| void BluetoothHostPairingController::OnSetName() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| if (adapter_->IsPowered()) {
|
| - was_powered_ = true;
|
| OnSetPowered();
|
| } else {
|
| adapter_->SetPowered(
|
|
|