History log of /frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9bb909f379694ff4eca4b3aefc6a5ce60e7a0e8a 12-Apr-2018 Andy Hung <hunga@google.com> Sanitize effect descriptors for AudioPolicyService binder calls.

Zero initialize structs before parcel read, if status is not checked.
Sanitize parcel read audio_port_config.

Test: Audio CTS, See bug for POC
Bug: 73126106
Merged-in: Iece43eb463385927e6babcf93654eea8aaebc29c
Change-Id: Iece43eb463385927e6babcf93654eea8aaebc29c
(cherry picked from commit 498bdcc90bc470a79bf8943cbac64502f7c1c091)
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
9c8bf056282f7094405414a3f0765aac85579506 13-Nov-2017 Kevin Rocard <krocard@google.com> IAudioPolicyService: Add attribute tags sanitization

When audio_attributes_t was read from the binder parcel,
the string tags field was copied without checking that
it contained a '\0'.

This could lead to read past the end when tags were used.

This patch always adds a '\0' at the end of the buffer when
deserializing.

Bug: 68953950
Test: manual playback/record
Test: send binder payload without \0 in tags attribute, check that only
AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 char are printed.
Change-Id: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Merged-In: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 39fdbd097a147b5c719dac9ad2759e6c44eb3a4e)
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
a54f1283fdd9adbd64ecca4e14af56aaa0e8c825 02-Jul-2017 Eric Laurent <elaurent@google.com> aaudio: indicate client UID and PID to audio flinger

Implement correct indication of client UID and PID to audio flinger
for AAudio MMAP streams in both exclusive mode and shared mode.
- Add start/stop client methods on MMAP streams used only when the MMAP
stream is in AAudio service and carries a mix of shared streams.
- Add "In Service'" indication from "client" side to AAudioServiceStreamMMAP
so that the behavior can be adapted accordingly.
- Modify logic on audio flinger side with regard to mmap tracks and
audio HAL stream activity:
- use same audio session for all clients on a same stream to match
audio policy logic to share same direct output stream for clients on same
session. This is also more consistent with current volume and effect
handling as all MMAP clients sharing the same output stream have the
same volume and use case.
- start/stop the HAL when the stream is started/stopped with the initial client
handle (returned when the stream is opened) but do not create a track.
AAudioService implementation will always send an additional start command before
first client starts and a stop command after last client stops,
in both shared and exclusive mode.
- start/stop a track only if the start/stop stream command is received
with a handle different from the initial handle.
- Allow more than one active client from the same UID on a MMAP input in audio policy.

Bug: 62950008
Test: verify playback and capture in mmap mode
Change-Id: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
9ae8c597d9a0c8cedc4047fc4716d7361453f6ab 23-Jun-2017 Eric Laurent <elaurent@google.com> Set initial audio device for AudioTrack and AudioRecord

Bug: 62090113
Test: run AAudio test and verify a valid device is reported just
after opening playback or capture streams in legacy mode.

Change-Id: Ic8be42e1735690eb00c811ef0cb8b5abb36172d6
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
ac9cef5f3288df6e65cb4488e2615cc3c07b70d0 10-Jun-2017 Eric Laurent <elaurent@google.com> audio policy: add method to query dB attenuation for a certain volume and device

Bug: 62492975
Test: Check dB value returned to AudioService when stream volume is
changed

Change-Id: I8d0a945e9151d230b93634e4b9e57bab68f44fa8
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
d7c5ec857930496bb8a1045dc8b87b2fdd99899c 11-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add missing nullptr checks for data.readCString() strings" am: ce961d374f am: 238c48e42e am: 877f779979
am: 4b058e7e5d

Change-Id: Idc3298b161380e9ace8b7fcceb4339b0805a3123
c694ff449bef4ca1e45a6506f34e66c613757311 10-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Add missing nullptr checks for data.readCString() strings

Protect the Audio Policy Manager by adding extra checks
for data.readCString() strings when parsing / decoding
a Binder transaction.

Also:
* Moved audio_is_output_device() / audio_is_input_device() checks
inside handleDeviceConfigChange()
from the AudioPolicyInterface to the AudioPolicyManager
* Removed similar redundant checks inside
AudioPolicyService::setDeviceConnectionState()

Test: code compilation
Change-Id: Ib32a28ba2669b73aaf32b31bb18f41c8dd7d2605
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
5fd7ccaeba88da7e170f067bfd754b3f64ff5566 29-Dec-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism for handling audio device configuration change" am: 549e431947 am: a1b496ac35 am: fcc1132010
am: c6fe843463

Change-Id: I7812e3e4426e526b886c1a414ac8ddec7649291e
f862bc6a7a35054e38cb50fa16ae7a07f683ee01 27-Dec-2016 Pavlin Radoslavov <pavlin@google.com> Add a mechanism for handling audio device configuration change

* Added new call handleDeviceConfigChange() to the Media Framework.
That call can be used when there are device configuration changes
(e.g., Bluetooth A2DP codec configuration has changed).
* Added new method AudioPolicyManager::handleDeviceConfigChange().
That method toggles the UNAVAILABLE/AVAILABLE connection state of the
device, so it can be reconfigured as appropriate - e.g., the audio
feeding parameters can be updated.
* Fix ALOGVV compilation errors when extra logging is enabled.

Test: A2DP streaming to headsets
Bug: 30958229
Change-Id: I388abbbb3ec4d1a003b441cb0c77e00d80cad668
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
20b9ef0b55c9150ae11057ab997ae61be2d496ef 05-Dec-2016 Eric Laurent <elaurent@google.com> Add unique audio port IDs to AudioTrack and AudioRecord

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
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
795a2a75542d25eefa56bebc388340ee15fdff5c 02-Nov-2016 Marco Nelissen <marcone@google.com> Split libmedia into libmedia and libaudioclient

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
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp
538ec5e04f389cba637b030757be317fcb8677a8 02-Nov-2016 Marco Nelissen <marcone@google.com> Split libmedia into libmedia and libaudioclient

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
/frameworks/av/media/libaudioclient/IAudioPolicyService.cpp