Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hanging crash report on android 14 #289

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.util.Log;

import com.github.frimtec.android.securesmsproxy.state.DbHelper;
import com.github.frimtec.android.securesmsproxy.ui.SendLogActivity;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down Expand Up @@ -43,11 +44,11 @@

private void handleUncaughtException(Thread thread, Throwable e) {
Log.e(TAG, "Unhandled exception occurred", e);
Intent intent = new Intent();
intent.setAction(ACTION_SEND_LOG);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Application application = (Application) this.getApplicationContext();
Intent intent = new Intent(application, SendLogActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);

Check warning on line 49 in app/src/main/java/com/github/frimtec/android/securesmsproxy/SecureSmsProxyApplication.java

View check run for this annotation

Codecov / codecov/patch

app/src/main/java/com/github/frimtec/android/securesmsproxy/SecureSmsProxyApplication.java#L47-L49

Added lines #L47 - L49 were not covered by tests
intent.putExtra(EXTRA_BUG_REPORT, createReport(thread, e));
startActivity(intent);
application.startActivity(intent);

Check warning on line 51 in app/src/main/java/com/github/frimtec/android/securesmsproxy/SecureSmsProxyApplication.java

View check run for this annotation

Codecov / codecov/patch

app/src/main/java/com/github/frimtec/android/securesmsproxy/SecureSmsProxyApplication.java#L51

Added line #L51 was not covered by tests
Process.killProcess(Process.myPid());
}

Expand Down