Commit Graph

47380 Commits

Author SHA1 Message Date
Shraddha Basantwani
035beba203 Audio : Fix a few minor issues with stream switcher class
1. Constructor should forward variable arguments
2. mContext initialization was missing
3. Add nullptr check for addEffect and removeEffect methods

Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I4037292bf497be186b26508bd16846886fa4fe55
2023-08-01 12:06:20 +00:00
Hugo Drumond Jacob
28b2c1ad37 [automerger skipped] [DO NOT MERGE] Handle unavailable properties am: aeafec3db0 -s ours am: 373a052124 -s ours
am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2654145

Change-Id: I3a400c1f5427cffca8e78ffebfa690d0a87cd42b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-28 13:27:45 +00:00
Hugo Drumond Jacob
373a052124 [automerger skipped] [DO NOT MERGE] Handle unavailable properties am: aeafec3db0 -s ours
am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2654145

Change-Id: I850f4b7d589b051086d05d2d59f7dec9d2d86537
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-28 11:14:48 +00:00
Treehugger Robot
fb54986369 Merge "Vts VR test -= vr.h - IWYU" into main 2023-07-27 17:54:03 +00:00
Treehugger Robot
bfa8a13317 Merge "Enable Gyroscope sensor injection by AIDL flag" into main 2023-07-26 17:22:28 +00:00
Treehugger Robot
9e9c6feffa Merge "Enable Magnetometer sensor injection by AIDL flag" into main 2023-07-26 16:53:59 +00:00
Ryan Prichard
e5896f0fea Merge "Include <functional> for std::function and std::placeholders" into main 2023-07-25 20:17:01 +00:00
Hugo Drumond Jacob
aeafec3db0 [DO NOT MERGE] Handle unavailable properties
Accommodate the case in which `set()` for an unavailable property is
called as the VHAL may return OK or NOT_AVAILABLE.

Also, it may be the case that certain properties aren't available
while testing and thus, setting a value and getting it right after
might not always work.

Bug: 290882809
Change-Id: I7b7b3f144c4fbd786bf673a86fcac110ec8f79b5
2023-07-25 18:09:28 +00:00
Steven Moreland
0354c1935e Vts VR test -= vr.h - IWYU
To allow more cleanup elsewhere.

Bug: 37280010
Test: build
Change-Id: I7c3f884e433ec478fba3d3fe3a641779b6b279d5
2023-07-25 17:35:58 +00:00
Mikhail Naganov
43a85cfb2b audio: Add a helper class to simplify legacy HALs migration
Since in the C and HIDL APIs the method for opening a stream
receives the device to connect to, some legacy HAL implementations
took an advantage of that. In AIDL APIs device port connection
process is more dynamic and independent of the stream creation.

To simplify porting of legacy implementations to AIDL, a helper
class StreamSwitcher is added. It emulates the legacy behavior
by allowing to postpone the stream implementation creation until
the connected device is known. Until that moment, it exposes
to the client a stub implementation of the stream interface.

Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie8ae0338fd22f705e00a34e56a7fa235eda5ed9e
2023-07-24 16:40:39 -07:00
Mikhail Naganov
1eedc130e8 audio: Move frame counter to StreamContext
Moving frame counter to the StreamContext class enables
switching stream drivers on the fly while keeping the frame
count monotonically increasing.

StreamWorkerCommonLogic now holds a pointer to StreamContext,
which makes redundant storing copies of the fields of the latter.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If6716f4051c484b52927cbfe4032df7c907eb3a5
2023-07-24 16:37:18 -07:00
Mikhail Naganov
780fefb331 audio: Update ChildInterface to set scheduler policy lazily
Since the client may end up never retrieving the interface
instance for sending it over Binder, postpone setting
of the scheduler policy to until that very moment.

Rename 'ChildInterface::getPtr' to 'getInstance' for clarity.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I31f9dd832c7f85f9632d1d389a8b1063d237d4c1
2023-07-24 16:36:51 -07:00
Eric Biggers
47b145a0d8 Allow uninstantiated WeaverTest
Add back GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST, which I had
accidentally removed while merging the AIDL and HIDL tests.  I think
this is still needed on devices that don't support Weaver at all.

Bug: 291284381
Test: atest VtsHalWeaverTargetTest
Change-Id: Iac1b4476620e51c645e3ad57444ee386cb879029
2023-07-24 17:28:37 +00:00
Ryan Prichard
c8fc80c47b Include <functional> for std::function and std::placeholders
Bug: b/175635923
Test: treehugger
Change-Id: I3dabb8c44334713be9e461dd81f437c3da1ea936
2023-07-21 16:18:11 -07:00
Treehugger Robot
75275ce51e Merge "FCM: add c2 software, IConfigurable instances" into main 2023-07-21 20:46:08 +00:00
Menna Awadallah
d840c2d5a1 Enable Gyroscope sensor injection by AIDL flag
Enable the flag to be used by cuttlefish.
Test: Manual.
Bug: 292206288

Change-Id: I34abe7c5bbec8a336c71775f9db0bd783cf34bc4
2023-07-21 10:57:43 +00:00
Treehugger Robot
299db35551 Merge "Fix a DimmingStage documentation typo by rewording the doc." into main 2023-07-21 03:44:41 +00:00
Treehugger Robot
12c4bf6ba1 Merge changes from topic "fix-b-264712385-primary-module" into main
* changes:
  audio: Move StreamContext ownership out from StreamCommonImpl
  audio: Use ChildInterface in StreamCommonImpl
  audio: Update StreamAlsa and alsa utils for built-in devices
  audio: Simplify and extend alsa::Mixer
2023-07-20 23:09:50 +00:00
Alec Mouri
cdcfd05736 Fix a DimmingStage documentation typo by rewording the doc.
Change-Id: I5a1b3a99630cfded4b34c74b020bb4df2ce12084
2023-07-20 23:07:17 +00:00
Eric Biggers
2a5366d850 Merge changes from topic "weaver-vts-fix" into main
* changes:
  Don't overwrite in-use Weaver slots during VTS
  Simplify Weaver VTS test
  Remove redundant HIDL Weaver VTS test
  Move VtsHalWeaverTargetTest to common directory
  Make VtsHalWeaverTargetTest test both HIDL and AIDL services
  Clarify the Weaver documentation
  Update weaver AIDL default to use V2
  Add WeaverReadStatus to WeaverReadResponse
2023-07-20 16:53:13 +00:00
Mikhail Naganov
6ddefdbcdf audio: Move StreamContext ownership out from StreamCommonImpl
Upcoming implementations of the streams of the primary module
will need to change the underlying stream type depending on
the current connected device. The stream context must persist,
thus its life time must be bound to the IStreamIn/Out implementation.
Move the StreamContext instance under ownership of StreamIn/Out.

Add StreamCommonImpl::onClose so that the owner of the context
may know when it is safe to reset it.

Re-arrange the order of the arguments when creating a stream
so that the context always comes first.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iaf13d4bc3a53cbfc27264d3abd1f6c417ece3941
2023-07-19 17:49:28 -07:00
Mikhail Naganov
2eabaf995b audio: Use ChildInterface in StreamCommonImpl
Replace the pair of 'shared_ptr<>, Binder' with
the equivalent ChildInterface.

Fix logging of returned sub-objects to print their
Binder value instead of the local pointer.

Bug: 264712385
Test: m
Change-Id: I1350e7b3720c6244cd8527e1d021ee9577399291
2023-07-19 17:36:37 -07:00
Mikhail Naganov
422f7e6b1b audio: Update StreamAlsa and alsa utils for built-in devices
Use new functions added to alsa proxy layer for opening
attached (built-in) devices.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia2a47ff96fa62f99ce4ec4a0993ca3fd86f82c9d
2023-07-19 17:35:39 -07:00
Mikhail Naganov
f12d4a1ef8 audio: Simplify and extend alsa::Mixer
Remove alsa::MixerControl. tinyALSA contains utility
functions for setting values in percents, they use
the same logic as used to be there for handling
the "volume" control. Use access serialization at
the mixer level, rather than for each control.

Move the call to 'mixer_open' to alsa::Mixer.

Add controls for capture (mic) mute and gain. They
will be used by the primary HAL.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I0fad994153de96aceec3eb8f2fec19805ec912f8
2023-07-19 17:35:38 -07:00
Steven Moreland
72f588429a FCM: add c2 software, IConfigurable instances
These instances were previously added manually
on a device-by-device basis. Adding them explicitly
here now.

Bug: 290408770
Test: N/A
Change-Id: Ibc1470aae02d2b1172ea62efeb5af31224b80c45
2023-07-19 21:22:38 +00:00
Max Bires
fe9355f3c6 Merge "Slight documentation tweak" into main 2023-07-19 20:52:56 +00:00
Treehugger Robot
1da295ca82 Merge "Require mapper4" into main 2023-07-19 18:20:57 +00:00
Treehugger Robot
c081fa39df Merge changes I88ee8d2f,Id15ecc7f into main
* changes:
  Let the lazy CAS HAL to override the regular one
  Unmark executable bits from CAS AIDL HAL impl
2023-07-19 17:06:00 +00:00
Eric Biggers
31380e7bc9 Don't overwrite in-use Weaver slots during VTS
VtsHalWeaverTargetTest always overwrote the first and last Weaver slots.
Before Android 14, apparently this didn't cause problems because Android
didn't use Weaver for users that never had an LSKF set.  However, now
users get a Weaver slot right away.  That typically means that the first
Weaver slot will be used by user 0.

Fix the test to read /metadata/password_slots/slot_map to determine
which slots are in use by the system, and only write to unused slots.

Bug: 291284381
Test: 'atest -v VtsHalWeaverTargetTest'.  Checked for INFO messages
      showing that slots 1 and 63 were used by the test.  Then rebooted
      and verified that the device can still be unlocked.
Change-Id: Id2cce4240d68999471e7d1e8fc7a8449587eed97
2023-07-19 15:59:10 +00:00
John Reck
34412e26a6 Require mapper4
Bug: 280901110
Test: make

Change-Id: I49fa786957716d896b5476eac32b4c6d9077fe80
2023-07-19 11:29:56 -04:00
Shraddha Basantwani
7770c158a1 Audio : Fix minor comments in r_submix module
Add missing check for StandbyTransition variable
Add missing & in const arguments

Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id7a30e0697da80a272768bbf2aa8e3ed748e93f4
2023-07-19 16:43:50 +05:30
Eric Biggers
961a138e47 Simplify Weaver VTS test
- Get the config in SetUp() so that it's easily available to test cases.
- Rename "weaver" class member to "weaver_" to match coding style.
- Eliminate unnecessary variables when checking WeaverReadResponse.
- Fix a typo.

Bug: 291284381
Test: 'atest VtsHalWeaverTargetTest' on bramble
Change-Id: Ia6dca996103057bfdc9002bc9ab2c039e2333ed9
2023-07-19 04:09:01 +00:00
Eric Biggers
e2e40d69a6 Remove redundant HIDL Weaver VTS test
Now that there is a single Weaver VTS test that covers both the HIDL and
AIDL services (weaver/vts/), the HIDL-specific test can be deleted.

Bug: 291284381
Test: 'atest VtsHalWeaverTargetTest' on bramble
Change-Id: Ie942825c154e6792e6ffdbf0c59248de9de10d92
2023-07-19 04:09:01 +00:00
Eric Biggers
f0d6907d20 Move VtsHalWeaverTargetTest to common directory
Since VtsHalWeaverTargetTest now handles both AIDL and HIDL, move it
from weaver/aidl/vts/ to weaver/vts/.

Bug: 291284381
Test: 'atest VtsHalWeaverTargetTest' on bramble
Change-Id: Icfa0ff3b22b036110df327674fda44820057aabd
2023-07-19 04:09:01 +00:00
Eric Biggers
b59654f239 Make VtsHalWeaverTargetTest test both HIDL and AIDL services
VtsHalWeaverTargetTest and VtsHalWeaverV1_0TargetTest are identical
except for whether they use AIDL or HIDL.  Unfortunately, the HIDL test
is needed for several more years.  For now, we have to make some
substantial fixes to both tests.  To make continued maintenance of this
test easier, update VtsHalWeaverTargetTest to handle both AIDL and HIDL.
The test cases are still written in terms of the AIDL API, so it should
still be straightforward to remove HIDL support when the time comes.

Bug: 291284381
Test: 'atest VtsHalWeaverTargetTest' on bramble
Change-Id: I6b760930146ad1b08f17ef810a86c0058601c3bf
2023-07-19 04:09:01 +00:00
Eric Biggers
a4742a0291 Clarify the Weaver documentation
- Explicitly mention that Weaver is for *persistent* storage
- Explicitly mention secure deletion requirement

Change-Id: I3eaf7408570ff20c69a21398e39e16be97d2a917
(cherry picked from commit acd066c614)
Merged-In: I3eaf7408570ff20c69a21398e39e16be97d2a917
2023-07-19 04:08:57 +00:00
Devin Moore
316cf58d49 Update weaver AIDL default to use V2
Test: VtsHalWeaverTargetTest
Bug: 259556049
Change-Id: Id6aa9316a20541bf2c9a7cc53345a5010a188d00
(cherry picked from commit daf12d9440)
Merged-In: Id6aa9316a20541bf2c9a7cc53345a5010a188d00
2023-07-19 04:08:53 +00:00
ChengYou Ho
20c47b4bae Add WeaverReadStatus to WeaverReadResponse
Bug: 259556049
Change-Id: I83897038eda59ed8cae1bdb0ae68828201615ebc
(cherry picked from commit 5c3a2b710e)
Merged-In: I83897038eda59ed8cae1bdb0ae68828201615ebc
2023-07-19 04:08:48 +00:00
Eric Biggers
ac5fe6e8e8 Merge "Update OWNERS for Weaver" into main 2023-07-19 03:39:02 +00:00
Eric Biggers
f4483a2ce9 Update OWNERS for Weaver
Weaver does not have a clear owner, but list the people who seem to be
most involved with it currently.

Bug: 291284381
Test: N/A
Change-Id: I69de46f8154bf91272a7197ce71c13c745a7208e
2023-07-19 03:30:56 +00:00
Max Bires
5c0f7234b6 Slight documentation tweak
Specify that DICE-based RKP implementations may also allow a ROM
extension to manage the UDS public key.

Test: The words are semantically parseable
Change-Id: I8f9c6efb01fc76318220cf1bc4a0eb3a3ad42f87
2023-07-18 20:26:33 -07:00
Jin Chen
886eb1f6ef Merge "[uwb](hal) Add radar data packet format" into main 2023-07-18 23:27:39 +00:00
Treehugger Robot
1829d2133f Merge "audio: Fix state machine initial and final state symbols" into main 2023-07-18 22:59:06 +00:00
Mikhail Naganov
f082902b41 audio: Fix state machine initial and final state symbols
In UML, the initial state is a solid circle, the final
state is a double circle. In the Core HAL diagrams it
was the opposite.

Test: dot -Tpng stream-{in|out}-[async-]sm.gv -o ...
Change-Id: Id69f17d0a47227e744eb6dadcb5fee08c07bb0bd
2023-07-18 14:46:18 -07:00
Shunkai Yao
a8c5e014db Update effect AIDL state machine graph
Bug: 271500140
Test: dot -Tpng state.gv -o state.png
Change-Id: Icbabe75e24497594f8bc62985553c1c13d268dae
2023-07-18 21:22:15 +00:00
Treehugger Robot
98e165d1f6 Merge "Fix vts sco test fail for usb interface" into main 2023-07-18 17:46:54 +00:00
Treehugger Robot
03b140d2fb Merge "Enabled attest-id tests to run on GSI builds as well." into main 2023-07-18 16:39:32 +00:00
xiaoshun.xu
4e85c09959 Fix vts sco test fail for usb interface
[Description]
If bt controller device is usb interface,
sco loopback single pkt and bandwidth test can not pass
because pkt size is limited accroding to core spec

[Root Cause]
USB sco packet size is limited in spec

[Solution]
If is bt usb chip, continuous receive sco packets
  from controller until size is enough

[Test Report]
Test Pass

Bug: 286355871
Change-Id: Idb150d8a72149f7e1dfaccfd7bc82a91710da59c
2023-07-18 09:34:08 +08:00
Steven Moreland
031aeee88c Merge "compat matrix: add ISap slot2" into main 2023-07-17 23:42:51 +00:00
Treehugger Robot
cdac9b5064 Merge "Make EffectFactory implementation thread-safe" into main 2023-07-17 22:43:24 +00:00