OSDN Git Service

Increase the duration allowed for a TC result.
authorAbodunrinwa Toki <toki@google.com>
Wed, 27 Sep 2017 01:38:55 +0000 (02:38 +0100)
committerAbodunrinwa Toki <toki@google.com>
Fri, 29 Sep 2017 20:41:54 +0000 (21:41 +0100)
commitbe60f06a1beb4f1f8050dc975e76232cc9bde652
treeec1d89ed9748eb5f2b1b87b33d4495ffb56c646d
parent6e326268c1ea76a3a47531a33b29a262be2da646
Increase the duration allowed for a TC result.

Increase the duration allowed for a TextClassifier (TC) result when
it is being initialized for the first time.
Initialization typically takes more time that other calls to the TC.
A timeout during initialization means the user doesn't see the
effect of running the TC the first time. Subsequent calls typically
work fine as they're less likely to timeout.
We increase this value only slightly because we don't want the user
waiting too long for a slow TC's result. Finding the right balance
is an art and most likely depends on the TC being used.

Note that although a TextView's TC can change for each individual
call to the TC, such a situation does not benefit from the bump in
the timeout. Again, we really want to discourage larger timeouts.

Fixes: 66217281
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: Manual test:
  - Delayed TextClassifier response by about 150ms (allowing only 50ms for initialization)
  - Before cl: Sometimes the result is not shown to the user the
    first time the textclassifier runs
  - After cl: Results consistently show for even for first
    textclassifier call
Merged-In: Iabc8279fa57ef6a9a2db0c7e9c7e3ab8c131bf02
Change-Id: Iabc8279fa57ef6a9a2db0c7e9c7e3ab8c131bf02
core/java/android/widget/SelectionActionModeHelper.java