summaryrefslogtreecommitdiffstats
path: root/bluetooth
diff options
context:
space:
mode:
authorLianchao Song <songlianchao@huawei.com>2018-01-09 23:26:24 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-01-09 23:26:24 +0000
commit893798b19be959b6a138b88aa25fbc98292a58b9 (patch)
treeb46ad2ec63f1da8311e95f362101e5de69e1a00e /bluetooth
parenta72fb98f2b6b17f3f0c850adbc6f2123f0765183 (diff)
parent6991b9f428473504f3e6a8dfe7a81941409b6f23 (diff)
downloadplatform_hardware_interfaces-893798b19be959b6a138b88aa25fbc98292a58b9.tar.gz
platform_hardware_interfaces-893798b19be959b6a138b88aa25fbc98292a58b9.tar.bz2
platform_hardware_interfaces-893798b19be959b6a138b88aa25fbc98292a58b9.zip
BT Interface: fix hci cmd timeout am: 424ffd0da5 am: fc0e8c6f48
am: 6991b9f428 Change-Id: I6daa5c12ddd45ef212ac47369005cbb625527e7d
Diffstat (limited to 'bluetooth')
-rw-r--r--bluetooth/1.0/default/vendor_interface.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index 6ce2f11fb4..a8f5bb403d 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -49,6 +49,7 @@ uint32_t lpm_timeout_ms;
bool recent_activity_flag;
VendorInterface* g_vendor_interface = nullptr;
+std::mutex wakeup_mutex_;
HC_BT_HDR* WrapPacketAndCopy(uint16_t event, const hidl_vec<uint8_t>& data) {
size_t packet_size = data.size() + sizeof(HC_BT_HDR);
@@ -308,6 +309,7 @@ void VendorInterface::Close() {
}
size_t VendorInterface::Send(uint8_t type, const uint8_t* data, size_t length) {
+ std::unique_lock<std::mutex> lock(wakeup_mutex_);
recent_activity_flag = true;
if (lpm_wake_deasserted == true) {
@@ -350,6 +352,7 @@ void VendorInterface::OnFirmwareConfigured(uint8_t result) {
void VendorInterface::OnTimeout() {
ALOGV("%s", __func__);
+ std::unique_lock<std::mutex> lock(wakeup_mutex_);
if (recent_activity_flag == false) {
lpm_wake_deasserted = true;
bt_vendor_lpm_wake_state_t wakeState = BT_VND_LPM_WAKE_DEASSERT;