Skip to content
Snippets Groups Projects
Verified Commit 7d9380d3 authored by Torsten Grote's avatar Torsten Grote
Browse files

[android] go to homescreen after pressing back in crash reporter

Fixes #1390
parent 3c8c0e57
No related branches found
No related tags found
1 merge request!1049Improve crash screen and reporter
package org.briarproject.briar.android.reporting; package org.briarproject.briar.android.reporting;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
...@@ -13,10 +14,14 @@ import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault; ...@@ -13,10 +14,14 @@ import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault; import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
import org.briarproject.briar.R; import org.briarproject.briar.R;
import org.briarproject.briar.android.Localizer; import org.briarproject.briar.android.Localizer;
import org.briarproject.briar.android.logout.HideUiActivity;
import org.briarproject.briar.android.util.UserFeedback; import org.briarproject.briar.android.util.UserFeedback;
import java.io.File; import java.io.File;
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
import static android.os.Build.VERSION.SDK_INT; import static android.os.Build.VERSION.SDK_INT;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE; import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
...@@ -146,6 +151,11 @@ public class DevReportActivity extends BaseCrashReportDialog { ...@@ -146,6 +151,11 @@ public class DevReportActivity extends BaseCrashReportDialog {
void closeReport() { void closeReport() {
cancelReports(); cancelReports();
Intent i = new Intent(this, HideUiActivity.class);
i.addFlags(FLAG_ACTIVITY_NEW_TASK
| FLAG_ACTIVITY_NO_ANIMATION
| FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
finish(); finish();
} }
......
...@@ -277,7 +277,7 @@ public class ReportFormFragment extends Fragment ...@@ -277,7 +277,7 @@ public class ReportFormFragment extends Fragment
} }
getDevReportActivity().sendCrashReport(comment, email); getDevReportActivity().sendCrashReport(comment, email);
} }
if (getActivity() != null) getActivity().finish(); if (getActivity() != null) getDevReportActivity().closeReport();
} }
}.execute(); }.execute();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment