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
This commit is contained in:
Adam Powell
2011-09-13 16:11:29 -07:00
parent 7a685e8911
commit cc2264fe47

View File

@@ -5573,7 +5573,7 @@ public class WebView extends AbsoluteLayout
setActive(hasWindowFocus);
if (hasWindowFocus) {
JWebCoreJavaBridge.setActiveWebView(this);
if (mPictureUpdatePausedForFocusChange) {
if (mPictureUpdatePausedForFocusChange && mNativeClass != 0) {
WebViewCore.resumeUpdatePicture(mWebViewCore);
nativeSetIsScrolling(false);
mPictureUpdatePausedForFocusChange = false;
@@ -5581,7 +5581,7 @@ public class WebView extends AbsoluteLayout
} else {
JWebCoreJavaBridge.removeActiveWebView(this);
final WebSettings settings = getSettings();
if (settings != null && settings.enableSmoothTransition() &&
if (settings != null && settings.enableSmoothTransition() && mNativeClass != 0 &&
mWebViewCore != null && !WebViewCore.isUpdatePicturePaused(mWebViewCore)) {
WebViewCore.pauseUpdatePicture(mWebViewCore);
nativeSetIsScrolling(true);