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

Commit 0e93532c authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi
Browse files

floss: Allow HID reconnect during suspend

Raw addresses for paired devices aren't only stored as public addresses.
Since we filter for LE HID attributes, provide both the RawAddress and
LE address type when we provide the list of devices that can wake the
system.

In order for LeAddressManager to re-arm connection, we need to add these
devices via |AcceptLeConnectionFrom| instead of
|AddDeviceToFilterAcceptList|.

Bug: 231345733
Tag: #floss
Test: Manual test on ChromeOS.
Change-Id: I8ae8bc0f71ed07260f5f1880ab6bb8f27ffff972
parent d83e8199
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4183,10 +4183,11 @@ void bta_dm_set_event_filter_connection_setup_all_devices() {
 *
 * Description     Allow the device to be woken by HID devices
 *
 * Parameters      std::vector or RawAddress
 * Parameters      std::vector of (Address, Address Type)
 *
 *******************************************************************************/
void bta_dm_allow_wake_by_hid(std::vector<RawAddress> le_hid_devices) {
void bta_dm_allow_wake_by_hid(
    std::vector<std::pair<RawAddress, uint8_t>> le_hid_devices) {
  // Autoplumbed
  bluetooth::shim::BTM_AllowWakeByHid(le_hid_devices);
}
+2 −1
Original line number Diff line number Diff line
@@ -739,7 +739,8 @@ void BTA_DmSetEventFilterConnectionSetupAllDevices() {
      base::Bind(bta_dm_set_event_filter_connection_setup_all_devices));
}

void BTA_DmAllowWakeByHid(std::vector<RawAddress> le_hid_devices) {
void BTA_DmAllowWakeByHid(
    std::vector<std::pair<RawAddress, uint8_t>> le_hid_devices) {
  APPL_TRACE_API("BTA_DmAllowWakeByHid");
  do_in_main_thread(FROM_HERE,
                    base::Bind(bta_dm_allow_wake_by_hid, le_hid_devices));
+2 −1
Original line number Diff line number Diff line
@@ -547,7 +547,8 @@ extern void bta_dm_clear_filter_accept_list(void);
extern void bta_dm_disconnect_all_acls(void);
extern void bta_dm_le_rand(LeRandCallback cb);
extern void bta_dm_set_event_filter_connection_setup_all_devices();
extern void bta_dm_allow_wake_by_hid(std::vector<RawAddress> le_hid_devices);
extern void bta_dm_allow_wake_by_hid(
    std::vector<std::pair<RawAddress, uint8_t>> le_hid_devices);
extern void bta_dm_restore_filter_accept_list();
extern void bta_dm_set_default_event_mask();
extern void bta_dm_set_event_filter_inquiry_result_all_devices();
+2 −1
Original line number Diff line number Diff line
@@ -1298,7 +1298,8 @@ extern void BTA_DmSetEventFilterConnectionSetupAllDevices();
 * Parameters
 *
 *******************************************************************************/
extern void BTA_DmAllowWakeByHid(std::vector<RawAddress> le_hid_devices);
extern void BTA_DmAllowWakeByHid(
    std::vector<std::pair<RawAddress, uint8_t>> le_hid_devices);

/*******************************************************************************
 *
+2 −1
Original line number Diff line number Diff line
@@ -250,7 +250,8 @@ bt_status_t btif_storage_remove_hid_info(const RawAddress& remote_bd_addr);
 * Returns          std::vector of RawAddress
 *
 ******************************************************************************/
std::vector<RawAddress> btif_storage_get_hid_device_addresses(void);
std::vector<std::pair<RawAddress, uint8_t>>
btif_storage_get_hid_device_addresses(void);

/** Loads information about bonded hearing aid devices */
void btif_storage_load_bonded_hearing_aids();
Loading