OSDN Git Service

Revert "Bluetooth: Don't disable LPM at power off"
authorAndre Eisenbach <eisenbach@google.com>
Fri, 17 Mar 2017 20:28:09 +0000 (20:28 +0000)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 17 Mar 2017 20:32:58 +0000 (20:32 +0000)
Causes power regression on Angler.

This reverts commit 3b2a29676b2efbc828ae3db272b347f553909d94.

Bug: 36358814
Bug: 36026072
Change-Id: I9bbe218a87c7d092851c400739bc5740bcf13336

bluetooth/1.0/default/vendor_interface.cc

index e6575b0..68cac5f 100644 (file)
@@ -265,6 +265,13 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
 }
 
 void VendorInterface::Close() {
+  // These callbacks may send HCI events (vendor-dependent), so make sure to
+  // StopWatching the file descriptor after this.
+  if (lib_interface_ != nullptr) {
+    bt_vendor_lpm_mode_t mode = BT_VND_LPM_DISABLE;
+    lib_interface_->op(BT_VND_OP_LPM_SET_MODE, &mode);
+  }
+
   fd_watcher_.StopWatchingFileDescriptors();
 
   if (hci_ != nullptr) {