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

Commit 22158995 authored by Martin Brabham's avatar Martin Brabham
Browse files

Floss: Allow Wake By HID for LE.

Needed to get the currently bonded HID devices and pass them
down to be added to the FilterAcceptList.

Bug: 230604670
Test: ./build.py
Test: mma -j $(nproc)
Test: system/gd/cert/run --clean --topshim
Tag: #floss
Change-Id: I12d2718cf68b31d0f9accfe10e00339b298675ae
parent 59a10c99
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4125,12 +4125,12 @@ void bta_dm_set_event_filter_connection_setup_all_devices() {
 *
 * Description     Allow the device to be woken by HID devices
 *
 * Parameters
 * Parameters      std::vector or RawAddress
 *
 *******************************************************************************/
void bta_dm_allow_wake_by_hid() {
void bta_dm_allow_wake_by_hid(std::vector<RawAddress> le_hid_devices) {
  // Autoplumbed
  bluetooth::shim::BTM_AllowWakeByHid();
  bluetooth::shim::BTM_AllowWakeByHid(le_hid_devices);
}

/*******************************************************************************
+3 −2
Original line number Diff line number Diff line
@@ -697,9 +697,10 @@ void BTA_DmSetEventFilterConnectionSetupAllDevices() {
      base::Bind(bta_dm_set_event_filter_connection_setup_all_devices));
}

void BTA_DmAllowWakeByHid() {
void BTA_DmAllowWakeByHid(std::vector<RawAddress> le_hid_devices) {
  APPL_TRACE_API("BTA_DmAllowWakeByHid");
  do_in_main_thread(FROM_HERE, base::Bind(bta_dm_allow_wake_by_hid));
  do_in_main_thread(FROM_HERE,
                    base::Bind(bta_dm_allow_wake_by_hid, le_hid_devices));
}

void BTA_DmRestoreFilterAcceptList() {
+1 −1
Original line number Diff line number Diff line
@@ -547,7 +547,7 @@ 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();
extern void bta_dm_allow_wake_by_hid(std::vector<RawAddress> 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();
+1 −1
Original line number Diff line number Diff line
@@ -1243,7 +1243,7 @@ extern void BTA_DmSetEventFilterConnectionSetupAllDevices();
 * Parameters
 *
 *******************************************************************************/
extern void BTA_DmAllowWakeByHid();
extern void BTA_DmAllowWakeByHid(std::vector<RawAddress> le_hid_devices);

/*******************************************************************************
 *
+2 −1
Original line number Diff line number Diff line
@@ -3480,7 +3480,8 @@ void btif_dm_set_event_filter_connection_setup_all_devices() {

void btif_dm_allow_wake_by_hid() {
  // Autoplumbed
  BTA_DmAllowWakeByHid();
  auto le_hid_devices = btif_storage_get_hid_device_addresses();
  BTA_DmAllowWakeByHid(le_hid_devices);
}

void btif_dm_restore_filter_accept_list() {
Loading