diff options
| author | John Reck <jreck@google.com> | 2012-02-28 11:29:29 -0800 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2012-02-28 11:29:29 -0800 |
| commit | 5528d7ccd1a02798af076ff07717f1f2dab4e11a (patch) | |
| tree | 112617429d7c551768d2f2dd0d81c152e78c51c2 /core/java | |
| parent | f64dfccd96286255fd382486c94cdb48921c45fa (diff) | |
Fix cursorRingBounds NPE
Bug: 6083657
Change-Id: I0aa30bc1df266b2f74b0fedfb635b71d63638fdb
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 86185103c5d5..7f437ce35aa0 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3144,7 +3144,7 @@ public class WebView extends AbsoluteLayout return; } if (nativeHasCursorNode()) { - Rect cursorBounds = nativeGetCursorRingBounds(); + Rect cursorBounds = cursorRingBounds(); if (!cursorBounds.contains(contentX, contentY)) { int slop = viewToContentDimension(mNavSlop); cursorBounds.inset(-slop, -slop); @@ -7541,7 +7541,7 @@ public class WebView extends AbsoluteLayout return false; } if (time - mLastCursorTime <= TRACKBALL_TIMEOUT - && !mLastCursorBounds.equals(nativeGetCursorRingBounds())) { + && !mLastCursorBounds.equals(cursorRingBounds())) { nativeSelectBestAt(mLastCursorBounds); } if (DebugFlags.WEB_VIEW) { @@ -10121,7 +10121,7 @@ public class WebView extends AbsoluteLayout } mInitialHitTestResult = null; mLastCursorTime = time; - mLastCursorBounds = nativeGetCursorRingBounds(); + mLastCursorBounds = cursorRingBounds(); boolean keyHandled = nativeMoveCursor(keyCode, count, noScroll) == false; if (DebugFlags.WEB_VIEW) { @@ -10132,7 +10132,7 @@ public class WebView extends AbsoluteLayout if (keyHandled == false) { return keyHandled; } - Rect contentCursorRingBounds = nativeGetCursorRingBounds(); + Rect contentCursorRingBounds = cursorRingBounds(); if (contentCursorRingBounds.isEmpty()) return keyHandled; Rect viewCursorRingBounds = contentToViewRect(contentCursorRingBounds); // set last touch so that context menu related functions will work @@ -10346,6 +10346,14 @@ public class WebView extends AbsoluteLayout return isEditable; } + // TODO: Remove this + Rect cursorRingBounds() { + if (sDisableNavcache) { + return new Rect(); + } + return nativeGetCursorRingBounds(); + } + private native int nativeCacheHitFramePointer(); private native boolean nativeCacheHitIsPlugin(); private native Rect nativeCacheHitNodeBounds(); |
