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

Commit 6df95fa0 authored by Mihai Popa's avatar Mihai Popa Committed by Android (Google) Code Review
Browse files

Merge "Fix crash after smart selection animation" into pi-dev

parents 31ec3929 6748ff37
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -284,7 +284,12 @@ public final class SelectionActionModeHelper {
            @Nullable SelectionResult result) {
        final Layout layout = mTextView.getLayout();

        final Runnable onAnimationEndCallback = () -> startSelectionActionMode(result);
        final Runnable onAnimationEndCallback = () -> {
            if (result.mStart >= 0 && result.mEnd <= getText(mTextView).length()
                    && result.mStart <= result.mEnd) {
                startSelectionActionMode(result);
            }
        };
        // TODO do not trigger the animation if the change included only non-printable characters
        final boolean didSelectionChange =
                result != null && (mTextView.getSelectionStart() != result.mStart