This change fixes the CTS failure in AudioPlaybackCaptureTest caused
by ag/10111312 and ag/10111311.
It contains the following fixes/changes:
- Mix match for playback capture of USAGE_VOICE_COMMUNICATION now
also respects a new flag (AudioMix's mVoiceCommunicationCaptureAllowed)
which is set by AudioService only if the caller explicitly asked
to capture USAGE_VOICE_COMMUNICATION and have the
CAPTURE_VOICE_COMMUNICATION_OUTPUT.
- A permission check on the native side in case
mVoiceCommunicationCaptureAllowed is set.
- Code cleanup, mainly in AudioPolicy.h and AudioPolicy.cpp.
This change is accompanied by ag/10242955 on the Java side.
Bug: 148559127
Test: manual
Test: atest PlaybackCaptureTest (with the version prior to ag/10220852)
Test: atest com.google.android.gts.audio.AudioHostTest
Change-Id: I8ae6249f4da1de35e962c838d91f690eb906570e
Added new API to audio policy to route audio output streams based on
Android user id. The routing remains similar to uid rules, with only
using USERID_EXCLUDE_USERID to decide on the user id base routing.
Application uid and stream usage routing remain the same with the added
difference that user id will be taken in to consideration if available.
Bug: 139365417
Test: atest
com.google.android.gts.audio.AudioHostTest#testUserIdDeviceAffinity
Test: atest AudioPlaybackCaptureTest
Change-Id: Ib817eb8ae19ed7dea8451e8a8584a20b9b6f5042
Allow audio playback capture for the USAGE_VOICE_COMMUNICATION usage
only for priveliged apps that are granted with the CAPTURE_VOICE_COMMUNICATION_OUTPUT
permission.
Test: atest android.media.cts.AudioPlaybackCaptureTest
Test: Manually
Bug: 124653474
Change-Id: Ib568ca590ea534837c396536f5e31cf60a5caf52
Move AudioDeviceTypeAddr from AudioPolicy.h to libaudiofoundation.
AudioDeviceTypeAddr is a class that contains audio device type and
address. It can be used not only in audio policy, but also other places.
Bug: 135621476
Test: make, atest AudioHostTest
Change-Id: Ib257859891c647c07f22771012efdada438a4ff5
Audio mix rules that contain both a match and exclude for a uid
or usage are ignored for routing evaluation. The implementation
of the uid-device affinity caused uid matches and exclusions to
be added to any mixes, causing previously valid mixes to be
discarded in the routing logic.
The fix consists in implementing the uid-device affinity by only
applying uid exclusions on mixes that:
a/ are compatible with the concept (mixes of players that are
render only),
b/ do not route to the selected devices
c/ do not have a uid match rule (such mixes are already exclusive
to the uid to match)
d/ do not already have a uid exclusion for the uid
Fix removeUidDeviceAffinities() that skipped the wrong mixes.
Bug: 124319394
Bug: 131180578
Test: atest AudioHostTest#testUidDeviceAffinity
Change-Id: I813c4cfb15956e56599740948775c32562266c21
For system application with the new permission CAPTURE_MEDIA_OUTPUT, or
CAPTURE_AUDIO_OUTPUT, allow to capture the audio of playing apps that
allow it.
Test: adb shell audiorecorder --target /data/file1.raw
Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 111453086
Change-Id: I5bfca51e48992234508897c595a076d066db26b2
Signed-off-by: Kevin Rocard <krocard@google.com>
When setting a uid device affinity, make the rules deterministic
by applying an "exclude" rule on all mixes that don't reach
the devices (existing), but also a "match" on the mixes that
do (new).
Bug: 111647296
Test: requires device with routing policy started by CarService
Change-Id: I3bb844156ade75e4b9576c1e18200ca90ce26cf9
Setting audio device affinity for a given uid augments all
audio mix criteria that do not route to the given devices
to exclude the uid.
AudioPolicyManager: after changing the device affinity,
check the outputs addressing the devices to re-evaluate
audio routing
Bug: 111647296
Test: requires device with routing policy started by CarService
Change-Id: I72de54ae067151fe6ac2ec43b78fe544a9fd9888
This makes it so audioserver doesn't need to link against the entire libmedia,
which has dependencies on camera, ICU, OpenGL and other things that aren't
needed for audio.
Test: build/boot
Change-Id: I99ba1a3dc3b33ca9b3abd98e7519dbf228ee62af