[roll] Roll fuchsia [bt][core] move LegacyLowEnergyScanner impl to base class

This reverts commit ad3a94a29a8c689a0328dd32bc151dd5521c132b.

This change moves much of the LegacyLowEnergyScanner implementation up
to its base class, LowEnergyScanner. This change also updates tests to
be generic type parameterized tests with LegacyLowEnergyScanner being
the only current tested implementation. This is in preparation of adding
a new ExtendedLowEnergyScanner subclass to LowEnergyScanner.

This change also includes a fix to a LowEnergyScanner crash. If a scan
response timeout occurred before we received a scan response
(e.g. scannable peer which responded slowly with a scan response), we
would have destroyed all context regarding the peer while still trying
to handle the scan response. This handling had a bug where we wouldn't
check whether the peer context was still in our memory or had already
been destructed. When already destructed, we would access now invalid
memory and crash.

As a part of this change, we make a large refactor, moving some packet
builder methods from FakeController to FakePeer. FakePeer by default
sends its advertising reports immediately to facilitate
scanning. However, tests can now also request FakePeer to not do so and
retain control of sending the advertising reports themselves. This
allowed us to write a new test to test the LowEnergyScanner crashed
mentioned in the paragraph above.

We also clean up some of the code on batching advertising data with scan
responses in advertising reports. The majority of the tests followed the
simple path of not batching advertising data with scan responses in the
advertising reports. For the one case where we wanted to batch the data,
we introduce a new test so that we can continue to test such a situation
while also simplifying the code.

Original-Bug: b/323098126
Test: fx test src/connectivity/bluetooth/core/bt-host; added tests
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/986428
Original-Revision: 5337de654fa02e9b80c28ac1fe64833c130eadc1
GitOrigin-RevId: 9b019dd9acc6c255696d16fd09da4153dcd77fd2
Change-Id: I84135d179ab0aa340972b3ab5d9e94b32ad4e930
1 file changed
tree: cce09bcffeb6b18ad87cd2724dc33e4ea1178834
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cts
  6. firmware
  7. flower
  8. jiri.lock
  9. MILESTONE
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
  15. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.