Commit Graph

42603 Commits

Author SHA1 Message Date
Alice Kuo
851ef342ed Add soft_audio_configuration_changed_cb_ to handle the streamMap changed
Based on the stream status and Bluetooth Audio Session to switch the
different configuration_changed_cb_ notifcation.

audio_configuration_changed_cb_ for the context type handover case
soft_audio_configuration_changed_cb_ for the streamMap changed during
media stream case

Bug: 231084798
Test: LE audio offload later join and disappear with downmix enable
Change-Id: I199c2b765b128875fb2c66abb1a500e4a6c820b7
2022-09-13 00:06:42 +08:00
Qoo Lin
5195a49c3c Fix SetBadMetadata fail am: 2ff704a6d4 am: ec1e1f61ed
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2201200

Change-Id: I916e8f20f2871db15616eb90905c9f768f07d95e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 00:30:56 +00:00
Qoo Lin
ec1e1f61ed Fix SetBadMetadata fail am: 2ff704a6d4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2201200

Change-Id: Ia133acde9b27c275d6aeb02618af86ade3233956
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 00:15:46 +00:00
Lorena Torres-Huerta
e38b08ad47 Merge changes from topic "media_common_types_version_bump"
* changes:
  Use explicit aidl versions for audio hal and soundtrigger dependencies.
  Add AudioAttributes and AudioFlag for use in HAL interface for engine configuration.
2022-09-07 23:30:55 +00:00
Tri Vo
9c21c70ffa Merge "Add defaults for current Identity AIDL API version" 2022-09-07 22:22:58 +00:00
Max Bires
26a548500f Merge "Update IRemotelyProvisionedComponent HAL to v3" 2022-09-07 21:54:02 +00:00
Tri Vo
25df1037d1 Add defaults for current Identity AIDL API version
This makes it easier to bump the version of this interface.

Test: m
Change-Id: If0d4e405ae2f11da2e540800766ef9ed9b399663
2022-09-06 17:46:04 -07:00
Cole Faust
7b6acb3f2d Fix module-file name collisions
Bazel doesn't allow a module and file with the same name.

Bug: 198619163
Test: Presubmits
Change-Id: I828de4265a247c93e778764d0ece54d4d1760daa
2022-09-05 17:56:28 -07:00
Treehugger Robot
22b8aceacb Merge "Make BootControlHAL available in recovery" 2022-09-02 19:25:29 +00:00
Max Bires
137ffac4c5 Update IRemotelyProvisionedComponent HAL to v3
This change makes all of the changes to the HAL AIDL files, along with
corresponding documentation edits, to facilitate the definition for
version 3 of IRemotelyProvisionedComponent HAL.

The bulk of the changes are described within the RKP_CHANGELOG.md file
and will therefore not be discussed here within the commit message.

Bug: 240312857
Test: It is human readable and also builds.
Change-Id: I920550bdfe5a8f9ba677c4a4f67e975bcd3672ab
2022-09-02 10:20:28 -07:00
Treehugger Robot
9cf5a87265 Merge "fix segmentation fault of GraphicsComposerAidlCommandTest" 2022-09-02 17:12:02 +00:00
David Drysdale
2530f9ca5e Merge changes Iaa941e12,Icbd4c9cd
* changes:
  KeyMint HAL: reinstate tags in extension schema
  KeyMint HAL: clarify obsolete tags
2022-09-02 16:09:43 +00:00
David Drysdale
7ea97a310a KeyMint HAL: reinstate tags in extension schema
Commit 93c72cef92 ("KeyMint: sync all attestation tags",
http://aosp/1719302) removed various tags from the attestation that are
only applicable to symmetric keys, on the assumption that these are
irrelevant for the attestation extension that is generated for the
certificate holding asymmetric public keys.

However, that change did not take into account the fact that the
AuthorizationList ASN.1 schema is re-used elsewhere in the KeyMint API,
specifically as a way of describing the characteristics associated with
a key that is being securely imported via
IKeyMintDevice::importWrappedKey.

That import process may be used for symmetrics keys, and so the tags
that are specific to symmetric keys still need to be included in
AuthorizationList.

Similarly, USER_SECURE_ID values are never included in attestation
extensions because they have no meaning off-device, but they may be
needed as part of the import of a wrapped key.

Test: TreeHugger, comment change only
Bug: 244693617
Change-Id: Iaa941e120e3641a6e6c369b7c6a51f10b44df78a
2022-09-02 17:08:04 +01:00
David Drysdale
4683a5383f KeyMint HAL: clarify obsolete tags
The tag enum names can't be removed due to AIDL back-compatibility
requirements, and also it's useful to have the values present to avoid
inadvertent reuse.

Update the tag comment text to indicate that these tags are obsolete.

Bug: 191738660
Test: TreeHugger, comment change only
Change-Id: Icbd4c9cd0313f93bc491b49eb9077766d0f44e34
2022-09-02 17:07:41 +01:00
Lorena Torres-Huerta
308e257397 Use explicit aidl versions for audio hal and soundtrigger dependencies.
There are still issues with importing implicit versions. Switching to explicit versions while b/188871598 is worked out.

Bug: 242678729
Test: m; AIDL_TRANSITIVE_FREEZE=true m aidl-freeze-api && AIDL_FROZEN_REL=true m
Merged-In: Ide6a90716bf042fbb925357e110bc84ddb9e96fb
Change-Id: Ide6a90716bf042fbb925357e110bc84ddb9e96fb
(cherry picked from commit 8296aa824b)
2022-09-01 21:57:03 +00:00
Lorena Torres-Huerta
9ae4f224ab Add AudioAttributes and AudioFlag for use in HAL interface for engine configuration.
This requires a version bump to android.media.audio.common.types.

cc_defaults and java_defaults are used in order to avoid explicitly updating version references in several Android.bp files when we do future version bumps.

Bug: 242678729
Test: m
Merged-In: Id17820f210f625e370992db4f9f85e37887b088b
Change-Id: Id17820f210f625e370992db4f9f85e37887b088b
(cherry picked from commit bf94fa32cb)
2022-09-01 21:37:43 +00:00
Kelvin Zhang
1cc8267aac Make BootControlHAL available in recovery
Test: th
Bug: 227536004
Change-Id: Idd0009f68598c85ef9fe234049851b9b8bd0d893
2022-08-31 16:23:38 +00:00
Qoo Lin
2ff704a6d4 Fix SetBadMetadata fail
Align Android-T

Bug: 244284552
Test: run vts -m VtsHalGraphicsMapperV4_0TargetTest
Signed-off-by: Qoo Lin <qoo.lin@mediatek.com>
Change-Id: I722981dda3b3aba97f36407e50bd338d4812a723
2022-08-31 00:53:39 +00:00
Shunkai Yao
43f9a07e04 AIDL effect: Extract common parts of effect service into cc_defaults
Bug: b/238913361
Test: atest VtsHalAudioEffectTargetTest
Merged-In: I58d925b3f4a3d41d4014f54f78d95c26cc5520ea
Change-Id: I58d925b3f4a3d41d4014f54f78d95c26cc5520ea
(cherry picked from commit c8ed5c27a1)
2022-08-30 22:34:04 +00:00
Shunkai Yao
67b1be60ab AIDL effect: Add vts for the initial effect AIDL interface implementation
Tests basic binder calls of IFactory.

Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
Merged-In: If5db3cae0447f41a149a60505d208070fbfedb7f
Change-Id: If5db3cae0447f41a149a60505d208070fbfedb7f
(cherry picked from commit 1f19c23ab6)
2022-08-30 22:13:17 +00:00
Shunkai Yao
c23916b96f AIDL effect: Minimal example implementation
Add effect factory placeholder implementation.
Update android.hardware.audio.service-aidl.example to include effects.

Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest

Merged-In: I88266b509a03ee336e22be460580c5b22123659e
Change-Id: I88266b509a03ee336e22be460580c5b22123659e
(cherry picked from commit 8a0ae5430f)
2022-08-30 22:11:16 +00:00
Shunkai Yao
f1d6039f96 AIDL effect: Initial IFactory interface definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest

Merged-In: I9f5ef1284bb5d77a9d60cb8b901742fc8e467926
Change-Id: I9f5ef1284bb5d77a9d60cb8b901742fc8e467926
(cherry picked from commit d56bc22d1e)
2022-08-30 22:09:18 +00:00
Mikhail Naganov
a2c714129e audio: Add StreamDescriptor.frameSizeBytes
This field indicates the frame size and is filled by
the HAL module, so that the client does not have
to calculate it.

As a side effect, in the VTS code, a StreamContext can
now be created solely from a StreamDescriptor.

Added unit tests for the functions from Utils.

Bug: 205884982
Test: atest libaudioaidlcommon_test
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ief836b8b2d35bacb1f9778e2462d540554149d7f
Change-Id: Ief836b8b2d35bacb1f9778e2462d540554149d7f
(cherry picked from commit 5862c1e3bc)
2022-08-30 03:54:07 +00:00
Mikhail Naganov
4f5d3f12f5 audio: Implementation of audio I/O, part II
This patch implements audio I/O for the synchronous, non-MMAP
case.

Updated the StreamDescriptor structure to make it usable.
Clarified comments on the expectations for the client and
the HAL module.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I09651c6e80a397c80870622ac19234b4d4a38cbb
Change-Id: I09651c6e80a397c80870622ac19234b4d4a38cbb
(cherry picked from commit 01803d454a)
2022-08-30 01:39:24 +00:00
Mikhail Naganov
0b9c5feed1 audio: Fix the lifetime of the StreamWorker's logic part
Fix the mistake of making StreamWorker to inherit
from the part which provides actual thread logic (Impl).
The lifetime of the logic object must be longer
than the lifetime of the StreamWorker's thread.
Otherwise, the thread could still have running while
the logic has already been destroyed (consider
the order of destructors in C++ class inheritance).

With this fix, the StreamWorker class does not have
to be a template anymore, thus reorganize the code
to move big methods into a .cpp file.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
Change-Id: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
(cherry picked from commmit 84024eccee)

Change-Id: I70958f437657b574cda6480c3216a0b1ea252433
2022-08-30 01:36:31 +00:00
Mikhail Naganov
48d3115614 audio: Allow stopping a StreamWorker from the looping thread
Enhance the return type of the 'workerCycle' to allow it
exiting without inducing an error on the controller side.

Also, put StreamWorker into a namespace.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I3b27028b10f80f27985040cae8f8b0e6ab63ddad
Change-Id: I3b27028b10f80f27985040cae8f8b0e6ab63ddad
(cherry picked from commit 5021df71c7)
2022-08-30 01:30:19 +00:00
Mikhail Naganov
409ce2a665 audio: Use 'sdk_version' instead of 'platform_apis'
Replace 'platform_apis: true' with 'sdk_version: module_current'.
The former causes compiling against SDK source code,
this is not needed for the audio HAL.

Bug: 205884982
Test: m android.hardware.audio.service-aidl.example
Change-Id: I9b9c32707ac7276f5cd077681bd1f8122bc20feb
Merged-In: I9b9c32707ac7276f5cd077681bd1f8122bc20feb
(cherry picked from commit 714e959c89)
2022-08-29 22:42:26 +00:00
Sahil Somani
b6eba859a1 Merge "Rename Light HAL default implementation variable." 2022-08-27 01:42:39 +00:00
Yixiao Luo
511538808f Merge "Add OWNERS file to TV Input HAL" 2022-08-26 23:19:24 +00:00
Sahil Somani
1b4eb23b72 Rename Light HAL default implementation variable.
The Light HAL implements a function getLights that returns a vector
of HwLight objects. This vector is called "lights" in Lights.cpp,
but it is called "types" in Lights.h. Lights.h has been changed to
call the vector "lights".

Test: VtsHalLightTargetTest
Change-Id: I1e567d1454d42e3efc0186cde8340c32e7f3456e
2022-08-26 15:00:15 -07:00
Treehugger Robot
73754429ee Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f am: 2a3972288c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I1ebf39592d323ef2e4b394c360fe0774da1f6347
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:24:25 +00:00
Treehugger Robot
2a3972288c Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I651a99927a137c7401750274b505e30e548e7858
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:05:34 +00:00
Treehugger Robot
2a04b4462f Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev 2022-08-26 16:51:31 +00:00
Mikhail Naganov
6a4872dff0 audio: Implementation of audio I/O, part I
This patch adds necessary structures and prepares for implementing
data flow for audio I/O.

Also in this patch we clarify the relationship between audio patches
and buffer size for audio I/O, and between buffer size and latency.

Bug: 205884982
Bug: 233816848
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I8522632607d4cf50a112225c19b5dd5ad8848591
Change-Id: I8522632607d4cf50a112225c19b5dd5ad8848591
(cherry picked from commit 68bee70442)
2022-08-26 02:44:15 +00:00
Mikhail Naganov
48e2e8fe49 audio: Implement setting name and priority in StreamWorker
Audio threads need to be able to set their priority.
Also, traditionally these worker threads set a custom
thread name. Implement this functionality in StreamWorker.

Since initialization steps can fail, implement simple
error reporting via a string field `mError`. The state
of the string field replaces the dedicated `ERROR` worker
state.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: Ie9ab94922d47f277a4993a90b478a2fa76657923
Change-Id: Ie9ab94922d47f277a4993a90b478a2fa76657923
(cherry picked from commit e9e0f7c0f5)
2022-08-26 02:43:37 +00:00
Mikhail Naganov
0c174e9133 audio: Prevent priority inversions in aidl StreamWorker
Avoid taking a lock in high priority worker threads
without a real need.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I8cc0f5cb58752b7b7d413a9f4e46093c39445892
Change-Id: I8cc0f5cb58752b7b7d413a9f4e46093c39445892
(cherry picked from commit d989a4b669)
2022-08-26 02:42:46 +00:00
Mikhail Naganov
614e4b5f16 audio: Add StreamWorker to aidl/common
This utility class has been copied from HIDL VTS.
It will be used both for the default implementation
and AIDL VTS, and might need modifications.

Bug: 205884982
Test: atest libaudioaidlcommon_test
Merged-In: I43b35b0c23ae45305dca66e15b60820cad19635e
Change-Id: I43b35b0c23ae45305dca66e15b60820cad19635e
(cherry picked from commit c17f0484bc)
2022-08-26 02:41:58 +00:00
JihCheng Chiu
d0dbe4ef03 fix segmentation fault of GraphicsComposerAidlCommandTest
When we run the VTS of GraphicsComposerAidlCommandTest, we always meet
segmentation fault issue in some test items. VTS test items crashed
when it deleted the layer or display from resource manager and try to
go next loop.
The problem is the test item try to delete the layer iterator or
display iterator in the loop, so the iterator become an invalid
iterator. Then it try to use the invalid iterator for going to next
iterator. This behavior caused segmentation fault. We use different
way to fix deleting layer and deleting display.
Delete layer: Test item always delete all layer for each display, so
              we always delete layer via get the first iterator until
              the resource manager is empty.
Delete display: Test item only delete virtual display, so we move the
                physical display to a temporary map. After delete all
                virtual display, we swap the temporary map and
                original map.

Bug: 243781450
Test: 1. test GraphicsComposerAidlCommandTest.SetLayerColorTransform
         for deleting layer
      2. test GraphicsComposerAidlCommandTest.SetOutputBuffer
         for deleting disply

Change-Id: Id467df658e78ed29fdfc039cabc119f8bf62d69d
2022-08-26 02:11:23 +00:00
David Gross
79324920f7 Make VtsHalNeuralnetworks* tests more binder-friendly.
Certain mutation testing -- mutateOperandLifeTimeTest and
mutateOperandInputOutputTest -- can introduce potentially very large
CONSTANT_COPY operands, which can in turn create potentially very
large Models which must be passed across binder.  To avoid overflowing
the binder buffer, we estimate the size of the mutated Model, and skip
the test if that size is too high.  The old logic recognizes that our
tests only have a single active binder transaction at a time, and
assumes that there are no other clients using the same service at the
same time, and so we should have the binder buffer to ourselves; to be
conservative, we reject any Model whose estimated size exceeds half
the binder buffer size.  Unfortunately, sometimes the binder buffer
still overflows, because it unexpectedly contains an allocation from
some other transaction: It appears that binder buffer memory
management is not serialized with respect to transactions from our
tests, and therefore depending on scheduler behavior, there may be a
sizeable allocation still in the buffer when we attempt to pass the
large Model.  To fix this problem we become even more conservative,
and instead of limiting the Model to half the binder buffer size, we
limit it to half IBinder.MAX_IPC_SIZE (the recommended transaction
size limit).  To confirm that this change does not exclude too many
tests, I checked how may times the size filter function
exceedsBinderSizeLimit is called, how many times it rejects a model
under the new logic (modelsExceedHalfMaxIPCSize), and how many times
it rejects a model under the old logic (modelsExceedHalfMaxIPCSize).

Test: VtsHalNeuralnetworksV1_0TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  3592, modelsExceedHalfMaxIPCSize = 212, modelsExceedHalfBufferSize = 18
Test: VtsHalNeuralnetworksV1_1TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  7228, modelsExceedHalfMaxIPCSize = 330, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 52072, modelsExceedHalfMaxIPCSize = 506, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_3TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 73342, modelsExceedHalfMaxIPCSize = 568, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksTargetTest

Bug: 227719657
Bug: 227719752
Bug: 231928847
Bug: 238777741
Bug: 242271308

Change-Id: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971
2022-08-25 23:11:41 +00:00
Treehugger Robot
b4adbffdc4 Merge "Remove usb HIDL entry in compat matrix." 2022-08-25 20:14:47 +00:00
Treehugger Robot
870d2ac41a Merge "Remove nfc HIDL entry in compat matrix." 2022-08-25 19:43:28 +00:00
Treehugger Robot
a60aa56278 Merge "Remove gnss HIDL entry in compat matrix." 2022-08-25 19:17:27 +00:00
Treehugger Robot
856fced74a Merge "audio: Update README.md to add info about the AIDL version" 2022-08-25 17:59:25 +00:00
Mikhail Naganov
5aca7616f7 audio: Update README.md to add info about the AIDL version
This complements CL https://r.android.com/2169871.

Bug: 205884982
Test: N/A
Merged-In: Ia627e3845a078e6a4c545b13a723a6c5a038c53b
(cherry picked from commit bbf297804e)
Change-Id: I78696647e64ae1a5f216c3ab4f4a7194a5145072
2022-08-25 16:34:25 +00:00
Treehugger Robot
463d08394e Merge "Remove color format constraints" 2022-08-25 02:28:02 +00:00
Treehugger Robot
660e9a4c48 Merge changes I118b2c04,I111b72aa,Ia5d29126
* changes:
  audio: Add support for compressed offload
  audio: Improve debug logging in the AIDL version, fix bugs
  audio: Disable the C++ backend for android.hardware.audio.core
2022-08-25 02:24:01 +00:00
Treehugger Robot
2412da0826 Merge "[Bluetooth apex] Use new apex name" 2022-08-25 02:16:03 +00:00
Changyeon Jo
ec0d97c86b Remove color format constraints am: e6bb228dc6 am: 9b60ecd229
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2188343

Change-Id: Ife0695367cc56876e595275d26096cc329535c4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 00:39:27 +00:00
Mikhail Naganov
111e0ceab5 audio: Add support for compressed offload
- Add compressed offload mix port into default implementation.
- Require AudioOffloadInfo to be passed to IModule.openOutputStream
  for compressed offload port configs.
- Update VTS to handle compressed offload.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I118b2c04bff12b64a7cac4dc2c88217a6a270046
Change-Id: I118b2c04bff12b64a7cac4dc2c88217a6a270046
(cherry picked from commit 975ea3ae89)
2022-08-25 00:25:55 +00:00
Mikhail Naganov
16db9b7c97 audio: Improve debug logging in the AIDL version, fix bugs
- Make sure the AIDL default implementation has debug output enabled.
- Log additional info in the AIDL VTS to facilitate debugging.
- Make resource handler classes move-only types.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I111b72aaf12962f00b4d31b8ac87186bca5eb853
Change-Id: I111b72aaf12962f00b4d31b8ac87186bca5eb853
(cherry picked from commit f82fc6476d)
2022-08-25 00:25:25 +00:00