Skip to content

Commit cc2264f

Browse files
committed
Fix bug 5309557 - Monkeys and SIGSEGV do not mix!
Make sure that the native component of WebView has been initialized before any native-level optimization involving window focus occurs. Change-Id: I24ca5fe21657aeb1a1faf5bc36fba5ea11064f86
1 parent 7a685e8 commit cc2264f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/webkit/WebView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5573,15 +5573,15 @@ public void onWindowFocusChanged(boolean hasWindowFocus) {
55735573
setActive(hasWindowFocus);
55745574
if (hasWindowFocus) {
55755575
JWebCoreJavaBridge.setActiveWebView(this);
5576-
if (mPictureUpdatePausedForFocusChange) {
5576+
if (mPictureUpdatePausedForFocusChange && mNativeClass != 0) {
55775577
WebViewCore.resumeUpdatePicture(mWebViewCore);
55785578
nativeSetIsScrolling(false);
55795579
mPictureUpdatePausedForFocusChange = false;
55805580
}
55815581
} else {
55825582
JWebCoreJavaBridge.removeActiveWebView(this);
55835583
final WebSettings settings = getSettings();
5584-
if (settings != null && settings.enableSmoothTransition() &&
5584+
if (settings != null && settings.enableSmoothTransition() && mNativeClass != 0 &&
55855585
mWebViewCore != null && !WebViewCore.isUpdatePicturePaused(mWebViewCore)) {
55865586
WebViewCore.pauseUpdatePicture(mWebViewCore);
55875587
nativeSetIsScrolling(true);

0 commit comments

Comments
 (0)