AUDIO_SOURCE_DEFAULT is translated to AUDIO_SOURCE_MIC in
AudioPolicyManager. That means AUDIO_SOURCE_DEFAULT should behave
as same as AUDIO_SOURCE_MIC.
In this commit, argument for addInputEffects() is translated for
avoid different behavior between AUDIO_SOURCE_DEFAULT and
AUDIO_SOURCE_MIC.
This means same preprocessing effects are applied for both Sources.
Bug: 137898521
Test: Add pre-processing effect for AUDIO_SOURCE_MIC then check if
it works for AUDIO_SOURCE_DEFAULT as well
Change-Id: I3df1bcc7309dc535a721113cc4465b20733b4058
Merged-In: I3df1bcc7309dc535a721113cc4465b20733b4058
AUDIO_SOURCE_DEFAULT is translated to AUDIO_SOURCE_MIC in
AudioPolicyManager. That means AUDIO_SOURCE_DEFAULT should behave
as same as AUDIO_SOURCE_MIC.
In this commit, argument for addInputEffects() is translated for
avoid different behavior between AUDIO_SOURCE_DEFAULT and
AUDIO_SOURCE_MIC.
This means same preprocessing effects are applied for both Sources.
Bug: 137898521
Test: Add pre-processing effect for AUDIO_SOURCE_MIC then check if
it works for AUDIO_SOURCE_DEFAULT as well
Change-Id: I3df1bcc7309dc535a721113cc4465b20733b4058
If ENFORCED_AUDIBLE is set for a stream, it should output
to Speaker and not select output device(s) for VOICE_CALL.
Bug: 147209610
Change-Id: I9553efd677979351ed6f7191079da84dac2a7ed1
For the formats compatible with IEC61937 encapsulation, assume
that the record thread input from MSD is IEC61937 framed (for
proportional buffer sizing). Add the
AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO flag so downstream HAL can
distinguish between raw and IEC61937 framed streams.
Test: manual test on BCM TV device
Change-Id: I8f09f936ccce63985df4ad00433299b063769419
When closing input/output, it is not needed to unregister effects.
The effects will be automatically unregistered when the audio session id
is released. If the effects are unregistered when closing input/output
and the audio session id is not released, audio policy manager will lose
the visibility of the effects. In that case, it will fail to move the
effects to new I/O when a track with the same audio session id is
attached to a new I/O.
Bug: 145197421
Test: repo steps from the bug
Change-Id: I1bee3a3ee79692c863aa3977df62346ac9dc8946
New stream type: AUDIO_STREAM_ASSISTANT
This is intended to be used by a virtual assistant like
Google Assistant, Bixby, etc.
The audio stream has own volume alias and the volume
does not change by volume changes of other streams.
Bug: 123745215
Test: make
Change-Id: I17ec0480cad4c3507a97454ccb832255adda9897
Signed-off-by: Baekgyeong Kim <baek.kim@samsung.com>
This change:
- Removes the old ISoundTriggerHw service and removes its code.
- Connects AudioPolicyManager to the new service via AIDL RPC (using
a new utility, BinderProxy).
Change-Id: I00366e2c5f252708e903b2311816d9eceb132a05
Bug: 142070343
Add audio usage for call assistant use cases.
Used by apps playing over call uplink path for call
screening or other in call assitant features.
Add corresponding routing strategy in audio policy manager.
The strategy reuses volume group "PATCH" as volume is fixed
for call uplink audio.
Bug: 135213843
Test: make
Change-Id: Iad34c058e96fa5c969e825d3ddb0a82a60accc76
This flag used to be framework only. To simplify constants
management it's better to have it defined at all layers.
Currently it is only used for MSD module but potentially
can be used for HDMI inputs.
Bug: 141273649
Test: use AOSP MSD on Pixel
atest VtsHalAudioV6_0TargetTest
Change-Id: I19f6fdb2772878c93e41b635dc6adae83a9fecb0
Audio policy engine supports receiving a preferred device to use
for a given strategy (Engine superclass). Use of the preferred
device intervenes at the level of the each engine implementation,
here in the default engine in getDevicesForProductStrategy() method
so it is saved in the routing cache, and respects existing routing
priorities.
Refactor the loops for call and output rerouting into a new
updateCallAndOutputRouting() method.
Bug: 144440677
Test: atest AudioServiceHostTest#testPreferredDeviceRouting
Change-Id: Ic4c690e1b0d8020c4335979e40e14e6df5887879
Merged-In: Ic4c690e1b0d8020c4335979e40e14e6df5887879
Audio policy engine supports receiving a preferred device to use
for a given strategy (Engine superclass). Use of the preferred
device intervenes at the level of the each engine implementation,
here in the default engine in getDevicesForProductStrategy() method
so it is saved in the routing cache, and respects existing routing
priorities.
Refactor the loops for call and output rerouting into a new
updateCallAndOutputRouting() method.
Bug: 144440677
Test: atest AudioServiceHostTest#testPreferredDeviceRouting
Change-Id: Ic4c690e1b0d8020c4335979e40e14e6df5887879
Add the possibility to specify a target audio device when
creating an audio effect by passing its type and address to
AudioEffect constructor.
When doing so, the session ID must be AUDIO_SESSION_DEVICE.
Bug: 136294538
Test: make
Change-Id: I2a2eba340d3c2537285c091e9a53f305ff161a2b
The added files were using DOS EOL symbols (CRLF) instead
of UNIX (LF only). Removed CR symbols.
Bug: 135749685
Test: m
Change-Id: Iba36aaef0ea8d9bcb3bd8e2d476a7b0588bd70ee
When connecting multiple audio devices,
Media and Sonification sounds comes out of the last connected device,
not a high-priority device.
Test: play music
Test: connect wired earphone // sound : wired earphone
Test: connect usb earphone // sound : usb earphone, not the wired earphone(high-priority)
Test: connect bluetooth headset // sound : bluetooth headset
Test: disconnect bluetooth headset // sound : usb earphone, not the wired earphone(high-priority)
Bug: 135749685
Change-Id: I579a04a04c97cc846b88e54fa83cdf3dad0b5cee
Signed-off-by: Baekgyeong Kim <baek.kim@samsung.com>
Type and address are used to distinguish a device, it makes more
sense to set device type and address when creating a DeviceDescriptor.
Bug: 135621476
Test: make, atest audiopolicy_tests
Change-Id: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
Merged-In: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
Add the possibility for apps to indicate that their
capture use case is private and that a privileged Assistant
should not be able to capture concurrently.
This allows to override the default behavior tied to the audio
source (e.g VOICE_COMMUNICATION is private by default but
UNPROCESSED is not).
- Add AAudio API to set and get privacy sensitive mode on input stream
- Add MediaRecorder API to set and get privacy sensitive mode
- Modify AudioSource constructor to accept audio attributes instead of an
audio source to specify the use case.
- Modify audio policy concurrent capture logic to use audio attributes
flag instead of audio source to decide of a capture client has
requested privacy mode or not.
Bug: 137850106
Test: CTS AudioRecordTest and MediaRecorderTest, manual audio smoke tests
Change-Id: I250ea5da4c1da809ceac0da22ae9bee15b937001
Refactor interface between audio flinger and audio policy. Use device
descriptor instead of audio device type and address. DeviceDescriptor
can contain more information that may be useful when opening an output
stream.
In audio policy, if multiple audio devices are passed in when opening
an output stream, one device is extracted using the same strategy as
when selecting a device for volume application. When starting source,
audio policy manager will call audio flinger to create audio patch. In
that case, multiple devices will still be patched to the output stream.
Test: atest AudioTrackTest AudioPlaybackCaptureTest
Test: atest audiopolicy_tests, audio smoke test
Change-Id: I46dc2da621614f8716c6c73cf807fe7d2d672cda
Merged-In: I46dc2da621614f8716c6c73cf807fe7d2d672cda
AudioDeviceTypeAddr is moved to libaudiofoundation. In that case, it can
be used in DeviceDescriptorBase.
Bug: 135621476
Test: make, atest audiofoundation_parcelable_test
Test: play music, record audio
Change-Id: Ia66dce29c8fb9d25c40598d9bada6eb295313884
Merged-In: Ia66dce29c8fb9d25c40598d9bada6eb295313884
Move AudioDeviceTypeAddr from AudioPolicy.h to libaudiofoundation.
AudioDeviceTypeAddr is a class that contains audio device type and
address. It can be used not only in audio policy, but also other places.
Bug: 135621476
Test: make, atest AudioHostTest
Change-Id: Ib257859891c647c07f22771012efdada438a4ff5
Merged-In: Ib257859891c647c07f22771012efdada438a4ff5
* changes:
Add parcelable test for classes in libaudiofoundation.
Add export header lib headers to libaudiofoundation_headers.
Add equals functions for classes in libaudiofoundation.
Make audio stuff parcelable.
Clear up bit mask usage in audio policy.
Make AudioGain parcelable.
This change includes:
1. Use DeviceTypeSet to represent a combination of audio device types.
2. Add helper functions for DeviceTypeSet
3. Stop using audio device type as a bit mask in DeviceVector
Test: atest AudioTrackTest AudioRecordTest AudioPlaybackCaptureTest
Test: atest AudioHostTest AudioServiceHostTest audiopolicy_tests
Test: audio smoke test
Change-Id: If80513b689848bcab6094f70a572f053856afa82
Merged-In: If80513b689848bcab6094f70a572f053856afa82
First test for audio health check. The test checks if all declared
devices found by checking if the audio device types of attached devices
can be seen by audio policy.
Bug: 141580284
Test: atest audio_health_tests audiopolicy_tests
Change-Id: I0374f382eaab7b36ab623b11a59e0634565f2187
Merged-In: I0374f382eaab7b36ab623b11a59e0634565f2187
Bug: 135621476
Test: atest AudioHostTest, AudioPlaybackCaptureTest
Test: atest AudioServiceHostTest, audiopolicy_tests
Test: listen to music, make phone call with BT device
Test: test play music via Android Auto emulator
Change-Id: I154555579b0ebb8b020d00e9c05c8b9f79a08db4
Merged-In: I154555579b0ebb8b020d00e9c05c8b9f79a08db4
This CL added test audio device type helper functions, which expect a
single audio device type as a parameter.
Bug: 135621476
Test: atest systemaudio_tests
Change-Id: I5dac8eab93ab2251eea62b3b8d797f504bf538e4
Merged-In: I5dac8eab93ab2251eea62b3b8d797f504bf538e4
* changes:
Create DeviceDescriptorBase.
Copy DeviceDescriptor to libaudiofoundation.
Rename AudioPort and PolicyAudioPort accordingly.
Make audio port in policy not derive from audio port base
Rename AudioProfileVector.h as AudioProfileVectorHelper.h
Leave AudioProfileVector only in libaudiofoundation.
DeviceDescriptorBase is a class that derives from AudioPort and
AudioPortConfig and contains extensions to describe a audio port that is
a hardware device. DeviceDescriptor derives from DeviceDescriptorBase
and contains policy related stuff.
Test: atest AudioTrackTest AudioRecordTest AudioManagerTest
Test: atest AudioPlaybackCaptureTest AudioHostTest audiopolicy_tests
Test: audio smoke test
Bug: 135621476
Change-Id: I70ebe6bca70a77bbfc8f6855de3fd4c4ffa1c487
Merged-In: I70ebe6bca70a77bbfc8f6855de3fd4c4ffa1c487
Make the file name consistent as the class name.
Test: make
Bug: 135621476
Change-Id: Icbde26fe1798e344c3746f4678db098688456654
Merged-In: Icbde26fe1798e344c3746f4678db098688456654
This patch aims to make the structure for libaudiofoundation and policy
stuff simpler, including:
1. Make AudioPortBase as AudioPort in libaudiofoundation. Create
PolicyAudioPort that contains policy related stuff, which is used by
audiopolicy.
2. Make AudioPortConfigBase as AudioPortConfig in libaudiofoundation.
Create PolicyAudioPortConfig that contains policy related stuff.
3. DeviceDescriptor derives from AudioPort, AudioPortConfig, PolicyAudioPort
and PolicyAudioPortConfig. IOProfile derives from AudioPort,
PolicyAudioPort. AudioInputDescriptor/AudioOutputDescriptor derives from
AudioPortConfig, PolicyAudioPortConfig.
Test: atest AudioTrackTest, AudioRecordTest, AudioManagerTest
Test: atest audiopolicy_tests, AudioHostTest
Test: audio smoke test
Bug: 135621476
Change-Id: I40299d95dda3b3fc0ea88b079f2fe38d8f7e5b31
Merged-In: I40299d95dda3b3fc0ea88b079f2fe38d8f7e5b31
The file only contains helper functions for AudioProfileVector.
Test: make
Bug: 135621476
Change-Id: Ifd8eb281cbb7d6395fd5d4b4d6f308d58e6ded3d
Merged-In: Ifd8eb281cbb7d6395fd5d4b4d6f308d58e6ded3d
Make AudioProfileVector only in libaudiofoundation. In policy part,
instead of having policy specific AudioProfileVector deriving from
AudioProfileVector in libaudiofoundation, make all the functions as
global functions. In that case, AudioPortBase does not need to be a
template class. That helps make the structure clearer.
Test: audio smoke test
Test: CTS for AudioTrack, AudioRecord, AudioManager
Test: audiopolicy_tests, AudioHostTest
Bug: 135621476
Change-Id: I36b12123cf52c3f82cef09a965403791dff74093
Merged-In: I36b12123cf52c3f82cef09a965403791dff74093
The test uses HDMI and bt hfp to test setting of device connection
state. After the device is connected, the test tries to use explicit
routing to the new connected device to make sure the connection state is
set correctly.
Bug: 135621476
Test: atest audiopolicy_tests
Change-Id: I14759daac6d3522fa133a6e3b27b3863bb4ce3d1
Merged-In: I14759daac6d3522fa133a6e3b27b3863bb4ce3d1
* changes:
Add AudioPortFoundation, AudioPortBase and AudioPortConfigBase.
Copy AudioPort.h to libaudiofoundation.
Make AudioProfile as a common class and create AudioProfileVectorBase.
Preparation for moving AudioProfile to libaudiofoundation.
Return DeviceDescriptor or DeviceVector in Engine.
Add unit test for dyanmic policy. Including:
1. Use bp file instead of mk file
2. Test (un)registering policy mixes
3. Test dynamic policy playback rerouting
4. Test dynamic policy mix record injection
The idea of 3. and 4. is from pa/1201282.
Test: atest audiopolicy_tests
Bug: 135621476
Change-Id: Ic95c6f9193c2448168897c5441554cff735f401d
Merged-In: Ic95c6f9193c2448168897c5441554cff735f401d
The purpose of this change is to make a generic AudioPort class that
could be used by vendor.
1. Add AudioPortFoundation and AudioPortBase. AudioPortFoundation
contains generic members of an audio port. AudioPortBase is a template
class that derives from AudioPortFoundation. It takes audio profile
vector as a template parameters. That makes it more feasible to use
customized audio profile stuff as needed. In audio policy, AudioPort
derives from AudioPortBase and contain policy related stuff.
2. Add AudioPortConfigBase. AudioPortConfigBase contains generic members
of an audio port config. AudioPortConfig derives from AudioPortConfigBase
and contains policy related stuff.
3. Use std::string instead of String8 in AudioPort and AudioPortConfig.
Bug: 135621476
Test: CTS for AudioRecord, AudioTrack, AudioManager, RoutingTest
Test: audiopolicy_tests, AudioServiceHostTest
audio smoke test
Test: dumpsys media.audio_policy
Change-Id: I05611b7067c18006660de2c678acd56bdd34010a
Merged-In: I05611b7067c18006660de2c678acd56bdd34010a
AudioProfile is a class that contains information for an audio profile.
AudioProfileVectorBase is a base class that contains operations for a
vector of audio profiles. AudioProfileVector derives from
AudioProfileVectorBase and contains policy related stuff.
Bug: 135621476
Test: CTS for AudioRecord, AudioTrack, AudioManager
Test: audio smoke test, audiopolicy_tests
Test: dumpsys media.audio_policy
Change-Id: Ic2e08efcc5efa99e499a931811b7042fbd5ddf04
Merged-In: Ic2e08efcc5efa99e499a931811b7042fbd5ddf04
Copy AudioProfile from audio policy to libaudiofoundation. Note that
AudioProfile in libaudiofoundation has not been added into the make
file as it needs some more change to make it work. Doing this just to
make a cleaner diff for later change.
Rename AudioProfile in managerdefinitions folder as AudioProfileVector
since AudioProfile will be moved to libaudiofoundation.
Bug: 135621476
Test: make
Change-Id: I13ac067317648bbfd8d3960d16a1ea56ded83011
Merged-In: I13ac067317648bbfd8d3960d16a1ea56ded83011
To remove the limit on the number of audio device types, there is a
need to remove the return value as a combination of audio_devices_t.
Using DeviceDescriptor or DeviceVector in Engine is a starting point.
Test: audiopolicy_tests, smoke test
Test: CTS for AudioTrack, AudioRecord, AudioManager
Bug: 135621476
Change-Id: I0d87fd76385629e6e6b74cdd37dbd334ae02c04f
Merged-In: I0d87fd76385629e6e6b74cdd37dbd334ae02c04f
1. Add SampleRateSet, FormatSet, ChannelMaskSet, FormatVector
using std::vector and std::set in libaudiofoundation.
2. Use SampleRateSet, FormatSet, ChannelMaskSet, FormatVector in
audio framework.
Bug: 135621476
Test: make, CTS for AudioRecord, AudioTrack, AudioManagerTest
Test: play and record audio
Change-Id: Ic04e637bcc6ba9df84c5e7561ec3c03f18a7d242
Merged-In: Ic04e637bcc6ba9df84c5e7561ec3c03f18a7d242
1. Create folder for libaudiofoudation.
2. Move AudioGain to libaudiofoudation. The goal is to make AudioGain
be able to use in binder call and be vendor-available later.
Bug: 135621476
Test: make, CTS for AudioTrack, AudioRecord, AudioManagerTest
Change-Id: Ibf16ad9cb7f2ac657a02632ccbe4f934b5a12731
Merged-In: Ibf16ad9cb7f2ac657a02632ccbe4f934b5a12731
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
Type and address are used to distinguish a device, it makes more
sense to set device type and address when creating a DeviceDescriptor.
Bug: 135621476
Test: make, atest audiopolicy_tests
Change-Id: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
Enable playback over Call Tx path also when audio mode is CALL_SCREEN.
Was previously only possilbe when IN_CALL or IN_COMMUNICATION.
Also generalize use of isStateInCall() method instead of
a mix of isStateInCall() and is_state_in_call().
Bug: 140384450
Test: manual call screen test
Change-Id: Ifda4ee2f26a30ed8dbe43b172d86b18d906029cf
AudioDeviceTypeAddr is moved to libaudiofoundation. In that case, it can
be used in DeviceDescriptorBase.
Bug: 135621476
Test: make, atest audiofoundation_parcelable_test
Test: play music, record audio
Change-Id: Ia66dce29c8fb9d25c40598d9bada6eb295313884
Move AudioDeviceTypeAddr from AudioPolicy.h to libaudiofoundation.
AudioDeviceTypeAddr is a class that contains audio device type and
address. It can be used not only in audio policy, but also other places.
Bug: 135621476
Test: make, atest AudioHostTest
Change-Id: Ib257859891c647c07f22771012efdada438a4ff5
Add new audio mode AUDIO_MODE_CALL_SCREEN allowing call screening
to take place while other audio use cases are still active.
Also add API and audio policy configuration attribute to
indicate if the platform supports this audio mode.
Bug: 140384450
Test: make
Change-Id: If2fc56dbbd10aae2cf1498480471b35de0940228
Refactor interface between audio flinger and audio policy. Use device
descriptor instead of audio device type and address. DeviceDescriptor
can contain more information that may be useful when opening an output
stream.
In audio policy, if multiple audio devices are passed in when opening
an output stream, one device is extracted using the same strategy as
when selecting a device for volume application. When starting source,
audio policy manager will call audio flinger to create audio patch. In
that case, multiple devices will still be patched to the output stream.
Test: atest AudioTrackTest AudioPlaybackCaptureTest
Test: atest audiopolicy_tests, audio smoke test
Change-Id: I46dc2da621614f8716c6c73cf807fe7d2d672cda
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
C++20 will require members in a designated initializer to be in order
unlike C99.
Bug: 139945549
Test: mm
Change-Id: I610f4e8a8a9d69eb650c354df4bd1438a1408897
Merged-In: Ie129344a36893adc82e67181012e3af817bda9f4
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
C++20 will require members in a designated initializer to be in order
unlike C99.
Bug: 139945549
Test: mm
Change-Id: Ie129344a36893adc82e67181012e3af817bda9f4
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Restore pre Q behavior for HOTWORD capture for non
Assistant applications. This allows non Assistant privileged
applications to capture audio with source HOTWORD and no visible
foreground UI as long as no other app is capturing. This capture
will be silenced as soon as another app starts capturing and will not
prevent other apps from capturing.
Bug: 140799148
Test: manual OK Google and Now Playing tests
Test: CTS AudioRecordTest, GTS HotwordTest
Change-Id: I9473851e2949e42abc02fb5974be21d351810854
This change includes:
1. Use DeviceTypeSet to represent a combination of audio device types.
2. Add helper functions for DeviceTypeSet
3. Stop using audio device type as a bit mask in DeviceVector
Test: atest AudioTrackTest AudioRecordTest AudioPlaybackCaptureTest
Test: atest AudioHostTest AudioServiceHostTest audiopolicy_tests
Test: audio smoke test
Change-Id: If80513b689848bcab6094f70a572f053856afa82
This reverts commit 4b8d5ce58d.
Bug: 132241823
Reason for revert: Breaks Screen Mirroring during Live caption
Change-Id: I4bf711e5c5e4233fcf58bda5477380b488fde2fa
As python 2 is beeing deprecated, this CL updates all the tool
scripts to python3.
It also fix some issues revealed by pylint.
Test: lunch audio_configurable target & build
Change-Id: I69a201190c688be3825cbdaa238046367a5d09c7
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
If no default device is available from configuration.xml, and if
the engine fallbacks on it anyway, it tries to get its type without checking
the pointer validity.
This CL fix the potential segfault and assert with explicit error message.
Test: build
Change-Id: Icf8d7f5ef998dad6f4033d934b48d408030c7e17
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
To avoid bypassing PATH restrictions, this CL fixes the python
binary dependancy by retrieving the path from the host binaries.
Test: build
Change-Id: Ib3356ee1a69d1a5e5a9f9d22b46e3e70c28fa991
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Do not consider Accessibility services when determining
lastest active capture client. As an Accessibility service
capturing does not silence other captures, it should not
prevent another client from being selected as the latest active.
Bug: 135806801
Test: Start capture with Recorder app, activate Voice Access
Change-Id: I864be785752f27201d45ce24f95013de6391dbd6
Merged-In: I864be785752f27201d45ce24f95013de6391dbd6
Call initialize() after constructing AudioPolicyManager
from factory to avoid calling virtual methods from constructor.
Bug: 136491567
Test: make
Change-Id: Ie0b591d90e643b1fd1c326f9731dc656b38230dc
Merged-In: Ie0b591d90e643b1fd1c326f9731dc656b38230dc
Do not consider Assistant capturing with HOTWORD source
when determining lastest active capture client. As assistant
capturing for HOTWORD does not silence other captures, it should not
prevent another client from being selected as the latest active.
Bug: 135806801
Test: Start capture with Recorder app, place in background and trigger
false OK G detection
Change-Id: Ic17bfd70675ef749d6a678d067112b1dbd205746
Merged-In: Ic17bfd70675ef749d6a678d067112b1dbd205746
During the transition to Treble, "device connect" / "disconnect"
parameter was erroneously attributed to audio streams. This
issue got fixed in Audio HAL V4.0, but AudioParameter file
was still using incorrect name for the constant.
Test: make
Change-Id: I4056ad9e98af6dadd017d22bc4bde031cac75631
Merged-In: I4056ad9e98af6dadd017d22bc4bde031cac75631
Add AUDIO_OUTPUT_FLAG_MMAP_NOIRQ flag in the relavant flags to check
for if the relavant profiles are present or not
Bug: 136493985
Test: make
authored-by: Samyak Jain <samyjain@codeaurora.org>
Change-Id: I8b8b9fdfca2bb6e5f824f3b79ac42b7de5545706
Merged-In: I8b8b9fdfca2bb6e5f824f3b79ac42b7de5545706
The error must not be ignored as otherwise the Java layer
thinks that recording has started successfully.
Bug: 136279123
Test: reproduce AudioRecordingConfigurationTest failure on cuttlefish,
check test failure output, the failure must be
"junit.framework.AssertionFailedError: expected:<3> but was:<1>"
Change-Id: I82bc3a43bf679cfb03d4246d07615d3fd4dac409
Merged-In: I82bc3a43bf679cfb03d4246d07615d3fd4dac409
First test for audio health check. The test checks if all declared
devices found by checking if the audio device types of attached devices
can be seen by audio policy.
Bug: 141580284
Test: atest audio_health_tests audiopolicy_tests
Change-Id: I0374f382eaab7b36ab623b11a59e0634565f2187
The deprecated method AudioManager.isBluetoothA2dpOn() calls
getDeviceConnectionState on APM with an empty address, which
caused HwModuleCollection::getDeviceDescriptor to set an empty
address on the DeviceDescriptor for the currently connected
A2DP device. This method is called by MediaRouter.
When the address was reset, the java listener for audio device
connection monitoring was reporting the connection of an A2DP
device with an empty address, which in turn caused AvrcpManager
to behave as if the audio device connection failed.
If MediaRouter called isBluetoothA2dpOn() before AvrcpManager
received its called for device connection, the error would occur.
Bug: 132416679
Test: call isBluetoothA2dpOn() and check for valid address in dumpsys media.audio_policy
Test: atest AudioServiceHostTest#testInjectForRecord ; atest AudioHostTest ; atest AudioPlaybackCaptureTest
Change-Id: I1370edbbca46657506a990855d06a176f07c54d3
Merged-In: I1370edbbca46657506a990855d06a176f07c54d3
Android provides 2 audio policy engines:
libaudiopolicyenginedefault and
libaudiopolicyengineconfigurable. This change makes the engine
to be loaded dynamically based on the configuration (currently
the engine name is hardcoded into AudioPolicyConfig). Dynamic
loading allows building and installing of both libraries without
any conflicts.
Technical changes:
- AudioPolicyManagerInterface renamed to EngineInterface
for clarity;
- For the purpose of dynamic loading, APM does not depend
anymore on the EngineInstance class. The class got removed
from the default AP engine, but left in the configurable engine
because it is also used by its plugins;
- Added EngineLibrary class to encapsulate dynamic loading
of the AP engine. The class name EngineInstance is repurposed
for a smart pointer to EngineInterface;
- services/audiopolicy/managerdefault/Android.mk converted
into Android.bp;
- Added engine loading failure test;
Bug: 132639720
Test: sanity tests for audio; audiopolicy_tests
Change-Id: I0581569a172f810e030aec879225e817bfa7851a
Merged-In: I0581569a172f810e030aec879225e817bfa7851a
Remove the "template" configuration file and the header file.
Bug: 132435217
Test: make
Change-Id: I0b8ae921ac046e11b020d5766a60f9b341e1d6ee
Merged-In: I0b8ae921ac046e11b020d5766a60f9b341e1d6ee
The usages were only checking that the property is set
to catch attempts to update to Q while still using legacy
configurations.
Bug: 132435217
Test: build various devices
Change-Id: Ib8bda8ab7f791ac5cd3875816de46a42f0a4cbb6
Merged-In: Ib8bda8ab7f791ac5cd3875816de46a42f0a4cbb6
Bug: 135621476
Test: atest AudioHostTest, AudioPlaybackCaptureTest
Test: atest AudioServiceHostTest, audiopolicy_tests
Test: listen to music, make phone call with BT device
Test: test play music via Android Auto emulator
Change-Id: I154555579b0ebb8b020d00e9c05c8b9f79a08db4
* changes:
Create DeviceDescriptorBase.
Copy DeviceDescriptor to libaudiofoundation.
Rename AudioPort and PolicyAudioPort accordingly.
Make audio port in policy not derive from audio port base
Rename AudioProfileVector.h as AudioProfileVectorHelper.h
Leave AudioProfileVector only in libaudiofoundation.
This CL added test audio device type helper functions, which expect a
single audio device type as a parameter.
Bug: 135621476
Test: atest systemaudio_tests
Change-Id: I5dac8eab93ab2251eea62b3b8d797f504bf538e4
DeviceDescriptorBase is a class that derives from AudioPort and
AudioPortConfig and contains extensions to describe a audio port that is
a hardware device. DeviceDescriptor derives from DeviceDescriptorBase
and contains policy related stuff.
Test: atest AudioTrackTest AudioRecordTest AudioManagerTest
Test: atest AudioPlaybackCaptureTest AudioHostTest audiopolicy_tests
Test: audio smoke test
Bug: 135621476
Change-Id: I70ebe6bca70a77bbfc8f6855de3fd4c4ffa1c487
This patch aims to make the structure for libaudiofoundation and policy
stuff simpler, including:
1. Make AudioPortBase as AudioPort in libaudiofoundation. Create
PolicyAudioPort that contains policy related stuff, which is used by
audiopolicy.
2. Make AudioPortConfigBase as AudioPortConfig in libaudiofoundation.
Create PolicyAudioPortConfig that contains policy related stuff.
3. DeviceDescriptor derives from AudioPort, AudioPortConfig, PolicyAudioPort
and PolicyAudioPortConfig. IOProfile derives from AudioPort,
PolicyAudioPort. AudioInputDescriptor/AudioOutputDescriptor derives from
AudioPortConfig, PolicyAudioPortConfig.
Test: atest AudioTrackTest, AudioRecordTest, AudioManagerTest
Test: atest audiopolicy_tests, AudioHostTest
Test: audio smoke test
Bug: 135621476
Change-Id: I40299d95dda3b3fc0ea88b079f2fe38d8f7e5b31