diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc index f2289828c6..7f14e6899a 100644 --- a/bluetooth/1.0/default/vendor_interface.cc +++ b/bluetooth/1.0/default/vendor_interface.cc @@ -277,7 +277,7 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb, [this](int fd) { OnDataReady(fd); }); // Initially, the power management is off. - lpm_wake_deasserted = false; + lpm_wake_deasserted = true; // Start configuring the firmware firmware_startup_timer_ = new FirmwareStartupTimer(); @@ -290,6 +290,9 @@ void VendorInterface::Close() { fd_watcher_.StopWatchingFileDescriptor(); if (lib_interface_ != nullptr) { + bt_vendor_lpm_mode_t mode = BT_VND_LPM_DISABLE; + lib_interface_->op(BT_VND_OP_LPM_SET_MODE, &mode); + lib_interface_->op(BT_VND_OP_USERIAL_CLOSE, nullptr); uart_fd_ = INVALID_FD; int power_state = BT_VND_PWR_OFF; @@ -352,9 +355,6 @@ void VendorInterface::OnFirmwareConfigured(uint8_t result) { ALOGD("%s Calling StartLowPowerWatchdog()", __func__); fd_watcher_.ConfigureTimeout(std::chrono::milliseconds(lpm_timeout_ms), [this]() { OnTimeout(); }); - - bt_vendor_lpm_wake_state_t wakeState = BT_VND_LPM_WAKE_ASSERT; - lib_interface_->op(BT_VND_OP_LPM_WAKE_SET_STATE, &wakeState); } void VendorInterface::OnTimeout() {