Add bulletproofing to state recovery

 Bug: 5166335

Change-Id: Ife9ef2da7664f8de6b0ff9655611efa78d84df05
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 84d7e36..3093085 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -635,8 +635,6 @@
         mNfcHandler.onPause();
 
         WebView.disablePlatformNotifications();
-        mCrashRecoveryHandler.backupState();
-
     }
 
     void onSaveInstanceState(Bundle outState) {
@@ -852,6 +850,7 @@
 
     @Override
     public void onProgressChanged(Tab tab) {
+        mCrashRecoveryHandler.backupState();
         int newProgress = tab.getLoadProgress();
 
         if (newProgress == 100) {
@@ -942,11 +941,7 @@
             return;
         }
         DataController.getInstance(mActivity).updateVisitedHistory(url);
-        if (!mActivityPaused) {
-            // Since we clear the state in onPause, don't backup the current
-            // state if we are already paused
-            mCrashRecoveryHandler.backupState();
-        }
+        mCrashRecoveryHandler.backupState();
     }
 
     @Override