Add the possibility to silence a particular AudioRecord
client rather than silencing all clients sharing the same UID.
Test: AudioRecordTest#testRecordNoDataForIdleUids
Change-Id: Ic472045cd45c7222ca3a88ccf131435fd1e26475
Add pre processing effect management for concurrent capture scenarii.
When several clients on the same input stream have enabled audio effects,
only the effects attached to the top priotity client are active.
Other effects are suspended.
Add AudioFlinger API to suspend/restore audio effects build on top
of exisiting internal effect suspend mechanism.
RecordThread now supports more than one effect chain.
AOSP pre processing implementation supports more than one effect session
per input.
Refactor AudioPolicyManager::closeAllInputs() to call closeInput() on
all inputs instead of partially duplicated code.
Bug: 128419018
Test: make
Change-Id: I685286da4c2905a8894a4354679f9787b1400621
Test: Change Balance through Settings, play audio
Bug: 28390736
Co-author: Ed Savage-Jones <edward.savage-jones@sony.com>
Change-Id: I0169b436ccbaa5628584d9f4954dd7c76d021aae
Allows getting effect descriptors by type or uuid,
not just by uuid.
Bug: 78528249
Test: Builds. Manually tested that an app playing audio with an effect works.
Change-Id: I9d339a7d6d81161065e1adaf427dd2d3430436c2
Add event logging in case of audioserver watchdog to help
collect statistics.
Test: make. Simulate watchdog and check events in logcat.
Change-Id: I4716852c77d56703ad5f3dfc2500f598a2b80a12
Change captureAudioOutputAllowed to check client pid.
Check calling uid with AID_AUDIOSERVER instead of calling pid with
own pid. This is consistent, and works if AudioFlinger and
AudioPolicyManager exist as different processes.
Remove getpid_cached since getpid() is very fast. This removes
any initialization issues.
Replace getuid() with AID_AUDIOSERVER to remove ambiguity of
multiple native audio services for multiple users. Only
one exists regardless of users.
Do not use multiuser UID checks for certain native services
that do not spawn for multiple users to prevent accidently exposure.
Move permission checks to use ServiceUtilities for control and
consistency.
Rename isTrustedCallingUid to isAudioServerOrMediaServerUid
so that permission check is explicitly known to caller.
Update MediaLogService to use ServiceUtilities.
Test: Basic sanity
Test: AudioTrackTest, AudioRecordTest, SoundPool, SoundTrigger
Bug: 79485140
Change-Id: Ib8ccb36929a9b4806c01626f32fa023a046d6020
When a transaction to IAudioFlinger or IAudioPolicyService is detected
from an unauthorized source, return the INVALID_OPERATION status in
reply Parcel and not as transaction status.
Also removed check on SET_RINGER_MODE as it is not implemented on client
side and allow SET_MODE from system AIDs instead of just audioserver.
Bug: 78615605
Test: manual audio smoke tests.
Change-Id: Ia4fdfc22f049da69aaa9d45075e1c502eecf4521
Only allow setParameters() for reserved keys when received from
audioserver UID. For instance, keys used to control routing or audio
stream configuration are reserved for use by audio policy manager.
Also use multiuser_get_app_id() instead of duplicated code to
extract application ID from UID.
Bug: 77869640
Test: manual audio smoke tests.
Change-Id: I88852e8fddf7f705e4a084fc02d9ced1f4b0de92
Get list of all/currently active microphones from hal.
Bug: 64038649
Test: Manual Testing and Cts test
Change-Id: Id39cae38ba040f9bc91571e713487f87c2eb67b0
Fix UID checks in audioserver to take into account multi user UIDs
where the top part above AID_USER_OFFSET contains the user number.
Bug: 76439650
Test: manual audio smoke tests.
Change-Id: I6dbd616021bcb2639c7b7369000ce911c7e7e030
Add a mechanism to monitor execution time of incoming binder
calls to audio flinger and audio policy and cause native audioserver
restart in case of timeout.
Bug: 69250055
Test: manual. audio smoke tests
Change-Id: I01b5bf2599fb2a4cd265cbbe8d4e34b2b059aaf4
Block incoming binder calls to audio flinger and audio policy service
for sensitive functions if they are not coming from a system UID.
Bug: 72278478
Test: audio smoke tests. CTS tests for AudioTrack and AudioRecord
Change-Id: I78e02efffe135d5450ced125e51e2084719ca03d
Add MicrophoneInfo class in native side and native logic for supporting
query all available microphones.
Bug: 64038649
Test: Run test and check the print log.
Change-Id: Ic0a9cce55a1265a66ba08fe81b56b56cb88ba42f
To protect user's privacy if a UID is in an idle state we allow
recording but report silence (all zeros in the byte array) and once
the process goes in an active state we report the real mic data.
This avoids the race between the app being notified aboout its
lifecycle and the audio system being notified about the state
of a UID.
Test: Added - AudioRecordTest#testRecordNoDataForIdleUids
Passing - cts-tradefed run cts-dev -m CtsMediaTestCases
-t android.media.cts.AudioRecordTest
bug:63938985
Change-Id: I1442a9dda1553e9ea7a4a654c50555ac1ec06aa0
Refactor the mechanism used by audio record tracks to query and
attach to an input mixer/stream in audio flinger. This will:
- reduce the number of binder transactions needed to create a record track
- move sample rate, framecount and flags validations to audio server side
- move audio session allocation to audio server side
- prepare restriction of certain binder transactions to audioserver only
Also:
- renamed openRecord() to createRecord() for consistency with AudioTrack
- make AudioRecord mStatus update consistent when calling default
contructor + set() or constructor with arguments
- make AudioClient, CreateTrackXXX and CreateRecordXXX classes derive
from Parcelable
- restore audio session ID validity check in AudioFlinger::createTrack()
Test: CTS tests: AudioRecordTest, AudioRecordingConfigurationTest, AudioPreProcessingTest
Test: manual test for capture use cases: camcorder, OK Google, VoIP calls
Change-Id: I72edaa7ddef1da11c77df21e88378e3aa9012d58
Refactor the mechanism used by audio tracks to query and attach
to an output mixer/stream in audio flinger. This will:
- reduce the number of binder transactions needed to create a track
- move sample rate, framecount and flags validations to audio server
side
- move audio session allocation to audio server side
- prepare restriction of certain binder transactions to audioserver only
Test: CTS tests for AudioTrack
Change-Id: If4369aad6c080a56c0b42fbfcc97c8ade17a7439
Use AIDL to generate the IAudioRecord interface rather than using
a manually implemented interface.
Bug: 64223827
Test: Ran the AudioNativeTest and CtsMediaTestCases CTS tests.
Change-Id: Iade23c73253a97c358050bbd697ebe592b89a4c0
Make the binder opcode names match the method names
Test: builds OK, this does not change behavior
Change-Id: I7c56ddd1efabc81b5d0ab2d1979ba1001ec76994
This will allow to track activity at the track level instead of
at audio session level as only possible with current implementation.
AudioTracks and AudioRecords will receive a unique audio port ID the
first time they register to audio policy with
getOutputForAttr()/getInputForAttr() and keep this ID for their
lifetime.
This CL is the first partial change and just updates the
audio policy and audio flinger APIs used at track creation time.
Test: basic regression test of audio playback and capture use cases
Change-Id: I8d612e67738e120494f61e3f7c60bfd0b2c6a329
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