make recording activity not crash if microphone was in use. fixes #3160
This commit is contained in:
parent
2febbe1b8d
commit
b565c20d91
|
@ -67,7 +67,8 @@ public class RecordingActivity extends Activity implements View.OnClickListener
|
|||
super.onStart();
|
||||
if (!startRecording()) {
|
||||
this.binding.shareButton.setEnabled(false);
|
||||
Toast.makeText(this, R.string.unable_to_start_recording, Toast.LENGTH_SHORT).show();
|
||||
this.binding.timer.setTextAppearance(this, R.style.TextAppearance_Conversations_Title);
|
||||
this.binding.timer.setText(R.string.unable_to_start_recording);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,10 +109,17 @@ public class RecordingActivity extends Activity implements View.OnClickListener
|
|||
|
||||
protected void stopRecording(boolean saveFile) {
|
||||
mShouldFinishAfterWrite = saveFile;
|
||||
try {
|
||||
mRecorder.stop();
|
||||
mRecorder.release();
|
||||
} catch (Exception e) {
|
||||
if (saveFile) {
|
||||
Toast.makeText(this,R.string.unable_to_save_recording, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} finally {
|
||||
mRecorder = null;
|
||||
mStartTime = 0;
|
||||
}
|
||||
if (!saveFile && mOutputFile != null) {
|
||||
if (mOutputFile.delete()) {
|
||||
Log.d(Config.LOGTAG,"deleted canceled recording");
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="8dp"
|
||||
android:textAppearance="@style/TextAppearance.Conversations.Display2.Monospace"/>
|
||||
</RelativeLayout>
|
||||
</layout>
|
|
@ -127,6 +127,7 @@
|
|||
<string name="openpgp_error">OpenKeychain reported an error</string>
|
||||
<string name="accept">Accept</string>
|
||||
<string name="error">An error has occurred</string>
|
||||
<string name="recording_error">Error</string>
|
||||
<string name="your_account">Your account</string>
|
||||
<string name="send_presence_updates">Send presence updates</string>
|
||||
<string name="receive_presence_updates">Receive presence updates</string>
|
||||
|
@ -725,4 +726,5 @@
|
|||
<string name="create_dialog_group_chat_name">Group chat name</string>
|
||||
<string name="conference_destroyed">This group chat has been destroyed</string>
|
||||
<string name="phone_book">Address book</string>
|
||||
<string name="unable_to_save_recording">Unable to save recording</string>
|
||||
</resources>
|
||||
|
|
|
@ -264,6 +264,7 @@
|
|||
<item name="colorAccent">@color/blue_a200</item>
|
||||
<item name="color_background_primary">@color/grey50</item>
|
||||
<item name="divider">@color/black12</item>
|
||||
<item name="TextSizeTitle">18sp</item>
|
||||
<item name="TextSizeBody2">14sp</item>
|
||||
<item name="TextSizeDisplay2">45sp</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
|
|
Loading…
Reference in New Issue