Discard voice note recording on error.

This commit is contained in:
Nicholas Tinsley
2023-06-22 13:32:27 -04:00
parent bc1fbd9b6c
commit 88f50da4fb
2 changed files with 3 additions and 2 deletions

View File

@@ -48,14 +48,14 @@ public class AudioRecorder {
if (this.uiHandler != null) {
onAudioFocusChangeListener = focusChange -> {
if (focusChange == AudioManager.AUDIOFOCUS_LOSS) {
Log.i(TAG, "Audio focus change " + focusChange + " stopping recording");
Log.i(TAG, "Audio focus change " + focusChange + " stopping recording via UI handler.");
this.uiHandler.onRecordCanceled(false);
}
};
} else {
onAudioFocusChangeListener = focusChange -> {
if (focusChange == AudioManager.AUDIOFOCUS_LOSS) {
Log.i(TAG, "Audio focus change " + focusChange + " stopping recording");
Log.i(TAG, "Audio focus change " + focusChange + " stopping recording.");
stopRecording();
}
};