MediaProjectionManager.createScreenCaptureIntent()
AndroidManifest.xml
<application
...
android:allowAudioPlaybackCapture="false"/>
AudioManager.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_SYSTEM)
AudioAttributes.Builder.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_SYSTEM)
AudioManager.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_NONE)
AudioAttributes.Builder.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_NONE)
manifest.xml
android:allowAudioPlaybackCapture="true"