StreamHalAidl: Treat MMAP 'stop' as 'pause'

Since MMAP 'stop' does not assume that the shared buffer handler
can be invalidated, the framework does not call
'createMmapBuffer' when starting after a 'stop'. However, the
AIDL HAL stream state machine automatically moves into 'STANDBY'
after 'flush', and this may invalidate the shared buffer.

The solution is to avoid calling 'flush' and anticipate that an
input stream can be in a 'PAUSED' state when the framework wants
to start it. Since the HAL may report "overruns" (lost frames)
while having the hardware is producing frames but the client
is not consuming them, ignore 'xrunFrames' when exiting paused
state.

Flag: EXEMPT BUGFIX
Bug: 419693182
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: I572c908604e967cdbd999fd1bf8224a802717c78
1 file changed