HeadsetService: Manage voice recognition for multiple devices
* Handle voice recognition in HeadsetService so that we can manage
multiple connected HFP devices. Implement the following policies to
manage relations among multiple HFP devices:
- If voice recognition is initiated by HF, the HF will be set as
active device and following startVoiceRecognition(device) callback will
be routed to the initiating HFP regardless of the input argument
- If startVoiceRecognition(device) is called without a pending request
from HF, the requested device will be set as active device and audio
will be routed to that device
* Added unit tests to verify voice recognition function behavior in
Multi-HFP which can be:
- Started by HF and stopped by HF
- Started by HF and stopped by AG
- Started by AG and stopped by HF
- Started by AG and stopped by AG
* Fixed logic in HeadsetStateMachine to match the expected behavior
Bug: 35793101
Test: runtest -j40 bluetooth
Change-Id: Ibbabcf7a5eb9355a1f35fb9ff287f7345cdcd372
(cherry picked from commit 2e5b99c2e33a27bed7acfdef46c1e2c95b04f591)
5 files changed