Policy of AudioPlaybackCapture API not work

Viewed 349

As listed with AudioPlaybackCapture API here to prevent capture of audio by third party apps and system apps we should

set the capture policy to ALLOW_CAPTURE_BY_NONE.

but system app was able to record audio.

Update 1

tried add android:allowAudioPlaybackCaputure="false" but did not solve problem

Update 2

tried change audio attributes

   com.google.android.exoplayer2.audio.AudioAttributes.Builder()
                .setAllowedCapturePolicy(ALLOW_CAPTURE_BY_NONE)
                .setUsage(USAGE_VOICE_COMMUNICATION)
                .build().also {
                    videoController.player?.audioComponent?.setAudioAttributes(it, true)
                }

but did not solve problem

1 Answers

Update 2 works, but must be added after initialize player.

Related