Add check for privileged permission if attributes
flags BYPASS_INTERRUPTION_POLICY or BYPASS_MUTE are set.
Bug: 131873101
Test: Manual smoke tests for audio playback.
Test: Emergency cell broadcast in
Change-Id: I073cf669f606f0d081ff5c8d19f39b5e12efe297
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
When AudioRecord object is destroyed, it must unregister
with AudioManager so it removes the tracker from
the tracking list.
Bug: 123312504
Test: start and stop audio recording, check "dumpsys audio"
Change-Id: Ida71512cb811d7602da349a58a91c95111078ef4
Callback may wait nearly the entire period when double buffered
which can lead to random glitches. Limit this to half the mixer period.
Test: aaudio test write_sine_callback -pl -n1 -r44100 -s20
Bug: 129545307
Bug: 131601263
Change-Id: I6b7478728fe7ead570251662ee48a8f8adad0d5d
Do not force audio device changed callback when the client
(AudioTrack or AudioRecord) registers to AudioFlinger but only when
it starts playback or capture. Doing so prevents a spurious callback
happing at registration time where a stale device
(previously selected by AudioFlinger thread) but irrelevant to this
client is indicated. This causes a disconnection of AAudio streams
despite no real device change.
Bug: 128630993
Test: CTS: android.nativemedia.aaudio.AAudioTests, android.media.cts.RoutingTest
CTS Verifier: Audio Input/Output Routing Notifications Test
Change-Id: Ia7f1d11490989b0287c97479466c1c07a223aab3
The client must provide a unique Record ID (RIID) when creating
an AudioRecord. This RIID is passed down to AudioInputDescriptor
in AudioPolicyManager which sends configuration updates
via IAudioPolicyServiceClient callback.
By supplying RIID, the Audio Service can coalesce start / stop
events coming from clients (apps) with recording configuration
update events.
For AAudio MMap clients everything is handled at the server
side because they correspond directly to audioserver objects.
Bug: 123312504
Test: android.media.cts.AudioRecordingConfigurationTest
AudioRecordTest#testAudioRecordInfoCallback
MediaRecorderTest#testAudioRecordInfoCallback
manual testing using Oboe and Solo test apps
Change-Id: I3d32241752d9a747736606dc4cb1e068e6b7aa3b
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
Remove effect specific mutex (mEffectLock) in AudioPolicyService: Due to
concurrent capture (among other reasons), it is necessary that the audio
policy manager state preserved by mLock includes audio effects
registration and enabling.
Moved all audio policy API calls from audio flinger out of locked regions
for audio flinger, thread and effects mutexes to avoid cross deadlocks
between audioflinger and audio policy manager:
- centralized audio policy API calls in EffectModule::updatePolicyState()
- the enabled state now reflects the state requested by the controlling
handle, not the actual effect processing state: a suspended effect is
now considered enabled.
A new audio policy manager API moveEffectsToIo() is added to atomically
handle moving effects to a new input or output without having to call
unregister > register > enable sequence.
Also fix assert in setStreamVolume to match volume group refactoring
in audio policy manager.
Bug: 128419018
Test: CTS tests for audio effects.
Test: manual tests with Duo calls, Play Music, Youtube, notifications
with and without Bluetooth and wired headset.
Change-Id: I8bd3af81026c55b6be283b3a9b41fe4998e060fd
Regression caught on Attributes referred by their flags only
(like BT SCO).
Client may have more flags than the product strategy, checks
to be done on all the flags of the product strategy are requested
by the client.
Bug: 130284799
Test: make
Change-Id: Ie8d41a592342bc0a7a0326f9766e7e7503154e62
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Handles change in Q, where we do not return an invalid kernel time
in the extended timestamp when there is a reported error from the HAL.
Test: Photos, File playback, AudioTrackSurroundTest#testPlaySineSweepBytes
Bug: 113294730
Bug: 118506063
Bug: 119895849
Bug: 120631792
Change-Id: I90f2c7c314baa474c3dd3a24042f1d4b8bc0a12b
The matching rule on audio attributes flags must be that ALL flags
set in the reference attributes are present in the compared attributes
and not just some flags.
Bug: 129721367
Test: change volume in Play Music
Change-Id: I6b5ada937aa169dbf1b0315d56172ae3b7bb4f47
(cherry picked from commit c0c6074f55)
Apps were previously forced to set their allowed capture policy from
either their manifest which is not flexible or from each track which is
a very fine grain but difficult when using libraries like exoplayer.
Thus add an application level policy set with AudioManager.
Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 111453086
Change-Id: Ic890b5b041affea757fbd3f2707ff2ce18771828
Signed-off-by: Kevin Rocard <krocard@google.com>
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>
Combine adjust channels buffer provider and adjust channels non-destructive
buffer provider.
When contracting mono + haptic channels to mono, do not use
adjust_channels to avoid mixing haptic channel into audio channel.
Bug: 125915810
Test: play audio-haptic coupled files
Change-Id: I39916a3e0628a44ed4a148c265564af7135a2176
When an AudioTrack or AudioRecord is created by system server,
if restoreTrack_l() or restoreRecord_l() is called from AudioTrackThread
or AudioRecordThread, and that then calls audioserver through binder,
which then calls a Java service, binder recursion may call Java
on the original calling thread.
Test: bluetooth calls don't crash
Bug: 126948865
Bug: 127619936
Change-Id: I41fcb666d07c4ab985f5590e40e0c310709e786d
This CL adds the concept of Volume Group to the engine.
It generalizes the volume management today controled by stream types
and hard coded into AOSP.
The goal is to control the volume per attributes, being able to define
a group of attributes that follow the same volume curves.
It intends to replace the concept of aliases in AudioService.
Bug: 124767636
Test: build
Change-Id: Icd079374cc1680d074b01836eca0bceb0b0c5247
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Use the constant from IExternalVibratorService.
Bug: 124318236
Test: play audio-haptic coupled file
Change-Id: Ice2ac13d0f6a6a749bb6243230524336144fa5f4
commit 24a9fb0d left some locking issues with management of device
callbacks in AudioSystem, AudioTrack and AudioRecord.
This change makes that the AudioSystem mutex is not held when
callbacks are called into AudioTrack and AudioRecord removing cross
deadlock risks and allowing AudioRecord and AudioTrack to hold their
mutexes while installing and handling the callbacks
Test: CTS RoutingTest, AudioTrackTest, AudioRecordTest
Change-Id: I5d17e77ca26220092deb0bd6e5a33dc32348d460
This CL forces the onAudioDeviceUpdate on register event.
It also fixes the loss of callback on AudioTrack or AudioRecord
client if received before ioHandle is assigned.
Test: audio smoke tests
Test: CTS for AudioTrack and AudioRouting
Change-Id: I119b5c407da68a5b55162550bea5fa7e724165d1
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
A media application takes advantage of HwAudioSource would call
start/stopAudioSource directly.
Bug: 112161027
Test: Launch FM Tuner application
Change-Id: Ic4c23f51010dbb3f2226d9d2200e11feb908867b
The secondary are returned from mixes (from DAP loopback&render),
from getOutputForAttr.
All getOutputForAttr* of the stack are update.
Internal getOutputForAttr use descriptor, external one use handles.
The secondary output are saved in each track and the track is
invalidated if the list of secondary output changes.
In audio flinger, create a pair of recordTrack & patchTrack to pipe
the intercepted audio audio to the secondary output.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: Id6523d9e383c15a0e39313d5f355df809b7e72fe
IMPORTANT NOTE:
CL depends on another CL in frameworks/base
https://partner-android-review.googlesource.com/c/platform/frameworks/base/+/1206275
AudioProductStrategies offers the possibility to dynamically
translate attributes to stream types (and vice versa) within
audio policy engine.
Legacy engine has hard coded rules to maintain the translation
service.
This patch removes the hardcoded translation within the helper
and replaces them by AudioProductStrategy APIs.
Test: AudioPolicyTests: AudioProductStrategiesAllStreamsTest
It loops on all stream types supported by strategy and ensures
device selection matches. Hard coded stuff would prevent right device
selection.
Test: CTS: AudioTrackTest AudioRecordTest
Test: audio smoke test on sailfish, walleye blueline
Change-Id: I76589df5555136ed49dbacc7aac9b0b5e828bef2
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
This CL adds required introspection APIs to deal with product strategies:
-getter of the collection of product strategies
-helper function to return the strategy associated to a given attributes.
This API is mandatory to avoid duplicating the logic that compiles the strategy
for a given Audio Attributes structure.
Test: make
Change-Id: I0e107570a44227bb52a4f359954c93215d4f8bae
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
-Adds new Engine APIs for Product Strategy management
-Adds a common engine code to handle product strategies
-Adds a parsing configuration library to feed the strategies
-Prepare both engine for the switch
Test: make
Change-Id: I00f57ece798893bc6f9aa9ed54a3e5237e8d5cf1
mAttributes in AudioTrack can not be set in AudioTrack::set()
when pAttributes is NULL.
AudioTrack::getPosition() sometimes returns wrong value
since mAttributes is undefined value.
This change sets default values to mAttributes.
Bug: 123607740
Test: manual
Change-Id: Ie590c17efc466cc89cbd7e9f89fc3ebeed98eace
Use the same logic in VibrationEffect.scale to control the intensity of
haptic playback in audio framework. Note that as the maximum amplitude
of vibrator is 255, convert the haptic data to pcm_8_bit before doing
scaling.
Test: Manually
Change-Id: I6136d27c9255a215834b6e3092aa8ad696fbae04
Test: Change Balance through Settings, play audio
Bug: 28390736
Co-author: Ed Savage-Jones <edward.savage-jones@sony.com>
Change-Id: I0169b436ccbaa5628584d9f4954dd7c76d021aae
This reverts commit 7194e6da8a.
Reason for revert: AOSP is fixed with new vendor image
Change-Id: I15797a30abcc304379db05bec1b25a0bd95b2ff4
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
libaudioclient and libmedia are using get_sched_policy and
set_sched_policy which are now implemented inside libprocessgroup.
Add required dependencies and include required headers.
Exempt-From-Owner-Approval: janitorial
Bug: 111307099
Test: builds, boots
Merged-In: I83dd6878839122e3ea71b7be6f6f312376897d56
Change-Id: I83dd6878839122e3ea71b7be6f6f312376897d56
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Add support in AudioPolicyManager to return supported encoding
formats for A2DP on the primary HAL. Current implementation is
to query prop defined and convert this to a list of audio formats
Bug: 111812273
Test: make
Change-Id: Ic3ea72e19aa4c0bd4c156f62e45e6225f9ce6b11
Add support in AudioPolicyManager to select a module,
device or output based on device type and codec.
Implement hybrid mode with A2DP which enables runtime
switching between HALs for A2DP based on offload support
for specific A2DP codecs.
Optimize A2DP active device change and device config
change in AudioPolicyManager.
Bug: 111812273
Test: make
Change-Id: I246d71dd08bacbca6ed9b0012e7d7698bd8a0953
libaudioclient and libmedia are using get_sched_policy and
set_sched_policy which are now implemented inside libprocessgroup.
Add required dependencies and include required headers.
Exempt-From-Owner-Approval: janitorial
Bug: 111307099
Test: builds, boots
Change-Id: I83dd6878839122e3ea71b7be6f6f312376897d56
Signed-off-by: Suren Baghdasaryan <surenb@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
Report more information in onRecordingConfigurationUpdate() callback:
- For client:
- Port ID
- Enabled effects
- Silenced by policy
- For stream:
- Active effects
- Active audio source
Bug: 111438757
Test: make
Change-Id: I34c3d0ee6251576de7d793bfaa2bc2c34efa2319
As haptic playback via audio require sample rate is the same as the HAL
one, sample rate should not be changed after AudioTrack is created.
Bug: 121271890
Test: Manually
Change-Id: I1549017b3ca8523735190f62f8c9a4fb8b95e000
When trying to play with haptic channel mask, use adjust channels
buffer provider to make the haptic channel the same as the output one.
If haptic playback is supported, use adjust channel non destructive
buffer provider to output haptic data to the end of the sink buffer.
Otherwise, haptic data will be ignored.
Test: Manually
Bug: 111454766
Change-Id: Ic5f780de48c1e71de6ba5c4774d1ed2e9c8c51a0
1. Add adjust channels buffer provider, which will expand or contract
sample data from one interleaved channel format to another. Expanded
channels are filled with zeros and put at the end of each frames.
Contracted channels are omitted from the end of each audio frame.
2. Add adjust channels non destructive buffer provider, which could
expand or contract sample data from one interleaved channel format to
another while not destructing the buffer. Extra expanded channels are
interleaved in from the end of the input buffer. Contracted channels are
copied to the end of the output buffer. Contracted channels could be
written to an output buffer with certain audio format.
Test: Manually
Bug: 111454766
Change-Id: I3f963307e73b3f7aa662d4127f78f0c61ac84510
This reverts commit 4c1ef4b64d.
Reason for revert: b/120588242
Bug: 120588242
Change-Id: Iac41f371cb739c54d5ce519232688bebe2285c72
Test: Launch QSB and capture from mic icon
The method checks whether the provided AudioFormat can be played
via currently connected output devices w/o SRC or downmixing
by the framework.
The implementation methods are called 'isDirectOutputSupported'
to match APM's terminology.
Bug: 120044865
Test: atest CtsMediaTestCases:AudioTrackTest#testBuilderValidate
Change-Id: I11769f796c34583fb2641415d2faab00ac526123
Implement concurrent capture in audio policy manager:
- Attach AudioRecord client to already opened input when possible
instead of systematically opening a new input for each client.
- Always allow inputs to start even in case of concurrency.
- Clients are selectively silenced based on their app state by audio
policy service.
- In case of concurrency on a given input stream, device and source is
chosen based app states and source priority.
Bug: 111438757
Test: Manual capture tests with solotester and Camera, Assistant and Duo
Test: CTS tests for AudioRecord
Change-Id: I302710ff545f67361d9aca89e81de40771ce7fb0
Return the port ID allocated by audio policy manager instead of the
internal track ID allocated by audio flinger when an AudioTrack or
AudioRecord is created.
This information is more useful for logs and allows to associate information coming
from audiopolicy manager with a specific client instance.
Bug: 111438757
Test: Manual playback and capture tests
Change-Id: Ib467d8fcc34d9a8aa7bcaac0770a741982b847c5
The Java AudioTrack interface has a setPresentation API. This
calls the setParameters API in IAudioTrack. However, this does
not eventuate into a call into the android.hardware.audio@4.0
IStreamOut selectPresentation API.
Add selectPresentation API to IAudioTrack and call down to the
android.hardware.audio@4.0 IStreamOut selectPresentation API.
Translate into calls to setParameters API for legacy HAL
interfaces.
Bug: 63901775
Test: compile
Change-Id: Id634a107f3f93ab18dc80d2bd0af67bda35e859f
Add APIs to communicate assistant and accessibility service UIDs
to audio policy service in order to implement the new concurrent
capture policy.
Bug: 111438757
Test: enable and disable Google Assistant and Voice Access.
Change-Id: Ia804613051edab2ebd57d317b5b7509c98e7c6b4
If the track thread is paused, EVENT_STREAM_END will not delivered
for offload. This event is required for PRESENTATION_END to
be delivered for Java AudioTrack offload.
Bug: 86837964
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioTrackOffloadTest
Change-Id: I491cdb0a6faa69e5c37139c0364b5c9079ff1f14
New transfer mode for java AudioTrack using offload
path, where data is provided through the write method,
and the callback is used to notify the track owner
more data can be written on the track.
Bug 86837964
Test: adb shell clof --source /sdcard/Music/my.mp3
Change-Id: I47c760b7fb8f1431945ca24ff4a26311b63cb761
Allow retry on failure to reconnected to audioserver when restoring an
AudioTrack or AudioRecord and do not change state to inactive when
reconnection fails. In case of failure due to temporary race conditions this will
increase the chances of success and avoid ending up in an inconsistent
active state if a later reconnection succeeds.
Bug: 113109529
Test: AudioTrack CTS tests and manual playback smoke tests.
Test: AudioRecord CTS tests and manual capture smoke tests.
Change-Id: I570724eb46f3a0f830267396aba06297bd37df7a
When there is a TimeCheck timeout crash, the transaction code will be
useful for debugging.
Test: Manual run
Change-Id: I8a93ead7ec7379f51b211ca31c68ec6ec2553afc
Merged-In: I4716852c77d56703ad5f3dfc2500f598a2b80a12
To play the following tones as per Indian standards.
- Dial tone
- Busy tone
- Congestion tone
- Call waiting tone
- Ringing tone
Bug: 117161543
Test: Play each tone in indian locale
Change-Id: I6b7a2a5674a79a26fba80f987d2ed6ed555ce4bf
Optimizing compilers may skip masking if the result of
subtraction is assigned to larger integral type.
Test: long term test with 64 bit audioserver
Bug: 113763960
Change-Id: Ida405a5a26e819891e7da7f29ebd0b78d2de1fc5
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: Icafaff606364fe7bffaad1e9c2e763c444ea999c
NBLog.cpp was deleted and split up into Entry.cpp, Merger.cpp,
Reader.cpp, Timeline.cpp, and Writer.cpp. NBLog.h was split up into
Entry.h, Events.h, Merger.h, Reader.h, Timeline.h, and Writer.h. NBLog.h
now includes all of these new headers except Merger.h, which is managed
exclusively by MediaLogService.
Other changes:
- changed NBLog from a class to a namespace
- changed NBLog::thread_info_t.type to enum and replaced magic numbers
- fixed some fragile build dependencies in libaudioclient and medialog
No other changes were made, and all functionalities that existed prior
to this commit remain the same.
Test: build, dumpsys media.log
Bug: 68148948
Change-Id: I1ce6dcb7b30d004f90584edfad7103a89f7bab0c
* Use time_t for tv_sec type.
* Use 'auto' to avoid explicitly use of 'long'.
* Use (u)int16_t instead of (unsigned) short.
Bug: 112478838
Test: build with WITH_TIDY=1
Change-Id: I023e579b071688731064e51dc94f404274cd59e2
Allows runtime modification of what effects should be default
attached to sources of different types. The core functionality
was already in the AudioPolicyEffects system, this allows
the dynamic modification of the lists.
Bug: 78527120
Test: Builds, manually tested an app adding a source effect,
tested both media on the specified source and on a different source.
Also tested by Android Things integration tests.
Change-Id: I4da15787278c79d80043e172f4f81d3b2a139f44
The object of AudioEffect may be deleted when construction ongoing,
if the method of mIEffectClient invoked by the proxy in audioflinger.
If mIEffectClient cleared in the destructor of AudioEffect before IEffect
linkToDeath to mIEffectClient in the constructor of the AudioEffect,
the aforementioned case may lead to an abort, i.e.,
"Abort Message: 'linkToDeath():recipient must be non-NULL".
Test: monkey test
Change-Id: I5fe8227b8528fb9fb9c9a1e636bd4dc0cc22c2cf
When a track is reused from SoundPool and started again, the
previous callback events could be done after track started,
then the new playback will be stopped unintentionally.
Clear the old cblk flags when recycled track is started again
to avoid triggering unexpected callback events.
Bug: 112269355
Test: Playback with SoundPool frequently
Change-Id: I111b085d08b73c333fbb0fc2896efe1c013c584c
Enable log function in ToneGenerator.cpp, then ToneGenerator
plays consecutively many times and do not stopTone.
"lpToneGen->mNextSegSmp*1000" will go beyond the scope of unsigned
int, and audioserver get crashed.
Test: Enable log function in ToneGenerator.cpp, alarm notification is
played when the phone is online. ToneGenerator plays consecutively.
Do not stopTone. then we get audioserver crash.
Change-Id: I073590088fccb32a73353d14970dc89441045663
Allows runtime modification of what effects should be default
attached to streams of different types/usages. The core functionality
was already in the AudioPolicyEffects system, this allows
the dynamic modification of the lists.
Bug: 78527120
Test: Builds, manually tested an app adding a stream effect,
tested both media on the specified stream and on a different stream.
Also tested by Android Things integration tests.
Change-Id: Ie0426b17ff7daece58b8c85d72fbef620844325b
Adds audio_usage_to_stream_type method to aid in converting
audio_usage_t to the legacy audio_stream_type_t.
Bug: 78527120
Test: Builds
Change-Id: I411bb687d0f46b82afef3a2e9ac6a974f922da91
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
Refactor management of hardware audio sources to make use of
ClientDescriptor class:
- HW sources are now tracked by port ID and not audio patch handle.
- startAudioSource() and stopAudioSource() APIs are updated to use
audio_port_handle_t as source identifier.
- AudioSourceDescriptor class is deleted and replaced by
SourceClientDescriptor class deriving from TrackClientDescriptor
Test: make.
Change-Id: Ie418b566519a591f036b538a77319f8e30aa99a8
Refactor audio policy service APIs controlling audio playback (startOutput, stopOutput, releaseOutput)
To allow finer grain control per AudioTrack client.
Test: AudioTrack CTS test. manual test of playback use cases.
Change-Id: I49a681f3c2a8211e524824993049b24d8086376d
Add event logging in case of audioserver watchdog to help
collect statistics.
Test: make. Simulate watchdog and check events in logcat.
Change-Id: I4716852c77d56703ad5f3dfc2500f598a2b80a12
Allows common use for latency computation.
Implementation for AudioRecordServerProxy added.
Test: audio sanity, subsequent latency tests
Bug: 80447764
Change-Id: Ib53181cdced16606bf268769a04bd52c689d89d3
Replaces main and aux buf from track dump.
Bug: 80272001
Test: adb shell dumpsys media.audio_flinger
Change-Id: I5d6565410e652ec7fc6701b171d299dea9f7bc3e
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
Handle A2DP codec config change in audio HAL without
closing / re-opening outputs or invalidating streams
from AudioPolicyManager.
Bug: 79476124
Test: music playback over BT A2DP
Change-Id: I87263da32815a4d4f6273068ef0b2a5b93c73b75
To make surround sound setting more clear to users, we are changing
surround setting from ALWAYS to MANUAL. With MANUAL, users could enable
surround formats according to their need.
Bug: 67479735
Test: Try creating AudioTrack with enable/disable surround formats.
Change-Id: Ia6c0e1210ff6215f4b80a278a0aa90ca9543f262
Some system apps (not having system AIDs) still need this
hidden API due to lack of better option for media use case routing.
Add protection by privileged permission MODIFY_AUDIO_ROUTING instead.
Bug: 79475856
Test: manual regression for music playback over speaker and bluetooth
Change-Id: Icaa585a9fa4c043c291f24c9bab4a93f02406955