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

Skip to content
Commit 094dd836 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: Merge found_devices and bonded_devices maps

Separating remote devices into two maps doesn't bring many benefits
because its purpose highly overlaps with the `bond_state` field, and
the downside is the more complex code base that potentially causes
issues.

Notable logic changes in this CL:
- Discovered devices
    We used to always put them into found_devices, no matter they are
    bonded or not. This means a device may exist in the both maps and
    an OnDeviceCleared may still be sent through freshness check even
    though it's bonded. After this patch this shall not happen.
- bond_state == bonded && device already in bonded_devices
    Although this case might not happen in the real world, the original
    behavior is putting the device into found_devices, which is
    misleading.

Bug: 339750398
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: stress test md_two_cl_hid_connections_test.floss
Test: bluetooth_AdapterQuickHealth.AVL.all_floss
Test: PhoneHub / NearbyShare / FastPair
Flag: EXEMPT, Floss-only changes
Change-Id: Id595dab27c8da11478f1153b750d59fc14835674
parent 98876e4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment