No description
Find a file
Kevin Rocard 574cc909d4 Audio: setParam improve status_t to Result consistency
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
 - is inconsistent with the rest of the status_t conversion methods
 - shim methods implemented over getParameter can not distinguish
   failures error 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.
See: analyzeResult in
     frameworks/av/media/libaudiohal/2.0/ConversionHelperHidl.cpp
This can not be changed as the system can not know which methods
are implemented with a legacy wrapper under the Treble API boundary.

This mean that if:
 - hal return -ENOSYS ()
 - shim converts it to INVALID_STATE
 - libaudiohal converts it to NOT_ENOUGH_DATA ()
Thus the checkForNewParameter_l's "status == INVALID_OPERATION"
test in frameworks/av/services/audioflinger/Threads.cpp
are now always false and broken.
This has been broken since the introduction of the Treble shim for O.

Thus setParam now converts status_t to Result in the same way
as all the other shim methods.

Bug: 72873273
Bug: 69811500
Bug: 69010523
Test: playback and record for media and voice call
Change-Id: I41204c0807d2bd4675e941771cbc9a43d7d14855
Merged-In: I41328afce56ce31d4a26159ca2d4b16d14cce05b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-20 23:30:28 +00:00
audio Audio: setParam improve status_t to Result consistency 2018-04-20 23:30:28 +00:00
automotive Update vts test module bp files to use VtsHalTargetTestDefaults 2018-03-22 23:36:10 +00:00
biometrics/fingerprint/2.1 Convert fingerprint hal test to use VtsHalHidlTargetTestEnvBase 2018-02-08 22:24:04 -08:00
bluetooth Add BLOCK_SUSPEND capability for Bluetooth HAL service 2018-03-29 10:17:07 -07:00
boot/1.0 Fix boot VTS GetSuffix test 2018-02-23 13:54:53 -08:00
broadcastradio Update makefiles. 2018-01-17 11:20:17 -08:00
camera camera: add support for camera removal 2018-01-22 12:01:08 -08:00
cas Convert cas hal test to use VtsHalHidlTargetTestEnvBase 2018-02-08 21:31:01 -08:00
compatibility_matrices matrix: ENFORCE_NO_UNUSED_HALS 2018-03-29 11:29:32 -07:00
configstore configstore: whitelist getpid call for arm64 2018-03-19 18:12:21 +00:00
contexthub/1.0 Convert contexthub hal test to use VtsHalHidlTargetTestEnvBase 2018-02-10 12:37:48 -08:00
drm/1.0 Remove subdirs 2017-11-28 17:19:46 -08:00
dumpstate/1.0 Convert dumpstate hal test to use VtsHalHidlTargetTestEnvBase 2018-02-08 21:33:29 -08:00
gatekeeper/1.0 Convert gatekeeper hal test to use VtsHalHidlTargetTestEnvBase 2018-02-10 12:39:00 -08:00
gnss/1.0 Convert gnss hal test to use VtsHalHidlTargetTestEnvBase 2018-02-12 20:53:33 -08:00
graphics Merge "Update vts test module bp files to use VtsHalTargetTestDefaults" 2018-03-26 21:57:41 +00:00
health Convert health hal test to use VtsHalHidlTargetTestEnvBase 2018-02-12 23:48:50 +00:00
ir/1.0 Convert ir hal test to use VtsHalHidlTargetTestEnvBase 2018-02-10 19:35:49 -08:00
keymaster/3.0 Convert keymaster hal test to use VtsHalHidlTargetTestEnvBase 2018-02-10 12:40:25 -08:00
light blank_screen: shut off all lights 2018-03-16 13:04:53 -07:00
media Convert omx hal test to use VtsHalHidlTargetTestEnvBase 2018-02-09 16:31:03 -08:00
memtrack/1.0 Merge "Convert boot, memtrack and power hal to use service name aware testing." 2017-12-04 23:12:04 +00:00
neuralnetworks Relax NeuralNetwork's VTS positive and negative base tests 2018-03-05 13:01:00 -08:00
nfc Add defaultSysCodePowerState in types.hal in NFC 1.1 2018-04-04 23:11:42 +00:00
oemlock/1.0 Convert oemlock hal test to use VtsHalHidlTargetTestEnvBase 2018-02-08 22:42:39 -08:00
power Merge "Convert boot, memtrack and power hal to use service name aware testing." 2017-12-05 00:11:18 +00:00
radio Update RegState for new CellIdentity types 2018-03-30 15:57:24 -07:00
renderscript/1.0 Remove subdirs 2017-11-28 17:19:46 -08:00
secure_element/1.0 secure_element: VTS: Remove MANAGE_CHANNEL commands in transmit 2018-03-29 18:19:30 -07:00
sensors/1.0 Convert sensors HAL test to use VtsHalHidlTargetTestEnvBase 2018-01-24 09:35:55 -08:00
soundtrigger/2.0 Add OWNERS for audio-related HAL default implementations 2017-11-29 12:39:55 -08:00
tests Remove extra space. 2018-02-02 12:35:40 -08:00
tetheroffload Convert tetheroffload hal test to use VtsHalHidlTargetTestEnvBase 2018-02-12 22:57:05 +00:00
thermal Convert thermal hal test to use VtsHalHidlTargetTestEnvBase 2018-02-14 20:44:18 +00:00
tv Convert tv input hal test to use VtsHalHidlTargetTestEnvBase 2018-02-22 22:11:39 -08:00
usb Convert usb hal test to use VtsHalHidlTargetTestEnvBase 2018-02-09 17:56:55 +00:00
vibrator Convert vibrator hal test to use VtsHalHidlTargetTestEnvBase 2018-02-13 16:58:40 -08:00
vr/1.0 Convert vr hal test to use VtsHalHidlTargetTestEnvBase 2018-02-09 17:57:11 +00:00
weaver/1.0 onvert weaver hal test to use VtsHalHidlTargetTestEnvBase 2018-02-08 21:53:09 -08:00
wifi Merge "Update vts test module bp files to use VtsHalTargetTestDefaults" 2018-03-26 21:57:41 +00:00
.clang-format .clang-format: 100 lines 2017-05-02 16:45:27 -07:00
Android.bp Remove subdirs 2017-11-28 17:19:46 -08:00
CleanSpec.mk android.hardware.graphics.allocator@2.0 is no longer VNDK-SP 2017-12-13 11:58:24 +08:00
current.txt Unfreeze automotive HALs 2017-12-14 16:05:53 -08:00
MODULE_LICENSE_APACHE2 Apache2 module license. 2016-08-30 11:28:36 -07:00
NOTICE Apache2 module license. 2016-08-30 11:28:36 -07:00
OWNERS Add OWNERS in hardware/interfaces 2017-06-12 13:20:12 -07:00
PREUPLOAD.cfg Enable the clang-format pre-submit hook 2017-03-30 13:26:49 -07:00
update-base-files.sh Update base files script works anywhere. 2017-09-25 18:43:27 -07:00
update-makefiles.sh Update makefiles from anywhere. 2017-05-11 15:42:32 -07:00