Reland "Consolidate interactions with |CrasAudioHandler|."
This is a reland of ccba8bc4 The problem was that the fixes for the review comments had caused us to call AudioDevices::SetAudioDevices() before the constructor of |AudioDevices| had finished initializing all variables. Unfortunately this only happened on real hardware, and I had not retested these review comment fixes on hardware. Original change's description: > Consolidate interactions with |CrasAudioHandler|. > > Previously 2 places in the code were interacting with |CrasAudioHandler|: > - |PlatformApiImpl| subscribes to device changes, and passes this > information to |AudioInputHost|. > - |AudioInputHost| posts the new hotword model to |CrasAudioHandler|. > > This made it hard/impossible to split |AudioInputHost| from > |PlatformApiImpl|, which is needed to handle audio input in the > Libassistant mojom service. > > To solve this I moved all interactions with |CrasAudioHandler| inside a > new class |AudioDevices|, of which an instance is owned by > |AudioInputHost|. > > This also allowed me to add a bunch of new unittests. > > deployed on real hardware. > > Bug: b/171748795 > Test: chromeos_unittests --gtest_filter="Assistant*:Audio*" and manually > Change-Id: I8ec9cec6672236f6365345b292efbe828518be69 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610953 > Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org> > Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org> > Auto-Submit: Jeroen Dhollander <jeroendh@chromium.org> > Cr-Commit-Position: refs/heads/master@{#841155} Bug: b/171748795 Change-Id: I9b8b970fbd1011ce911bf99961159805a4c0d2a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617568 Commit-Queue: Jeroen Dhollander <jeroendh@chromium.org> Auto-Submit: Jeroen Dhollander <jeroendh@chromium.org> Reviewed-by:Xiaohui Chen <xiaohuic@chromium.org> Cr-Commit-Position: refs/heads/master@{#841677}
Showing
This diff is collapsed.
Please register or sign in to comment