Hearing Aid: Remove std::promise from suspend / resume calls, and stop audio ticks by no devices
The Hearing Aid uses the stack main thread to be the media task thread. This thread handles events / feeds audio data sequentially, and won't have a race condition within the single thread. The promise is a bit redundant, but wasted time to cause a potential deadlock that the caller waits for the task thread finished which needed the caller's resource. This CL also stops the audio ticks when no devices available, and no need to wait for next timer expired. Besides, move all timer controls into the media task thread, so timer is started / stopped at the same thread, too. Bug: 134996542 Test: add big delay within functions, and check no abnormal manually Change-Id: If0b279a191d86b30db41a682dc7f0ad9470cb10e
Loading
Please register or sign in to comment