Fix crash when starting multiple audio records.
This commit is contained in:
parent
a6d7b0c7bf
commit
6c6d4e801f
2 changed files with 4 additions and 8 deletions
|
@ -68,7 +68,8 @@ public class AudioRecorder {
|
|||
Log.i(TAG, "Running startRecording() + " + Thread.currentThread().getId());
|
||||
try {
|
||||
if (recorder != null) {
|
||||
throw new AssertionError("We can only record once at a time.");
|
||||
recordingSingle.onError(new IllegalStateException("We can only do one recording at a time!"));
|
||||
return;
|
||||
}
|
||||
|
||||
ParcelFileDescriptor fds[] = ParcelFileDescriptor.createPipe();
|
||||
|
|
|
@ -3381,13 +3381,8 @@ public class ConversationParentFragment extends Fragment
|
|||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
||||
|
||||
voiceNoteMediaController.pausePlayback();
|
||||
try {
|
||||
recordingSession = new RecordingSession(audioRecorder.startRecording());
|
||||
disposables.add(recordingSession);
|
||||
} catch (AssertionError err) {
|
||||
Log.e(TAG, "Could not start audio recording.", err);
|
||||
Toast.makeText(requireContext(), R.string.ConversationActivity_unable_to_record_audio, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
recordingSession = new RecordingSession(audioRecorder.startRecording());
|
||||
disposables.add(recordingSession);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue