Increase attempts to start AudioRecord

Making the shell app foreground (specific for Android 11) may take more
than 300ms on some devices, so increase the number of attempts from 3 to
5 (separated by 100ms).

Fixes #4147 <https://github.com/Genymobile/scrcpy/issues/4147>
Refs #3796 <https://github.com/Genymobile/scrcpy/issues/3796>
Refs 02f4ff7534
This commit is contained in:
Romain Vimont 2023-07-07 18:21:17 +02:00
parent fe6e9acb36
commit 01d785d9a3

View File

@ -118,7 +118,7 @@ public final class AudioCapture {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
startWorkaroundAndroid11();
try {
tryStartRecording(3, 100);
tryStartRecording(5, 100);
} finally {
stopWorkaroundAndroid11();
}