diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java | 26 | ||||
| -rw-r--r-- | core/java/android/widget/SelectionActionModeHelper.java | 4 |
2 files changed, 24 insertions, 6 deletions
diff --git a/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java b/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java index fbf65356f568..c0d621aebd6e 100644 --- a/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java +++ b/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java @@ -60,19 +60,27 @@ public final class SmartSelectionEventTracker { private static final String ZERO = "0"; private static final String TEXTVIEW = "textview"; private static final String EDITTEXT = "edittext"; + private static final String UNSELECTABLE_TEXTVIEW = "nosel-textview"; private static final String WEBVIEW = "webview"; private static final String EDIT_WEBVIEW = "edit-webview"; + private static final String CUSTOM_TEXTVIEW = "customview"; + private static final String CUSTOM_EDITTEXT = "customedit"; + private static final String CUSTOM_UNSELECTABLE_TEXTVIEW = "nosel-customview"; private static final String UNKNOWN = "unknown"; @Retention(RetentionPolicy.SOURCE) @IntDef({WidgetType.UNSPECIFIED, WidgetType.TEXTVIEW, WidgetType.WEBVIEW, WidgetType.EDITTEXT, WidgetType.EDIT_WEBVIEW}) public @interface WidgetType { - int UNSPECIFIED = 0; - int TEXTVIEW = 1; - int WEBVIEW = 2; - int EDITTEXT = 3; - int EDIT_WEBVIEW = 4; + int UNSPECIFIED = 0; + int TEXTVIEW = 1; + int WEBVIEW = 2; + int EDITTEXT = 3; + int EDIT_WEBVIEW = 4; + int UNSELECTABLE_TEXTVIEW = 5; + int CUSTOM_TEXTVIEW = 6; + int CUSTOM_EDITTEXT = 7; + int CUSTOM_UNSELECTABLE_TEXTVIEW = 8; } private final MetricsLogger mMetricsLogger = new MetricsLogger(); @@ -277,6 +285,14 @@ public final class SmartSelectionEventTracker { return EDITTEXT; case WidgetType.EDIT_WEBVIEW: return EDIT_WEBVIEW; + case WidgetType.UNSELECTABLE_TEXTVIEW: + return UNSELECTABLE_TEXTVIEW; + case WidgetType.CUSTOM_TEXTVIEW: + return CUSTOM_TEXTVIEW; + case WidgetType.CUSTOM_EDITTEXT: + return CUSTOM_EDITTEXT; + case WidgetType.CUSTOM_UNSELECTABLE_TEXTVIEW: + return CUSTOM_UNSELECTABLE_TEXTVIEW; default: return UNKNOWN; } diff --git a/core/java/android/widget/SelectionActionModeHelper.java b/core/java/android/widget/SelectionActionModeHelper.java index 71854ae89290..d0ad27af0a92 100644 --- a/core/java/android/widget/SelectionActionModeHelper.java +++ b/core/java/android/widget/SelectionActionModeHelper.java @@ -591,7 +591,9 @@ public final class SelectionActionModeHelper { Preconditions.checkNotNull(textView); final @SmartSelectionEventTracker.WidgetType int widgetType = textView.isTextEditable() ? SmartSelectionEventTracker.WidgetType.EDITTEXT - : SmartSelectionEventTracker.WidgetType.TEXTVIEW; + : (textView.isTextSelectable() + ? SmartSelectionEventTracker.WidgetType.TEXTVIEW + : SmartSelectionEventTracker.WidgetType.UNSELECTABLE_TEXTVIEW); mDelegate = new SmartSelectionEventTracker(textView.getContext(), widgetType); mEditTextLogger = textView.isTextEditable(); mWordIterator = BreakIterator.getWordInstance(textView.getTextLocale()); |
