Skip to content
Commit 5e0b95fe authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioService: fix playback capture permission check

Fix permission checks when registering a dynamic audio policy
of type loopback+render for usage VOICE_COMMUNICATION.
Previous checks were assuming that the policy was created with
allowPrivilegedPlaybackCapture flag which should not be a pre requisit.
The conditions to allow capture of VOICE_COMMUNICATION playback (loopback+render
mode) are:
- Having permission MODIFY_AUDIO_ROUTING (implied by ability to regiter a DAP).
- Having permission CAPTURE_VOICE_COMMUNICATION_OUTPUT.
- The capture format is compatible with capture by system requirements.
- The playback client or app did not opt out from capture by system.

Test: atest AudioHostTest
Test: atest AudioPlaybackCaptureTest
Bug: 161569476
Change-Id: I919f016180565b44bf13e8e6afc4a87ef0d6391d
parent 7522b98e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment