Such resource id is useful to help the autofill service heuristics to figure out
the meaning of the labels without relying on their localized text. For example,
the id could be "username", while the text could be "Nome do usuario".
Test: atest CtsAutoFillServiceTestCases:LoginWithStringsActivityTest
Fixes: 71552872
Change-Id: I13f7080fb3c67f91492a113115ffa43d185d192a
Previously we are comparing the clamped coordinates to avoid
unnecessary update of magnifier content. However if the magnifier is
reaching to the edge of the screen it doesn't update itself because
coordinates passed to Magnifier#show() later are clamped to the same.
This CL compares the coordinates without clamping to fix the issue.
Bug: 70580848
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: manual test with WebView that shows the magnifier works.
Change-Id: I65d681da334d5037a924e733d1a27cfd77231726
EditText#getText assumes the text is editable. However if this is
called during construction, the text might still be a String.
Bug: 36972818
Test: bit CtsWidgetTestCases:.EditTextTest
Change-Id: I811fad057f33666692930cb60d696740f7b40a19
Bug: 70771205
In order to test TextClock being only updated by the 12/24
hour setting, we must disable the clock tick from causing
the text to change. Otherwise whenever the minute changes,
the clock text would update. This leads to a flaky test.
Test: I4917a2296744697f1b50a17e3c5eb5873d567a47
Change-Id: Ifb669af3e6b882eb7c158b7de16e7eb2f0c48f61
By measuring the character widths beforehand, we can save at least 40%
of the StaticLayout construction time which typically happens on UI
thread.
Also verified this doesn't cause performance regression for not
premeasured text.
Raw performance score (Not premeasured -> premeasured, median, N=100)
No Style, Greedy, Hyphenation OFF: 7,812,975 -> 503,245 (-93.6%)
No Style, Balanced, Hyphenation OFF: 7,843,254 -> 396,892 (-95.0%)
No Style, Greedy, Hyphenation ON : 19,134,214 -> 11,658,928 (-39.1%)
No Style, Balanced, Hyphenation ON : 19,348,062 -> 11,634,942 (-39.9%)
Styled, Greedy, Hyphenation OFF: 14,353,673 -> 572,840 (-96.0%)
Raw performance score (w/o patch -> w/ patch, median, N=100):
No Style, Greedy, Hyphenation OFF: 7,732,894 -> 7,812,975 (+1.04%)
No Style, Balanced, Hyphenation OFF: 7,884,510 -> 7,843,254 (-0.52%)
No Style, Greedy, Hyphenation ON : 18,986,958 -> 19,134,214 (+0.78%)
No Style, Balanced, Hyphenation ON : 19,232,791 -> 19,348,062 (+0.60%)
Styled, Greedy, Hyphenation OFF: 14,319,690 -> 14,353,673 (+0.24%)
Bug: 67504091
Test: bit CtsTextTestCases:*
Test: bit CtsGraphicsTestCases:*
Test: bit CtsWidgetTestCases:*
Test: FrameworksCoreTests:android.text.MeasuredTextTest
Change-Id: I0b46f04b42cc012606a9c722eca0d51147a0dcc7
Bug 68016230
Make TextClock only listen for changes to the 12/24
hour clock setting, so that it doesn't trigger a
change when other settings are updated.
Test: I5dee1694890ec90b0eabb939cd636971ed9ba5d4
Change-Id: Ia345995dc2f019209e3c68e6e8681cd2c9d5f439
A signature is a tag that a TextClassifier may use to identify an
object it returned for a given query. This is useful for logging
purposes.
This cl also removes:
- TextClassification.getLogType() and related logging.
This is already covered by selection event logging.
- TextClassification.getVersionInfo(),
TextSelection.getVersionInfo()/getSourceClassifier().
These are now featured in the signature.
TODO: Write a container class that generates and parses signatures.
Bug: 69791269
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I294f7e4d16c98c6512d56d08d488b204c1f91d47
Bug: 68846316
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I84c652cb953f1af9b1c4077fa2a13ae23689c48b
Now before we fire an a11y event we check if this event has an
observer. As a bonus we don't push the state to clients if the
dynamic service config did not change.
Test: cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases
bug:69427760
Change-Id: Ie208e13b8557bb7a120198a43efcb79c2752f5db
* moves the Magnifier from com.android.internal.widget to
android.widget
* removes useless public getters; useless for now because we have
no magnifier configuration but the hardcoded one
Bug: 67839742
Bug: 63531115
Test: bit CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Ie6f474c4c781038650007a15937d61c650ee5fdd
It turns out that the auto-invalidate at a defined time,
practically polling, is not a safe way to update content
and also has more chances of producing poor quality so
temporary bring back update() and keep it hidden as the
plan is to have direct update listeners from the graphics
stack in the near future. This solution works well for
TextView, WebView and Chrome.
Added support for SurfaceView (used by Chrome).
Editor adds an onDrawListener to the TextView's tree observer
which posts to Magnifier update. This makes sure the
absolutely everytime anything changes in the view hierarchy
update() will be posted (after the actual drawing).
Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: If1b858d793c7cc338d23a850051022768a3f1e40
Symptom:
The display position of error popup is incorrect in RTL layout such as
Arabic language.
Root cause:
In LTR layout, a popup window is anchored to the bottom-left corner of
the anchor view. But in RTL layout, it's anchored to the bottom-right.
showError calculates a position for RTL by itself and it gets a wrong
result.
Solution:
Set the base alignment of the error popup to the bottom-left even though
it's in RTL.
Bug: 69402857
Change-Id: Iae099984e6c47feca078658ddc44ab905995fe0d
Added new constants to be used by custom text view implementions, as well
as a special case for non-selectable text that will only become meaningful
once we start logging linkified text.
Bug: 67674199
Test: Tested that there are no regressions in the existing behaviour.
Change-Id: I0167c39bdbde2783f13a8776d6e280aadf55476b
Bug: 64245206
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: I2e985b12865bc3786f25b88bf6738048cc0e05a4
Bug introduced in I56c71450c850e1d8cd80d54d4e17a6390823485f
Bug: 66939160
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Change-Id: I8e9aee8791e2c6ba341015fa3a1c997004e7066a
TextClassifier methods now take a @Nullable Options parameter which
is a container for optional parameters to its methods.
This way, if we need to pass an optional parameter to one of
TextClassifier's methods, we won't have to overload the method.
Instead, we'll introduce a new Options field.
This CL also adds a hidden optional field for suggestSelection.
This is used to make sure that "dark launched" models do not return
new selection indices to clients. Clients e.g. TextView that are
dark-launch aware may use the field to explicitly request for
dark-launch results.
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: Also see I843eadff8a2b674388055364c1f25c8d4ccea771
Change-Id: I58e44451ac8a8e3a5bc3959198447f5549870902
Any "touch" interaction now hides selection (since mouse
doesn't enable touch-mode, this wasn't happening anymore;
also, allowing listview to scroll an actual selection
off-screen would be very involved and risky).
The selector hilight remains (since mouse doesn't enter
touch-mode). This is a new scenario, so this change also
makes sure to hide the selector hilight when it's target
view is scrolled off-screen.
Bug: 67881712
Bug: 67720587
Test: Existing CTS tests still pass. Can now click list items
via mouse even when scrolled. Visually checked that that
selector hilight is not visible if off-screen.
Change-Id: Ia7b0fd7b247e8d9d9e609364a5500717df648fd9
Fixes several issues with the way PendingIntents are being whitelisted
from background check with Notifications. Most visibly, this causes the
whitelisting not to work on Notifications that use the DecoratedContentViewStyle,
but there are some conditions where the whitelisting breaks for regular
notifications too.
- After a Notification is rebuilt with Notification.Builder, the set
of PendingIntents in the notification was not rebuilt.
This broke the whitelisting whenever a PendingIntent is added after
the Notification was already sent once. Workaround for broken platform
releases: always use a fresh Notification object, or clone before
sending.
- Fixes PendingIntent.writePendingIntentOrNullToParcel to invoke the
OnMarshalListener.
This broke whitelisting for any PendingIntents attached to custom
RemoteViews. Workaround for broken platform releases: Also attach
the PendingIntent to the Notification's extras.
- Changes RemoteViews to keep the parcel cookies that were present
during unparceling, such that they can be reapplied when it gets
cloned.
This broke whitelisting for any PendingIntents attached to a
DecoratedContentViewStyle *even if added to extras*. Workaround
for broken platform releases: none.
- Fixes Notification.whitelistToken mistakenly being static.
There's an unlikely race condition where the field could be
overriden with null by an incoming notification right as another
notification is sent out. Workaround for broken platform releases:
none.
Test: runtest -x core/tests/coretests/src/android/app/NotificationTest.java && runtest -x core/tests/coretests/src/android/widget/RemoteViewsTest.java
Bug: 68218899
Change-Id: I02e44040604a1d24422340611ae9e0332a611800
Bug: 68049162
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I831e6933b584a2999f159dc2d80113ea9ba717f8
* removed "scale" from the show(...) API
* made the zoom scale a dimension => the widget is
fully self-configured
* fixed the magnifier not always scaling the content
to the full pop-up window size
Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: Ibf5c571970c8f6bd3cdbc6d46fbe57d08291783c
* due to having to make the API public, drop the
invalidate_by_client strategy in favor of self invalidation
by polling
* in Magnifier#show(...) stop sending screen coordinates in favor
of view coordinates
* UI/UX:
** width from 200dp to 164dp
** fixed the shadow depth (elevation)
** fixed the rounded corners (2dp)
Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: I6451767b0a618c0c4ea396ba3ee3144523dadc57
The host passes an IServiceConnection to the AppWidgetManager which
is used to bind to the RemoteViewsService. This allows the host to
recieve the connection callbacks directly instead of proxying it via
the AppWidgetManager. The host is also responsible for unbinding to
the service.
Bug: 26481160
Test: adb shell \
am instrument -w -e class android.widget.RemoteViewsAdapterTest \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Iac400095a319c3a43714c82fda7516be1ccc68af
Fixes in framework include:
- ListPopupWindow requests focus for itself so it can receive
MENU key.
- PopupWindow uses setTransitionVisibility to avoid losing
focus upon enter transition.
- First-traversal will explicitly handle FOCUS_AFTER_DESCENDANTS
on the current focus if applicable -- details in code comment.
Fixes in tests usually just required focusing what they expected
to have initial focus; however, there were a couple tests that
had been broken for other reasons for a long time.
app.cts.ActionBarTest
app.cts.ToolbarActionBarTest
android.view.DisabledLongpressTest
android.widget.scroll.arrowscroll.ShortButtonsTest
android.view.VisibilityTest
android.widget.listview.ListScrollListenerTest
android.widget.listview.arrowscroll.ListOfThinItemsTest
andorid.widget.listview.arrowscroll.ListWithNoFadingEdgeTest
android.view.LongpressTest
android.widget.focus.ScrollingThroughListOfFocusablesTest
android.widget.gridview.GridScrollListenerTest
Bug: 67467972
Test: Failing tests should pass now.
Change-Id: I9e2fbfeb183eb777f35c67eca53e1f70809b7670