Fix MediaRecorder crash when no data captured.

fork-5.53.8
Cody Henthorne 2022-01-03 16:33:48 -05:00 zatwierdzone przez Greyson Parrelli
rodzic 8968ef1b85
commit ae40a65924
2 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -37,8 +37,17 @@ public class MediaRecorderWrapper implements Recorder {
@Override @Override
public void stop() { public void stop() {
recorder.stop(); try {
recorder.release(); recorder.stop();
recorder = null; } catch (RuntimeException e) {
if (e.getClass() != RuntimeException.class) {
throw e;
} else {
Log.d(TAG, "Recording stopped with no data captured.");
}
} finally {
recorder.release();
recorder = null;
}
} }
} }

Wyświetl plik

@ -87,7 +87,7 @@ public final class FeatureFlags {
private static final String DONOR_BADGES = "android.donorBadges.6"; private static final String DONOR_BADGES = "android.donorBadges.6";
private static final String DONOR_BADGES_DISPLAY = "android.donorBadges.display.4"; private static final String DONOR_BADGES_DISPLAY = "android.donorBadges.display.4";
private static final String CDSH = "android.cdsh"; private static final String CDSH = "android.cdsh";
private static final String VOICE_NOTE_RECORDING_V2 = "android.voiceNoteRecordingV2"; private static final String VOICE_NOTE_RECORDING_V2 = "android.voiceNoteRecordingV2.2";
/** /**
* We will only store remote values for flags in this set. If you want a flag to be controllable * We will only store remote values for flags in this set. If you want a flag to be controllable
@ -432,7 +432,7 @@ public final class FeatureFlags {
/** Whether or not to use the new voice note recorder backed by MediaRecorder. */ /** Whether or not to use the new voice note recorder backed by MediaRecorder. */
public static boolean voiceNoteRecordingV2() { public static boolean voiceNoteRecordingV2() {
return getBoolean(VOICE_NOTE_RECORDING_V2, true); return getBoolean(VOICE_NOTE_RECORDING_V2, false);
} }
/** Only for rendering debug info. */ /** Only for rendering debug info. */