diff options
Diffstat (limited to 'components/pairing/bluetooth_host_pairing_controller.cc')
-rw-r--r-- | components/pairing/bluetooth_host_pairing_controller.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/pairing/bluetooth_host_pairing_controller.cc b/components/pairing/bluetooth_host_pairing_controller.cc index 1d35628..5a8c8aa 100644 --- a/components/pairing/bluetooth_host_pairing_controller.cc +++ b/components/pairing/bluetooth_host_pairing_controller.cc @@ -65,8 +65,13 @@ BluetoothHostPairingController::BluetoothHostPairingController() } BluetoothHostPairingController::~BluetoothHostPairingController() { - if (adapter_.get()) + if (adapter_.get()) { + if (adapter_->IsDiscoverable()) { + adapter_->SetDiscoverable(false, base::Closure(), base::Closure()); + } adapter_->RemoveObserver(this); + adapter_ = NULL; + } } void BluetoothHostPairingController::ChangeStage(Stage new_stage) { @@ -282,7 +287,6 @@ void BluetoothHostPairingController::OnSetError() { void BluetoothHostPairingController::OnAcceptError( const std::string& error_message) { LOG(ERROR) << error_message; - Reset(); } void BluetoothHostPairingController::OnSendError( @@ -294,7 +298,6 @@ void BluetoothHostPairingController::OnReceiveError( device::BluetoothSocket::ErrorReason reason, const std::string& error_message) { LOG(ERROR) << reason << ", " << error_message; - Reset(); } void BluetoothHostPairingController::OnHostStatusMessage( |