Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 318e42a8 authored by Robert Wu's avatar Robert Wu Committed by Phil Burk
Browse files

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)
parent 65cef33d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment