зеркало из https://github.com/mozilla/gecko-dev.git
Bug 999203 - Add a pref to record crashes. r=mfinkle
This commit is contained in:
Родитель
de7cef208f
Коммит
a0b3d243cc
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче