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

Commit da188fbe authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Fix for bug 4499752 - Detect nulled layouts in HandleViews"

parents fe6dfd50 d4bb0b01
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -213,7 +213,8 @@ public class WordIterator implements Selection.PositionIterator {

    private void checkOffsetIsValid(int offset) {
        if (offset < 0 || offset > mCurrent.length()) {
            final String message = "Valid range is [0, " + mCurrent.length() + "]";
            final String message = "Invalid offset: " + offset +
                    ". Valid range is [0, " + mCurrent.length() + "]";
            throw new IllegalArgumentException(message);
        }
    }
+7 −0
Original line number Diff line number Diff line
@@ -9163,6 +9163,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        public abstract void updatePosition(float x, float y);

        protected void positionAtCursorOffset(int offset) {
            // A HandleView relies on the layout, which may be nulled by external methods.
            if (mLayout == null) {
                // Will update controllers' state, hiding them and stopping selection mode if needed
                prepareCursorControllers();
                return;
            }

            addPositionToTouchUpFilter(offset);
            final int line = mLayout.getLineForOffset(offset);
            final int lineBottom = mLayout.getLineBottom(line);