Track elapsed time for 'waitStreamEnd' timeout

Total elapsed time was not being updated and so 'waitStreamEnd' could
never time out. Allowing timeout to work correctly avoids certain
deadlocks.

Note that the new logic matches that in ClientProxy::obtainBuffer.

Test: CTS : AudioTrackOffloadTest#testMP3AudioTrackOffload
Bug: 207382575
Change-Id: I118fec778aab86ad53bef144d2a231cac08a1f2c
1 file changed