From d559977329e20773f677bbdc5f3e85b54d1b4ff3 Mon Sep 17 00:00:00 2001 From: IHLHO KIM Date: Tue, 3 Aug 2021 04:38:27 +0000 Subject: [PATCH] Stop inquiry when inquiry cancelled Inquiry is not stopped cause of clearing of BTM_BLE_INQUIRY_MASK. This issue came from the follwing patch. https://android-review.googlesource.com/c/platform/system/bt/+/1402183 Bug: 195908804 Change-Id: I3361c924c9445d6aae2856f41b732fca22951f76 Tag: #refactor Ignore-AOSP-First: cherry-pick from aosp to upstream branch Test: compile & verify basic functions working --- stack/btm/btm_inq.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stack/btm/btm_inq.cc b/stack/btm/btm_inq.cc index 8bb416b7b..890cd3a0d 100644 --- a/stack/btm/btm_inq.cc +++ b/stack/btm/btm_inq.cc @@ -534,8 +534,10 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, if (controller_get_interface()->supports_ble()) { btm_ble_start_inquiry(p_inq->inqparms.duration); + } else { + LOG_WARN("Trying to do LE scan on a non-LE adapter"); + p_inq->inqparms.mode &= ~BTM_BLE_INQUIRY_MASK; } - p_inq->inqparms.mode &= ~BTM_BLE_INQUIRY_MASK; btm_acl_update_inquiry_status(BTM_INQUIRY_STARTED); -- 2.11.0