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

Commit 0dd93ab0 authored by Seigo Nonaka's avatar Seigo Nonaka Committed by Automerger Merge Worker
Browse files

Merge "Retruns true for hasSelection in reversed selection case" into udc-dev...

Merge "Retruns true for hasSelection in reversed selection case" into udc-dev am: aa935687 am: 000861a9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22891120



Change-Id: I83e5a6579dbbc1b6fc76603afb5e8eb626ee4471
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 138998b8 000861a9
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -11808,8 +11808,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    public boolean hasSelection() {
        final int selectionStart = getSelectionStart();
        final int selectionEnd = getSelectionEnd();
        final int selectionMin;
        final int selectionMax;
        if (selectionStart < selectionEnd) {
            selectionMin = selectionStart;
            selectionMax = selectionEnd;
        } else {
            selectionMin = selectionEnd;
            selectionMax = selectionStart;
        }
        return selectionStart >= 0 && selectionEnd > 0 && selectionStart != selectionEnd;
        return selectionMin >= 0 && selectionMax > 0 && selectionMin != selectionMax;
    }
    String getSelectedText() {