summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2009-10-15 15:29:08 -0400
committerCary Clark <cary@android.com>2009-11-06 10:29:30 -0500
commit4e9fe62b37878750125a0eef679e2ea6216bd8f5 (patch)
treee4ff9aa7b59efb545ed38351c012602f2e27ab57 /core
parent8b1243e5e4930598e8e78ebd18e7b6cd6fb0445f (diff)
downloadframeworks_base-4e9fe62b37878750125a0eef679e2ea6216bd8f5.zip
frameworks_base-4e9fe62b37878750125a0eef679e2ea6216bd8f5.tar.gz
frameworks_base-4e9fe62b37878750125a0eef679e2ea6216bd8f5.tar.bz2
do not merge -- original checkin to mr2 here:
https://android-git.corp.google.com/g/#change,30204 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')
-rw-r--r--core/java/android/webkit/WebView.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index fe91229..06c70ca 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -1713,6 +1713,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);
@@ -2331,6 +2332,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);
}
@@ -2341,6 +2343,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);
@@ -3431,6 +3434,7 @@ public class WebView extends AbsoluteLayout
* @hide
*/
public void emulateShiftHeld() {
+ if (0 == mNativeClass) return; // client isn't initialized
mExtendSelection = false;
mShiftIsPressed = true;
nativeHideCursor();