fix back key on tabs behavior
Bug: 5851422 5841282
don't restore back/forward list when re-creating a webview
Change-Id: I4648ced38aafedb8e129f599f0ea28f7520da9b8
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index a7598c2..b09e423 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1501,11 +1501,15 @@
return mId;
}
+ void setWebView(WebView w) {
+ setWebView(w, true);
+ }
+
/**
* Sets the WebView for this tab, correctly removing the old WebView from
* the container view.
*/
- void setWebView(WebView w) {
+ void setWebView(WebView w, boolean restore) {
if (mMainView == w) {
return;
}
@@ -1542,7 +1546,7 @@
if (tc != null && tc.getOnThumbnailUpdatedListener() != null) {
mMainView.setPictureListener(this);
}
- if (mSavedState != null) {
+ if (restore && (mSavedState != null)) {
WebBackForwardList restoredState
= mMainView.restoreState(mSavedState);
if (restoredState == null || restoredState.getSize() == 0) {