diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index f9c964158e2e9..54c0d7c9af32f 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -12617,7 +12617,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (start >= 0 && start <= end && end <= text.length()) { requestFocusOnNonEditableSelectableText(); Selection.setSelection((Spannable) text, start, end); - hideAccessibilitySelectionControllers(); + // Make sure selection mode is engaged. + if (mEditor != null) { + mEditor.startSelectionActionModeAsync(false); + } return true; } } @@ -13760,12 +13763,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener Selection.removeSelection((Spannable) text); } // Hide all selection controllers used for adjusting selection - // since we are doing so explicitly by other means and these + // since we are doing so explicitlty by other means and these // controllers interact with how selection behaves. - hideAccessibilitySelectionControllers(); - } - - private void hideAccessibilitySelectionControllers() { if (mEditor != null) { mEditor.hideCursorAndSpanControllers(); mEditor.stopTextActionMode();