Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79bfa4be authored by cheng_cai's avatar cheng_cai Committed by Wally Yau
Browse files

Check search state when cancel read remote name procedure

Application may call cancel_discovery when the stack is doing
create_bond. The bonding process fails, because cancel_discovery
causes to cancel remote name request procedure.

Bug:154074383
Test: CtsVerifier->Bluetooth Test->Bluetooth HID Host
Change-Id: Icadf9abe342fffdf06b9623fb5c7e6de05a337bc
(cherry picked from commit e3f9fe7425705dc819a638c158ad9f87cb2bd1eb)
parent d434f2ea
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1753,7 +1753,9 @@ void bta_dm_search_cancel_notify(UNUSED_ATTR tBTA_DM_MSG* p_data) {
  if (bta_dm_search_cb.p_search_cback) {
    bta_dm_search_cb.p_search_cback(BTA_DM_SEARCH_CANCEL_CMPL_EVT, NULL);
  }
  if (!bta_dm_search_cb.name_discover_done) {
  if (!bta_dm_search_cb.name_discover_done &&
      (bta_dm_search_cb.state == BTA_DM_SEARCH_ACTIVE ||
       bta_dm_search_cb.state == BTA_DM_SEARCH_CANCELLING)) {
    BTM_CancelRemoteDeviceName();
  }
  if (bta_dm_search_cb.gatt_disc_active) {