From cc58ddde31698ba68702d6f708eca5d557bed0ec Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Wed, 16 Mar 2022 21:22:38 +0500 Subject: [PATCH] Changed: Check crash log file whenever `TermuxActivity` is resumed instead of only on app startup This adds onto 06dbfbdb since receiver would not be registered to receive `ACTION_NOTIFY_APP_CRASH` if `TermuxActivity` was not be in foreground --- app/src/main/java/com/termux/app/TermuxActivity.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/termux/app/TermuxActivity.java b/app/src/main/java/com/termux/app/TermuxActivity.java index acbe840c..3b0320f2 100644 --- a/app/src/main/java/com/termux/app/TermuxActivity.java +++ b/app/src/main/java/com/termux/app/TermuxActivity.java @@ -199,11 +199,6 @@ public final class TermuxActivity extends AppCompatActivity implements ServiceCo if (savedInstanceState != null) mIsActivityRecreated = savedInstanceState.getBoolean(ARG_ACTIVITY_RECREATED, false); - - // Check if a crash happened on last run of the app or if a plugin crashed and show a - // notification with the crash details if it did - TermuxCrashUtils.notifyAppCrashFromCrashLogFile(this, LOG_TAG); - // Delete ReportInfo serialized object files from cache older than 14 days ReportActivity.deleteReportInfoFilesOlderThanXDays(this, 14, false); @@ -316,6 +311,10 @@ public final class TermuxActivity extends AppCompatActivity implements ServiceCo if (mTermuxTerminalViewClient != null) mTermuxTerminalViewClient.onResume(); + // Check if a crash happened on last run of the app or if a plugin crashed and show a + // notification with the crash details if it did + TermuxCrashUtils.notifyAppCrashFromCrashLogFile(this, LOG_TAG); + mIsOnResumeAfterOnCreate = false; }