summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BrowserSettings.java
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2011-11-21 09:08:21 -0800
committerGeorge Mount <mount@google.com>2011-11-23 14:06:03 -0800
commit3636d0a6d90fd8de55a4894210b2dbe23f32aac9 (patch)
tree7109001dd220719fe4d43369506dbd2d8b0b69a8 /src/com/android/browser/BrowserSettings.java
parente744d3b4f1f5d649c96641d5b77fb169b0e102d2 (diff)
downloadandroid_packages_apps_Gello-3636d0a6d90fd8de55a4894210b2dbe23f32aac9.tar.gz
android_packages_apps_Gello-3636d0a6d90fd8de55a4894210b2dbe23f32aac9.tar.bz2
android_packages_apps_Gello-3636d0a6d90fd8de55a4894210b2dbe23f32aac9.zip
Crash recover no longer uses icicle.
Bug 5508252 Changed load state to use the crash recovery state every time instead of using icicle. When the state is saved, the value is written synchronously. Moved settings from CrashRecoveryHandler to BrowserSettings Change-Id: I1a241d4c488fe3246c7d7f1ee0ce26c42ba29429
Diffstat (limited to 'src/com/android/browser/BrowserSettings.java')
-rw-r--r--src/com/android/browser/BrowserSettings.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 23695549..ac6e4f36 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -847,4 +847,47 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
return mPrefs.getString(PREF_DATA_PRELOAD, getDefaultPreloadSetting());
}
+ // -----------------------------
+ // getter/setters for browser recovery
+ // -----------------------------
+ /**
+ * The last time browser was started.
+ * @return The last browser start time as System.currentTimeMillis. This
+ * can be 0 if this is the first time or the last tab was closed.
+ */
+ public long getLastRecovered() {
+ return mPrefs.getLong(KEY_LAST_RECOVERED, 0);
+ }
+
+ /**
+ * Sets the last browser start time.
+ * @param time The last time as System.currentTimeMillis that the browser
+ * was started. This should be set to 0 if the last tab is closed.
+ */
+ public void setLastRecovered(long time) {
+ mPrefs.edit()
+ .putLong(KEY_LAST_RECOVERED, time)
+ .apply();
+ }
+
+ /**
+ * Used to determine whether or not the previous browser run crashed. Once
+ * the previous state has been determined, the value will be set to false
+ * until a pause is received.
+ * @return true if the last browser run was paused or false if it crashed.
+ */
+ public boolean wasLastRunPaused() {
+ return mPrefs.getBoolean(KEY_LAST_RUN_PAUSED, false);
+ }
+
+ /**
+ * Sets whether or not the last run was a pause or crash.
+ * @param isPaused Set to true When a pause is received or false after
+ * resuming.
+ */
+ public void setLastRunPaused(boolean isPaused) {
+ mPrefs.edit()
+ .putBoolean(KEY_LAST_RUN_PAUSED, isPaused)
+ .apply();
+ }
}