Skip to content

Commit 23a446c

Browse files
committed
Fix onFirstLayout path for saved pages
Bug: 5464993 Saved pages are taking the onFirstLayout path in onConfigurationChange incorrectly. Fix that by clearing out the view state after actual first layout. Change-Id: I61578f35ee6be349df49a63c464f532e0a87df28
1 parent 39268ff commit 23a446c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/java/android/webkit/WebView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,7 @@ public boolean loadViewState(InputStream stream) {
19171917
mLoadedPicture = ViewStateSerializer.deserializeViewState(stream, this);
19181918
mBlockWebkitViewMessages = true;
19191919
setNewPicture(mLoadedPicture, true);
1920+
mLoadedPicture.mViewState = null;
19201921
return true;
19211922
} catch (IOException e) {
19221923
Log.w(LOGTAG, "Failed to loadViewState", e);
@@ -4355,7 +4356,9 @@ protected void onConfigurationChanged(Configuration newConfig) {
43554356
selectionDone();
43564357
}
43574358
mOrientation = newConfig.orientation;
4358-
mWebViewCore.sendMessage(EventHub.CLEAR_CONTENT);
4359+
if (mWebViewCore != null && !mBlockWebkitViewMessages) {
4360+
mWebViewCore.sendMessage(EventHub.CLEAR_CONTENT);
4361+
}
43594362
}
43604363

43614364
/**

0 commit comments

Comments
 (0)