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

Commit 10d5cc12 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Remove pending HID connection when removing the device

Test: atest BumbleBluetoothTests:HidHostTest
Test: Manual | Immediately remove the HOGP device after pairing, pair with the HOGP device again, HOGP must work fine
Flag: com.android.bluetooth.flags.remove_pending_hid_connection
Bug: 374240155
Bug: 377705101

Change-Id: I840ea0eb7167b343b0705614793e6d7863d6b095
parent 4b50815e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -978,6 +978,9 @@ void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {

          /* remove from known device list in BTA */
          bta_hh_clean_up_kdev(p_cb);
        } else if (com::android::bluetooth::flags::remove_pending_hid_connection()) {
          log::warn("Failed to remove device {}", dev_info.link_spec);
          bta_hh_clean_up_kdev(p_cb);
        }
      }
      break;
+5 −0
Original line number Diff line number Diff line
@@ -977,6 +977,11 @@ void btif_hh_remove_device(const tAclLinkSpec& link_spec) {
    } else {
      log::warn("device_num = 0");
    }

    if (com::android::bluetooth::flags::remove_pending_hid_connection()) {
      BTA_HhRemoveDev(p_dev->dev_handle);  // Remove the connection, in case it was pending
    }

    bta_hh_co_close(p_dev);
    p_dev->dev_status = BTHH_CONN_STATE_UNKNOWN;
    p_dev->dev_handle = BTA_HH_INVALID_HANDLE;