Catch new audio recording error states.
This commit is contained in:
parent
7bae8b6e1b
commit
10f376e402
1 changed files with 10 additions and 5 deletions
|
@ -3377,9 +3377,13 @@ public class ConversationParentFragment extends Fragment
|
||||||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
||||||
|
|
||||||
voiceNoteMediaController.pausePlayback();
|
voiceNoteMediaController.pausePlayback();
|
||||||
|
try {
|
||||||
recordingSession = new RecordingSession(audioRecorder.startRecording());
|
recordingSession = new RecordingSession(audioRecorder.startRecording());
|
||||||
|
|
||||||
disposables.add(recordingSession);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3398,9 +3402,10 @@ public class ConversationParentFragment extends Fragment
|
||||||
|
|
||||||
requireActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
requireActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||||
|
if (recordingSession != null) {
|
||||||
recordingSession.completeRecording();
|
recordingSession.completeRecording();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecorderCanceled(boolean byUser) {
|
public void onRecorderCanceled(boolean byUser) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue