aaudio: handle shared disconnect before start
Unplugging or plugging in a headset while an AAudio stream is open causes a DISCONNECT. If a disconnect occurs between open and start on a shared MMAP stream then it leaves an orphan MMAP port. This resource leak can prevent MMAP from working until the device is rebooted. This was caused by the mMapStream getting deleted and preventing stopClient() from working. The fix involves using a mutex to protect mMapStream. Also we check to see if the endpoint was disconnected during startClient() and stop the client port if so. Bug: 344011310 Test: see bug for repro steps Change-Id: I7aadf1f2dbc7886deb2cb59faf72598614ad4258
Loading
Please register or sign in to comment