Binder doesn't hold on to the death recipient.
This caused audio server to miss notifications about system server
death.
Fixes: 153080001
Test: Manual verification of killing the system process.
Change-Id: Iad1b2d4c5348d3d9917efc6838e86b736fa33094
Previously, audio policy client would call an method on the sound
trigger middleware service. This has been replaced by the sound
trigger service registering a callback, in order to avoid a cyclic
dependency between the services.
Bug: 146157104
Merged-In: I876461a7650d337d6dd05fbe80efaf08f8ef20dd
Change-Id: Ia8f674d7dd50f6dcdd6595bcbadec2f25fdb3561
This is a helper class for notifying a client of capture
state changes.
Bug: 146157104
Test: Compiles (further testing as part of the topic).
Merged-In: Ie27bc404805d319a6969290a6369d59fb68c1f38
Change-Id: I2902468c4692ba68e4bc9be0e5038d5505da7154
Initialize variable 'strategy' in
AudioFlinger::EffectBase::updatePolicyState.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: I5aad916a9873122eed0bb8e40bb26d677f338b16
The UID of the current InputMethodService (DEFAULT_INPUT_METHOD) is
pushed from AudioService to AudioPolicyService via AudioSystem.
Allow capture audio if:
- the UID is the current InputMethodService's UID,
- AND a RTT call is active,
- AND the source is AUDIO_SOURCE_VOICE_RECOGNITION.
Bug: 147037345
Test: use voice input with Gboard 9.1.4 during a simulated RTT call.
Change-Id: Ib32ec25e962833eddd0320742e177e3c1e0e5c05
In aaudio, when adding tracks to mixed stream, it is needed to update
audio attributes to HAL whenever the tracks are added or removed.
Currently, only the audio attributes used to open the stream will be
sent to the HAL. In that case, adding audio attributes of the clients
when starting the stream can help solve the problem. In audio flinger,
the client's audio attributes will be used to create MmapTrack.
Test: play multiple aaudio tracks, add log
Bug: 77279923
Change-Id: Ic1c536049e194a2bb7513425ee4828d52769d27f
Initialize variable 'io' in
AudioFlinger::EffectBase::updatePolicyState.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: Ib8c71eaf83dc140874d3e65a094e52e36918160f
Added missing notification to the APM client
about new audio ports. This should make the
ports provided by the newly discovered HAL
to be available to apps.
Process the onNewAudioModulesAvailable notification
on the "APM Output" command thread to avoid clashing
with outgoing commands from APM during module
initialization.
Bug: 149854039
Test: atest audiopolicy_tests
Change-Id: I3fede7f5a04419b15e15476d8b5ac7dc6d63c98d
Stream for which no attributes is associated (aka no strategy supports it)
will use default attributes hence it will change the default strategy
volume (aka Music).
It leads to eroneous volume changes.
This bug does not happen on phone / tablets targets as all streams are
linked to a strategy with specifc attributes.
In case of OEM configuration, some stream types may not be supported
and associated to any strategy.
Bug: 136121584
Test: dumpsys audio & dumpsus media.audio_policy.
Ensure volumes of stream types and their aliases match.
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: I5e12b2c7248074d10affb6c28d1866d4589cb9e8
Merged-In: I5e12b2c7248074d10affb6c28d1866d4589cb9e8
If a strategy matches a attributes, whatever a stream type has
been provided, the MUSIC stream type shall be returned as a fallback
to ensure AudioFlinger will apply the right gain to the right stream
(which always fallback as music if none is provided)
Bug: 136121584
Test: build & run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioProductStrategyTest
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioVolumeGroupTest
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioVolumeGroupChangeHandlerTest
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testPermissionsForVolumePerAttributes
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testGetAndValidateProductStrategies
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testGetAndValidateVolumeGroups
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testSetGetVolumePerAttributesWithInvalidAttributes
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testSetGetVolumePerAttributes
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testVolumeGroupCallback
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Change-Id: Ic79effb1341b788d90f5d73d23ae92b983f17225
Merged-In: Ic79effb1341b788d90f5d73d23ae92b983f17225
When start/resume activity, WindowManagerService start/resume the
activity, then post a runnable to DiaplayThread and
ActivityManagerService to update UidRecord's
proc state, because the thread switch, the latency before proc
state update is undetermined.
When CameraService calls ActivityManagerService.isUidActive(), the proc
state may not have been updated and camera access is denied.
isUidActiveOrForeground() will check isUidActive() first, if false,
check isUidForeground() which is actually to check with WindowManagerService if
the uid is foreground, which is equivalent to ActivityManagerService's uid
active, just updated earlier.
Bug: 151185692, 151777097, 109950150
Test: manual test.
Change-Id: I3685e0c8d2e69ca7ff3c4de4bef4ec754c400015
Use media utility function limitProcessMemory().
Test: restrict mediametrics memory by property, ensure restart
Bug: 152084875
Change-Id: I20b51cecd67e9ac5e03ab34c1c68b1cfd0b8a964
Disordered sequence will occur when delayMs of muting volume
and changing path are the same and no additional delay between
both commands (muteWaitMs == 0).
Add half reported latency to delayMs for routing could avoid
processing muting stream volume and switching path concurrently.
Bug: 149798335
Test: Make VoIP/voice call and switch device between handset/handsfree.
Check if touch tone is truncated in QXDM.
Signed-off-by: Jasmine Cha <chajasmine@google.com>
Change-Id: Ifa15ba9de330805637cfb20ee96c4293c1c1bd31
Add an argument to IAudioFlinger::createEffect() API to
ask AudioFlinger to just run the pre flight checks but not
create the actual audio effect instance and allocate resources.
This is the basis of an API for apps to query if a given
effect can be created without having to allocate the resources
and risk an exception when calling the constructor.
Bug: 150699608
Test: CTS and GTS Tests for audio effects
Change-Id: Ibdda22fd945c88c33e3c7342a7a5ed3e02d399ac
Clear the cached previous request in case of
successful offline switch. The request can
potentially continue to have valid references
to offline streams.
Clear the online camera device reference after
composite streams switch to offline mode.
In this case, all internal offline streams must
be released by the offline session.
Bug: 149346795
Test: Camera CTS
Change-Id: If29308dd0f402ab492e304e0475005b2a9801e74
Test: Boot device, see if setup video plays
Test: atp/tv_***_video_playback_smoke_test
Bug: 151156096
Bug: 151163101
Change-Id: I768bf36765fdc5dbd81c4c7632741f47e148147b
Replace global static instances of non-primitive
types with function static instances. The latter
get initialized on the first call to the function
instead of module load time.
This also gets rid of ASAN UAF errors reported
during unit test execution.
Bug: 150649241
Test: atest audiopolicy_tests
Test: atest audio_health_tests
(for ASAN-instrumented libraries and test)
Change-Id: I514c9205b9d3e7a3f0a1d8aa71d71fcc792e7a7b
* changes:
Plumb the notification about audio HAL services update to APM
libaudiohal: Allow late registration of HIDL HAL services
Allow for late audio module discovery in APM
The onCameraOpened/onCameraClosed callbacks are used to notify camera
service client with [] permission that a certain camera device has been
opened/closed.
Test: Manually check callbacks are received in SystemUI app
Bug: 150540299
Change-Id: If6f3624c43927c30afef7df0a780eafe3ae4c527
Merged-In: If6f3624c43927c30afef7df0a780eafe3ae4c527
AudioFlinger registers a callback with libaudiohal to receive
notifications when new HAL services get registered. It relays
the notification to AudioPolicyManager via AudioSystem /
IAudioPolicyService interface.
Because AF / APM only interact via Binder interfaces and APM's
interface gets registered later than AF's, the notification
from AF is made asynchronous.
Bug: 149854039
Test: audio test on a regular phone configuration
audio test on a phone with MSD audio HAL module
Change-Id: I158e941b8f75e2a4614b9d84ca798b0f1f47aa6a
Extract code that loads hardware modules and fills out
mAvailable{Input|Output}Devices into a reusable function.
It is used both during APM initialization and on
receiving a notification that a new HAL service has
been discovered.
Bug: 149854039
Test: atest audiopolicy_tests
Change-Id: Ifb7f0b61b06a0609802e63dccb26f3472328ef48
The onCameraOpened/onCameraClosed callbacks are used to notify camera
service client with CAMERA_OPEN_CLOSE_LISTENER permission that a certain
camera device has been opened/closed.
Test: Manually check callbacks are received in SystemUI app
Bug: 150540299
Change-Id: If6f3624c43927c30afef7df0a780eafe3ae4c527