mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 06:39:39 +00:00
Disable audio before Android 11
The permission "android.permission.RECORD_AUDIO" has been added for shell in Android 11. Moreover, on lower versions, it may make the server segfault on the device (happened on a Nexus 5 with Android 6.0.1). Refs <https://android.googlesource.com/platform/frameworks/base/+/4feeee88911503cc365b223a712437abcd91c94f%5E%21/>
This commit is contained in:
parent
0abb268432
commit
9c34c34e5d
1 changed files with 6 additions and 0 deletions
|
@ -202,6 +202,12 @@ public final class AudioEncoder {
|
|||
|
||||
@TargetApi(Build.VERSION_CODES.M)
|
||||
public void encode() throws IOException {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
Ln.w("Audio disabled: it is not supported before Android 11");
|
||||
streamer.writeDisableStream();
|
||||
return;
|
||||
}
|
||||
|
||||
MediaCodec mediaCodec = null;
|
||||
AudioRecord recorder = null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue