Commit Graph

4 Commits

Author SHA1 Message Date
Mikhail Naganov
2e3b3e4c17 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
(cherry picked from commit 780fefb331)
Merged-In: I31f9dd832c7f85f9632d1d389a8b1063d237d4c1
2023-08-01 14:35:42 -07:00
Mikhail Naganov
bff67d3e12 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
(cherry picked from commit 6ddefdbcdf)
Merged-In: Iaf13d4bc3a53cbfc27264d3abd1f6c417ece3941
2023-08-01 14:35:12 -07:00
Mikhail Naganov
291712fd19 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
(cherry picked from commit 2eabaf995b)
Merged-In: I1350e7b3720c6244cd8527e1d021ee9577399291
2023-08-01 14:34:50 -07:00
Mikhail Naganov
38f8530b23 audio: Create ModulePrimary and ModuleStub
Make 'Module' more abstract by moving stream creation
methods to more concrete 'ModulePrimary' and 'ModuleStub'.
'ModulePrimary' is now closer to the CF primary module:
it was stripped off USB devices from its configuration,
these got moved to 'ModuleUsb', and got rid of BT A2DP
and LE interfaces, these will be on 'ModuleBluetooth'.
Note that 'ModulePrimary' still uses stub streams, this
will be changed in subsequent patches.

'ModuleStub' is what 'Module' used to be, just a module
for improving test coverage. It includes simulation of
offload streams and dummy BT objects.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I5e4da0c32c00d65688f2eda78b2c79594e4e4671
(cherry picked from commit 521fc49fba)
Merged-In: I5e4da0c32c00d65688f2eda78b2c79594e4e4671
2023-08-01 14:27:58 -07:00