Fix AAudio waiting for stop SIGABRT
WaitForStateChange is a function that notifies the user if the state moves from a specific state. When the state moves to closed, however, a SIGABRT is thrown because waitForStateChange is in a deleted pointer. android::sp has a property where casting an instance to a sp increments the usage count by 1. Thus, by adding casting the AAudioStream to a sp, the AAudioStream is no longer deleted when the stream closes. With this change, the SIGABRT is no longer thrown. Bug: 63089499 Test: Ran new wait_for_state_change_closed with and without change. Verified that the test fails before the cl and the test now passes after the change. Change-Id: Id865ef3f55f3cf006fd94d7b376d1b87ad999ca5 Merged-In: Id865ef3f55f3cf006fd94d7b376d1b87ad999ca5 (cherry picked from commit 676764f2)
Loading
Please register or sign in to comment