OSDN Git Service

Make sure the Hearing Aid source is ready before resuming or suspending calls
authorCheney Ni <cheneyni@google.com>
Fri, 24 May 2019 06:59:43 +0000 (14:59 +0800)
committerCheney Ni <cheneyni@google.com>
Tue, 28 May 2019 18:41:29 +0000 (02:41 +0800)
commit39be24184d752b29d4a2b4cbcc537edfb4ee0acb
tree6427a192052a8c49a4f4f4f8778448dc703318df
parent0a2f6b52e2e73a89026f2e72fd545766d3d22f5f
Make sure the Hearing Aid source is ready before resuming or suspending calls

Those calls to resume / suspend streaming are from the audio's IPC
threads like HwBinder or UIPC, and calls to start / end session are from
the stack main thread. There is timing that those threads may run in
parallel, and trys to change the streaming state when the Hearing Aid
source is not ready. This change checks the source state before resuming
or suspending streaming, and breaks the deadlock between IPC threads and
the stack main thread.

Bug: 132860565
Test: 1. Connected to a Hearing Aids and disable the Bluetooth
      2. Switch the active device manually

Change-Id: I6ae11faab3d530c65f55ffa9b8a9f3cae2bde5f4
audio_hal_interface/client_interface.cc
audio_hal_interface/hearing_aid_software_encoding.cc
bta/hearing_aid/hearing_aid_audio_source.cc