Fix stuck recording ui when recording is aborted
When the recording activity is paused and recording is canceled (e.g.
loss of audio focus), the recording UI appears frozen when the
activity resumes.
This happens due to two issues:
1. When the activity is paused it ignores the cancellation
MSG_FM_EXIT event.
2. When the activity is destroyed, it does not check the current
state of the Recorder when it resumes.
In both these cases, the activity assumes that the recording is still
ongoing but the stop button fails silently when there is no recording
to stop.
Fix these issues by querying the recording status when the activity
resumes and show the save dialog if the recording was stopped.
oResume() and onServiceConnected() have been consolidated in to
onResumeWithService() and handles checking the status of the service,
starting recording and revisiting the activity.
In FmService, the recording state returns 'INVALID' before the first
recording starts because the recorder has not yet been created.
Querying the recording state before starting the 2nd recording returns
'IDLE'. Treat the 1st and 2nd cases the same and return 'IDLE'.
FEIJ-1373
Change-Id: I8a6f85f067a4c5737c5e00e6c035ba743c373e8f
2 files changed