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
Loading
Please register or sign in to comment