mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 18:26:57 +00:00
Catch new audio recording error states.
This commit is contained in:
committed by
Alex Hart
parent
e84c6187b9
commit
ff131087db
@@ -3375,9 +3375,13 @@ public class ConversationParentFragment extends Fragment
|
||||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
||||
|
||||
voiceNoteMediaController.pausePlayback();
|
||||
recordingSession = new RecordingSession(audioRecorder.startRecording());
|
||||
|
||||
disposables.add(recordingSession);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3396,8 +3400,9 @@ public class ConversationParentFragment extends Fragment
|
||||
|
||||
requireActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
|
||||
recordingSession.completeRecording();
|
||||
if (recordingSession != null) {
|
||||
recordingSession.completeRecording();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user