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>
Thu, 30 May 2019 07:44:03 +0000 (15:44 +0800)
commit2e4fd6f728a0a8ebc97efcb8e297b35a28f3ce5c
treeebc294ad1475a0cfbe9e92868972611d1c499446
parent8c3e9415af76e14836fb2f4c428cc97db624b032
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
Merged-In: I6ae11faab3d530c65f55ffa9b8a9f3cae2bde5f4
(cherry picked from commit 39be24184d752b29d4a2b4cbcc537edfb4ee0acb)
audio_hal_interface/client_interface.cc
audio_hal_interface/hearing_aid_software_encoding.cc
bta/hearing_aid/hearing_aid_audio_source.cc