diff --git a/mobile/android/base/CrashReporter.java b/mobile/android/base/CrashReporter.java index d575668b4a66..ea39224f5d89 100644 --- a/mobile/android/base/CrashReporter.java +++ b/mobile/android/base/CrashReporter.java @@ -136,6 +136,7 @@ public class CrashReporter extends Activity SharedPreferences prefs = GeckoSharedPrefs.forApp(this); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(GeckoApp.PREFS_WAS_STOPPED, true); + editor.putBoolean(GeckoApp.PREFS_CRASHED, true); editor.commit(); final CheckBox allowContactCheckBox = (CheckBox) findViewById(R.id.allow_contact); diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 058083ceab28..0eb30057c768 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -157,6 +157,7 @@ public abstract class GeckoApp public static final String PREFS_OOM_EXCEPTION = "OOMException"; public static final String PREFS_VERSION_CODE = "versionCode"; public static final String PREFS_WAS_STOPPED = "wasStopped"; + public static final String PREFS_CRASHED = "crashed"; public static final String PREFS_CLEANUP_TEMP_FILES = "cleanupTempFiles"; public static final String SAVED_STATE_IN_BACKGROUND = "inBackground"; @@ -1772,10 +1773,17 @@ public abstract class GeckoApp shouldRestore = true; } else if (savedInstanceState != null || getSessionRestorePreference().equals("always") || - getRestartFromIntent() || - prefs.getBoolean(GeckoApp.PREFS_WAS_STOPPED, false)) { + getRestartFromIntent()) { // We're coming back from a background kill by the OS, the user - // has chosen to always restore, we restarted, or we crashed. + // has chosen to always restore, or we restarted. + shouldRestore = true; + } else if (prefs.getBoolean(GeckoApp.PREFS_CRASHED, false)) { + ThreadUtils.postToBackgroundThread(new Runnable() { + @Override + public void run() { + prefs.edit().putBoolean(PREFS_CRASHED, false).commit(); + } + }); shouldRestore = true; }