Loading core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java +21 −5 Original line number Diff line number Diff line Loading @@ -60,8 +60,12 @@ 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) Loading @@ -73,6 +77,10 @@ public final class SmartSelectionEventTracker { 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(); Loading Loading @@ -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; } Loading core/java/android/widget/SelectionActionModeHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -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()); Loading Loading
core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java +21 −5 Original line number Diff line number Diff line Loading @@ -60,8 +60,12 @@ 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) Loading @@ -73,6 +77,10 @@ public final class SmartSelectionEventTracker { 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(); Loading Loading @@ -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; } Loading
core/java/android/widget/SelectionActionModeHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -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()); Loading