Add a retry logic with number of retries set to 1 for AudioTrack creation....
Add a retry logic with number of retries set to 1 for AudioTrack creation. This is to prevent the intermittent issue of alarm sound not going off from occuring. From stack traces it looked like getOutputForDevice in AudioPolicyManager couldn't find an output at that time. We couldn`t repro this consistently and there was no pattern leading to the conclusion that it`s transient in use case. In the cases we saw, it seemed to happen during some race with other output. From digging in to the Android source this is totally possible from the HW layer. Adding a single retry to try to break this case so the user experience is improved. There are other (leak) cases with the number of system audio tracks possible as well, but that wasn't this use case (and owners releasing shared resources correctly is the only true fix there anyhow). Bug: 130373632 Change-Id: If5f3a2fcd2f3e50dd86d864638546e839913f6d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747028Reviewed-by:Kenneth MacKay <kmackay@chromium.org> Commit-Queue: Anirudh Tadakamala <antadaka@google.com> Cr-Commit-Position: refs/heads/master@{#690772}
Showing
Please register or sign in to comment