libaudiohal@aidl: Fix position and latency reporting
For latency, use the last returned value if the current
command did not provide latency (not every command does).
This avoids "Suspicious latency value reported by HAL..."
warnings.
Make sure that position and timestamp values are non-negative
(HAL may left them initialized to the default value `-1`).
Replace `if (status = ...; status != OK) return status` with
`RETURN_STATUS_IF_ERROR`. This also fixes `getRenderPosition`
which was returning `OK`.
Bug: 302132812
Bug: 302519087
Test: atest CtsMediaAudioTestCases
Change-Id: I5780eafd558bca85e966aa8374573df6a4133b9a
2 files changed