mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
The rest of the API (*::analyseStatus) returns NOT_SUPPORTED when the legacy API returns -ENOSYS. setParameter legacy -> treble shim did not follow this conversion due to the legacy API stating that for get_paramers, -ENOSYS should be returned if "the implementation does not accept a parameter change while the output is active but the parameter is acceptable otherwise", aka INVALID_STATE. Thus setParameter shim used to return - OK for OK - INVALID_STATE for -ENOSYS - INVALID_ARGUMENTS for everything else This leads to several problems: - an implementation of the legacy API can not report NOT_SUPPORTED - it is inconsistent with the rest of the status_t conversion methods - shim methods implemented over getParameter can not distinguish between different failures as required by the .hal documentation Most importantly, on the system side, the Result is transformed to a status_t again but without any special logic for methods wrapping getParameter in the shim. This can not be changed as the system can not know which methods are implemented with a legacy wrapper under the Treble API boundary. Thus setParam now converts status_t to Result in the same way as all the other shim methods. This patch is the second half of I41204c0807d2bd4675e941771cbc9a43d7d14855 that was reverted due to a merge conflict. Bug: 72873273 Bug: 69811500 Bug: 69010523 Test: playback and record for media and voice call Original-Change-Id: I41204c0807d2bd4675e941771cbc9a43d7d14855 Change-Id: I41328afce56ce31d4a26159ca2d4b16d14cce05b Signed-off-by: Kevin Rocard <krocard@google.com>
Directory structure of the audio HIDL related code.
audio
|-- 2.0 <== HIDL (.hal) can not be moved to fit the directory structure
| because that would create a separate HAL
|-- 4.0 <== Version 4.0 of the core API
|
|-- common <== code common to audio core and effect API
| |-- 2.0
| | |-- default <== code that wraps the legacy API
| | `-- vts <== vts of 2.0 core and effect API common code
| |-- 4.0
| | |-- default
| | `-- vts
| |-- ... <== The future versions should continue this structure
| | |-- default
| | `-- vts
| `-- all_versions <== code common to all version of both core and effect API
| |-- default
| `-- vts <== vts of core and effect API common version independent code
|
|-- core <== code relative to the core API
| |-- 2.0 <== 2.0 core API code (except .hal, see audio/2.0)
| | |-- default
| | `-- vts
| |-- 4.0
| | |-- default <== default implementation of the core 4.0 api
| | `-- vts <== vts code of the 4.0 API
| |-- ...
| | |-- default
| | `-- vts
| `-- all_versions
| |-- default
| `-- vts <== vts of core API common version independent code
|
`-- effect <== idem for the effect API
|-- 2.0
| |-- default
| `-- vts
|-- 4.0
| |-- default
| `-- vts
|-- ...
| |-- default
| `-- vts
`-- all_versions
|-- default
`-- vts