OSDN Git Service

Fix smart_linkify_enabled flag.
authorAbodunrinwa Toki <toki@google.com>
Fri, 16 Mar 2018 21:08:50 +0000 (21:08 +0000)
committerAbodunrinwa Toki <toki@google.com>
Thu, 22 Mar 2018 19:25:14 +0000 (19:25 +0000)
commit6563833cf3c79e8cd211e32357422ae899674437
tree3a9acbb9a93519b503cc6ec2c9c54e4d84b59dfa
parent3912a7f54466f258c5b2597eebdb54cfe0f8281c
Fix smart_linkify_enabled flag.

The flag should only ensure that smart linkify calls behave in the
legacy way instead of totally disabling linkify.
Also, to keep the flag consistent with smart_selection_enabled and
smart_text_share_enabled flags, the flag should only disable the
SmartLinkify (i.e. Linkify.addLinksAsync) feature not TextClassifier
APIs (i.e. TextClassifier.generateLinks).

Also fixes issue with non-focusable TextViews by firing the primary
action instead of showing the floating toolbar. (b/73156794)

Bug: 75967597
Bug: 73156794
Test: bit FrameworksCoreTests:android.text.util.LinkifyTest
Test: bit CtsTextTestCases:android.text.util.cts.LinkifyTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: manual - checked behaviour turning flag on/off
Test: manual - checked behaviour with TextView.setFocusableInTouchMode(true/false)
Change-Id: I541f60161b9cd63ce7e57235607500f2fb0841e7
core/java/android/text/util/Linkify.java
core/java/android/view/textclassifier/SystemTextClassifier.java
core/java/android/view/textclassifier/TextClassification.java
core/java/android/view/textclassifier/TextClassifier.java
core/java/android/view/textclassifier/TextClassifierImpl.java
core/java/android/view/textclassifier/TextLinks.java
core/java/android/widget/SelectionActionModeHelper.java
core/java/android/widget/TextView.java
core/tests/coretests/src/android/text/util/LinkifyTest.java