diff options
| author | Cary Clark <cary@android.com> | 2009-10-15 15:29:08 -0400 |
|---|---|---|
| committer | Cary Clark <cary@android.com> | 2009-10-15 15:29:08 -0400 |
| commit | 7f97011b550e56e7acb28462b67ac6a35991d135 (patch) | |
| tree | b04ea8007a47eafcb9668d4225ba81c9b133ec25 /core/java/android | |
| parent | badd8399ca803f48ca43658b49c1cdcf0e3ec250 (diff) | |
| download | frameworks_base-7f97011b550e56e7acb28462b67ac6a35991d135.zip frameworks_base-7f97011b550e56e7acb28462b67ac6a35991d135.tar.gz frameworks_base-7f97011b550e56e7acb28462b67ac6a35991d135.tar.bz2 | |
check for native initialization before calling public function
Added more checks where it is possible to call a native function
after creating a WebView but before the native side is initialized.
These cases can be triggered by the monkey.
Fixes http://b/issue?id=2187719
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 916d21e..9798c01 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1721,6 +1721,7 @@ public class WebView extends AbsoluteLayout * as the data member with "url" as key. The result can be null. */ public void requestImageRef(Message msg) { + if (0 == mNativeClass) return; // client isn't initialized int contentX = viewToContentX((int) mLastTouchX + mScrollX); int contentY = viewToContentY((int) mLastTouchY + mScrollY); String ref = nativeImageURI(contentX, contentY); @@ -2339,6 +2340,7 @@ public class WebView extends AbsoluteLayout * @param forward Direction to search. */ public void findNext(boolean forward) { + if (0 == mNativeClass) return; // client isn't initialized nativeFindNext(forward); } @@ -2349,6 +2351,7 @@ public class WebView extends AbsoluteLayout * that were found. */ public int findAll(String find) { + if (0 == mNativeClass) return 0; // client isn't initialized if (mFindIsUp == false) { recordNewContentSize(mContentWidth, mContentHeight + mFindHeight, false); @@ -3477,6 +3480,7 @@ public class WebView extends AbsoluteLayout * @hide */ public void emulateShiftHeld() { + if (0 == mNativeClass) return; // client isn't initialized mExtendSelection = false; mShiftIsPressed = true; nativeHideCursor(); |
