Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42fb4558 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Fix cursorRingBounds NPE"

parents c2baeffe 5528d7cc
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -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);
@@ -7545,7 +7545,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) {
@@ -10125,7 +10125,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) {
@@ -10136,7 +10136,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
@@ -10350,6 +10350,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();