From f9a81f352ea7819793387202ce6894cc97df5b6f Mon Sep 17 00:00:00 2001 From: Abodunrinwa Toki Date: Tue, 31 Jan 2017 17:48:45 +0000 Subject: Ignore smart selection for multi-word selections. Test: See: Ic273fd68f300671d8e7c0dabe4a3ae9470056fcc Bug: 34831428 Bug: 34778597 Bug: 34778381 Change-Id: Ib15828996081a72f02f5075acac1f2f6c51d3601 --- core/java/android/widget/Editor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index f7f9a81e45c1..c1834f1b79ff 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -1984,12 +1984,12 @@ public class Editor { if (mRestartActionModeOnNextRefresh) { // To avoid distraction, newly start action mode only when selection action // mode is being restarted. - startSelectionActionMode(getTextClassifierInfo(true)); + startSelectionActionMode(null); } } else if (selectionController == null || !selectionController.isActive()) { // Insertion action mode is active. Avoid dismissing the selection. stopTextActionModeWithPreservingSelection(); - startSelectionActionMode(getTextClassifierInfo(true)); + startSelectionActionMode(null); } else { mTextActionMode.invalidateContentRect(); } @@ -5496,8 +5496,9 @@ public class Editor { resetDragAcceleratorState(); if (mTextView.hasSelection()) { - // TODO: Do not invoke the text assistant if this was a drag selection. - startSelectionActionMode(getTextClassifierInfo(true)); + // Do not invoke the text assistant if this was a drag selection. + startSelectionActionMode( + mHaventMovedEnoughToStartDrag ? getTextClassifierInfo(true) : null); } break; } -- cgit v1.2.3-59-g8ed1b