Variable 'tag' in TimeCheck::TimeCheckThread::threadLoop
may end up being used w/o prior initialization.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: Ifc1efbee39007ea9cfba8083edbfdb763eafb8dc
The access to call audio (record and play) will be granted only to the app associated with Dialer role, who also includes a new system permission.
Test: Compilation and manual tests
Bug: 135197853
Change-Id: I65ca823c235d4d3420630837427103783ad1d1b0
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
Add specific audio session ID for effects applied to a
particular audio device.
Device specific effects will be attached to a particular audio sink or
source device identified by its unique audio port ID and will all use
this same session ID.
Only one session of this type exists on a given playback or record
thread.
All effects in this session apply to the same device ID and are created/released
when the routing (audio patch) of this thread output or input stream is updated.
Bug: 136294538
Test: make
Change-Id: I4e3a55ed1244b918429dd9e217b6efecc1ec6449
Align playback permission checks implementation in getOutputforAttr() on
capture checks in getInputForAttr(): use an "output type" returned by
audio policy manager and check permission accordingly.
- Do not modify but reject request to play to call uplink when permission
is denied.
- Add missing permission check for injection to remote submix.
- Clarify permission check for record from remote submix by using the
uid/pid of client explicitly.
Bug:
Test: CTS test for AudioTrack and AudioREcord.
Test: GTS tests for dynamic policies and playback capture
Change-Id: Ic0eb3b9921a491e97c58fa8f637583059a54b3a2
Add request to create tombstones of audio HAL servers before restarting
audioserver process when the watchdog triggers.
Add audio device factory HAL interface API to retrieve HAL process pids when
possible (on debug builds).
Add AudioFlinger service API to set audio HAL process pids from
JAVA AudioService.
Bug: 141528385
Test: Force watchdog and verify tombstone creation
Change-Id: I68c1e8fb4db23e5952ad0c93d7d0b9d121b8ec18
Capturing from source AUDIO_SOURCE_FM_TUNER is possible only via @SystemApi
on one end and does not capture from an actual on the other end.
Accordingly, do not check android.permission.RECORD_AUDIO anymore but
check privileged permission android.permission.CAPTURE_AUDIO_OUTPUT instead.
Also bypass App Ops OP_RECORD_AUDIO check which is applicable only to capture from
microphones.
Also fix audio recording permission check in MediaRecordClient to use
recordingAllowed() from ServiceUtilities
Bug: 135717621
Test: CTS tests for AudioRecord
Change-Id: Ibb1d72f018d2e3ceee195338f2e262183eee2a23
Only one system server seems to exist across multiple-users; however,
when the primary user is backgrounded, system server loses its
RECORD_AUDIO permission. Through a number of steps this prevents the
secondary user from starting any services that use the SoundTrigger HAL;
specifically, this was found because it prevents Oslo from functioning
when a secondary user is active.
Bug: 139839188
Test: Oslo use cases pass
Change-Id: Ia0dd5fd3b6992cb18279b81146b35ed040771245
Signed-off-by: Jeffrey Carlyle <jcarlyle@google.com>
This change renames the IMemory raw pointer accessors to
unsecure*() to make it apparent to coders and code reviewers
that the returned buffer may potentially be shared with
untrusted processes, who may, after the fact, attempt to
read and/or modify the contents. This may lead to hard to
find security bugs and hopefully the rename makes it harder
to forget.
The change also attempts to fix all the callsites to make
everything build correctly, but in the processes, wherever the
callsite code was not obviously secure, I added a TODO requesting
the owners to either document why it's secure or to change the
code. Apologies in advance to the owners if there are some false
positives here - I don't have enough context to reason about all
the different callsites.
Test: Completely syntactic change. Made sure code still builds.
Change-Id: I5fb99aa797c488406083178a6b05355d98710d3b
Enable audio capture by the Assistant when RTT is ON during a call
similarly to when an accessibility service is in the foreground.
Also remove log when permission checked for hotword
and audio output capture fail as those checks are now done
systematically.
Also do not check permission to bypass interruption policy if
bypass flags are not set.
Bug: 132976361
Test: use voice input during a call with RTT enabled.
Change-Id: Iff45b0816dac889262ec29ea115f74dea4dc6b6d
libmediautils was accidentally getting backtrace_string through
libmemunreachable. Remove the dependency, which is causing problems
for making libmemunreachable vendor_available, and use
libc_malloc_debug_backtrace instead.
Bug: 132302484
Test: m libmediautils
Change-Id: Ide83ce43027f28d548a76c607a84bab6604213cf
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
Package name will be cached in ModuleClient when attaching a client. It
will be used when querying permission of capturing hotword.
Test: test with logging.
Bug: 74078996
Bug: 122721589
Change-Id: Icd2911f5d331d243c9eb5d58003ce5525c70c81e
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>
Query the package manager to check if the app has not opt-out of its
playback being captured.
Test: adb shell audiorecorder --target /data/file1.raw &
adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
adb dumpsys media.audio_policy # check playback is not recorded
# change media player manifest to allowPlaybackCapture=true
adb dumpsys media.audio_policy # check playback is recorded
kill %1
adb pull /data/file1.raw && sox -r 48000 -e signed -b 16 -c 2 file1.raw file.wav&& audacity file.wav
# check silence then sound
Bug: 111453086
Change-Id: Id6fb7d0e10c02b0473bcbc0786e8360536996f48
Signed-off-by: Kevin Rocard <krocard@google.com>
Use AppOpsManager.checkOp() instead of AppOpsManager.noteOp() to verify
capture audio permission when creating an AudioRecord client.
This avoid false triggering of mic use UI indication if capture is not
actually active.
Test: verify main audio capture use cases
Change-Id: I38c7429bf2c8cdeaba907c868b94e39b69626c55
This allows us to remove camerserver's dependency on libmediandk,
thereby reducing its vss increase (brought about due to many of
libmediandk's dependencies, which cameraserver does not need)
Bug: 119582723
Test: mm -j64
Test: showmap <pid of cameraserver> vss before change: 50628
Test: showmap <pid of cameraserver> vss after change: 31256
Test: AImageReaderWindowHandleTest
Change-Id: I8dec6430adda538cb293cdd0d087b9ae1767b900
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
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
Add event logging in case of audioserver watchdog to help
collect statistics.
Test: make. Simulate watchdog and check events in logcat.
Change-Id: I4716852c77d56703ad5f3dfc2500f598a2b80a12
Add a verification on actual size of the fd backing up the IMemory
recevied for sound model or recognition config.
Fix similar problem for AudioTrack shared buffer.
Bug: 78596657
Test: run POC. OK Google regression.
Change-Id: I7cb02785f8ba46c437c7fcaa5b821f4b7e3240a0
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
Keep track of cpuset change requests in ResourceManagerService,
and request changing of cpuset via SchedulingPolicyService.
Bug: 72841545
Test:
1)Using modified Youtube/Exoplayer (that uses softMediaCodec
to decode VP9 profile2), manually verify the following:
- media.codec is put into top-app cpuset playing VP9 1080p HDR
- media.codec is put back into foreground after done
- media.codec stays in foreground cpuset playing other content
- kill the app process, verify media.codec is put back to
foreground until new instances request top-app
- kill mediaserver process, verify media.codec is put back to
foreground until new instances request top-app
- kill media.codec process, starting playback again, verify new
media.codec's cpuset can be changed correctly
- kill system_server process (using 'adb shell stop &&
adb shell start'), verify media.codec is put back to
foreground. Restart playback and verify the cpuset can be
changed correctly.
2) CTS post submit tests
Change-Id: Iba50ede1c08b695821fe4f56dbfc5694eab54e7b