Clarify restore dialog, prevent spam
Bug: 4599646
State that it is the browser's windows/tabs to be restored and
show the browser's app icon in the dialog.
Also cut down on the frequency this prompt will appear by
ignoring tabs that haven't loaded anything except the home page.
Change-Id: I2c2cc03aa92da3199c47b455256145d392548930
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index bb200d8..58a7491 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -37,6 +37,7 @@
import android.security.KeyChain;
import android.security.KeyChainAliasCallback;
import android.speech.RecognizerResultsIntent;
+import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -1776,6 +1777,12 @@
if (mMainView == null) {
return mSavedState != null;
}
+ // If the tab is the homepage or has no URL, don't save it
+ String homepage = BrowserSettings.getInstance().getHomePage();
+ if (TextUtils.equals(homepage, mCurrentState.mUrl)
+ || TextUtils.isEmpty(mCurrentState.mUrl)) {
+ return false;
+ }
mSavedState = new Bundle();
mMainView.saveState(mSavedState);