In Ibb81fdc9d2ec8ba14914166e408c92a3aad7e312 we disabled the magnifier
for cases when the magnified TextView (or a view above it in the view
hierarchy) was matrix transformed (translated, scaled or rotated).
This CL reenables the magnifier for translated and scaled TextViews. The
translation case was already working.
Bug: 123536409
Bug: 77283509
Test: manual testing
Change-Id: I1a22ff2223fe699c6ac660b5f59510ca1f544ee4
This logs a "view" event for the translate action *once* for each
selection session that involves a foreign language. It logs a "click"
action when the translate action is clicked.
The logged action index will give an indication of whether the translate
action was the primary action (index 0) and thus immediately visible to the
user or whether it was one of the secondary actions (index > 0) and
possibly in the selection toolbar's overflow.
Bug: 123414932
Bug: 120837847
Test: atest core/tests/coretests/src/android/view/textclassifier
Test: atest cts/tests/tests/view/src/android/view/textclassifier
Test: atest android.widget.TextViewTest
Test: atest android.widget.cts.TextViewTest
Test: (MANUAL):
1. Ensure device has an app that supports Intent.ACTION_TRANSLATE
2. Run the following command on the shell: adb logcat -c "TCEventTronLogger"
3. Select some foreign lanugage text in a TextView
4. Click on "Translate" item on the toolbar
5. Observe that the device logs a "view" and a "click" event
6. Repeat 3
7. Click on a different menu item, e.g. "Copy"
8. Observe that the device logs only a "view" event
Change-Id: I36f32459c577cf8f8bcf1e65960c4e6d7ffa5e01
The CL removes the MAX_IN_VIEW type of source bounds, used to define
where the content of the magnifier can be copied from. MAX_IN_VIEW was
not used anywhere, and it is easily replaceable if developers need it:
setting the source bound to MAX_IN_SURFACE and use the View#getWidth()
and View#getHeight() methods to coerce the coordinates passed to the
show() methods.
Bug: 72211470
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I3acaad0ec0c68d3ecaba1e0f5f490889d9ebc949
The CL renames the setZoom method for Magnifier.Builder to
setInitialZoom, since the zoom can be changed after the instance is
created using the Magnifier.setZoom method.
Bug: 120609112
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Ide2508ab49e3f3660aa089876029e351b4cef603
This CL deprecates SuggestionSpan#ACTION_SUGGESTION_PICKED and related
constants [1].
There are multiple security concerns, open questions about
compatibility, and maintainance challanges in this protocol.
IME developers can implement their own suggestion picker UI on top of
CursorAnchorInfo API to achieve safer, should give more flexible UI
options, better security, and better compatibility.
[1]: Ia539de0acf66053e0349daec459d75e36805f6bf
f9f0100862
Fix: 123160396
Test: make -j checkbuild
Change-Id: I6d39e838ae47488055162cd44b5f553f68869b17
This CL introduces a unified way for framework developers to specify
whose components should be interacting with the given TextView. An
important use case is the direct-reply UI notification hosted in
System UI, which always runs as user 0 no matter who is the current
user.
For instance, to let the given EditText interact with user 10's input
methods and spell checkers, you can call setTextOperationUser() as
follows.
editText.setTextOperationUser(UserHandle.of(10));
In this way we can easily propergate the same user ID to other
components such as autofill and text classifer as necessary in the
future.
No one calls TextView#setTextOperationUser() yet hence there should be
no user-visible behavior change.
Bug: 120744418
Bug: 123043618
Test: spell checker still works
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I6d11e4d6a84570bc2991a8552349e8b216b0d139
The CL fixes TextView#setTextCursorDrawable, for the case when a zero
drawable resource id is passed. We want to set a null Drawable, but the
Context#getDrawable(0) call was throwing rather than returning null.
Bug: 122742983
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I45bf57002043d7dbe541d76e61fce3f729959fc8
The shortcut handler for Shift-Delete was added in onKeyShortcut(), but
it's called after onKeyDown() and the event are consumed by
BaseKeyListener before reaching to onKeyShortcut().
Fix: 122079351
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: Ifee0144bdd3c4f0552bc4c4f3e5b844502bc937e
I3801ee8642d277c96c094b7d4155e28fc5bcea87 added public setters and
getter for a TextView's cursor drawable. The setter was expecting a
NonNull Drawable argument. However, this was inconsistent with the
textCursorDrawable attribute which had existed for a long time in
platform. This accepted null, case when a fallback vertical black line
is drawn as a cursor. This CL fixes this inconsistency, by allowing null
Drawables to be set for the cursor.
Also, the CL fixes the preconditions checking resource id arguments to
be strictly positive, while negative resource ids are valid as well.
Bug: 122550166
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: Ia10fafbdc0405968e57b35a615eedaeb9ee80c96
The surface created for the magnifier is larger than the magnifier
content, in order to leave space for drawing the shadow. In
I066082fb17cfb8c483c49b7011abfa9dca9de77a we made the elevation a
customizable property of Magnifier using the Builder class. However, the
buffer allocated for drawing the shadow remained a fixed value,
insufficient for large elevations, when shadows were getting clipped.
This CL fixes this, by making the allocated surface large enough to
accomodate the shadow.
Bug: none
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I462c50510820614dc033a42b347e9672ce39a4c6
This CL:
- renames setForcePositionWithinWindowSystemInsetsBounds to
setClippingEnabled
- improves some of the docs
Bug: 120609112
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I14c774b432b4a0cff96066734758b9f937179d94
Symptom:
When the device language was set to Spanish, "A.M." label was not fully
displayed on the time picker widget. "M." was lacked.
Root cause:
There are unnecessary right paddings on the layout definition of time
picker. It uselessly consumes the room for ampm_layout.
Bug: 64498105
Change-Id: Ie52fafc0fb7d6d6ea5b0ca2eaeb53755d4aebc19
Tracking SurfaceFlinger changes. Now to construct a child surface
we need the SurfaceControl as opposed to just the surface, and so
we parcel the SurfaceControl across relayout.
Test: Manual
Bug: 62536731
Bug: 111373437
Bug: 111297488
Change-Id: I0a034767e92becec63071d7b1e3e71b95d505b77
Also don't show smart actions for selections in text with unsupported
characters.
Bug: 116321860
Test: atest android.view.textclassifier.TextClassificationManagerTest \
android.text.util.cts.LinkifyTest \
android.text.util.LinkifyTest \
android.widget.TextViewActivityTest
Change-Id: I01b5e936aa4dfc937a98f50e9fc8171666861a61
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.
Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.
For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.
Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.
Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.
Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.
For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.
Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.
Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
- Get rid of activity-level events.
- Renamed InteractionSessionId and InteractionContext to
ContentCaptureSessionId and ContentCaptureContext (and made them public)
- Create the explicit concept of ContentCaptureSesssion (and moved notification
APIs to it).
- Added APIs to let apps create new sessions (not implemented yet).
- Added APIs to remove user data based on some context properties (like URI).
The reasoning behind this change is to let app developers explicitly associate
the captured content with some app-level domain (and also let the app ask the
service to clear such data at user's request). For example, a browser app
(and WebView) can use these APIs to associate the content capture events with
the URL being rendered.
Bug: 117944706
Fixes: 121034139
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api && m
Change-Id: I7841da303b6a39c825651b03a07e3081fbd0bdf5
The original purpose is to remove @hide annotation on
TextView.getHorizontallyScrolling, but the function name conflicts
with our API naming convention. So, I created public API
isHorizontallyScrolling instead.
Bug: 117520716
Test: atest TextViewTest
Test: make offline-sdk-docs
Change-Id: I79666c8920cdfcb9dc68ae3701c6599f063df5fd
The text direction can not be fully determined in detached state.
To improve even in that case, compute PrecomputedText from existing
PrecomputedText with new direction.
Here is the performance difference. According to the perf test result,
up to 80% of computation can be recycled from existing PrecomputedText.
android.text.StaticLayoutPerfTest (u sec):
PrecomputedText Greedy NoHyphenation : 371 -> 371: ( +0, +0.0%)
PrecomputedText Greedy NoHyphenation DirDifferent: 6,923 -> 1,437: (-5486, -79.2%)
RandomText Greedy NoHyphenation : 6,633 -> 6,627: ( -6, -0.1%)
On the other hand, this CL increase the memory usage of the
PrecomputedText up to 10%. Here is an reference memory usage.
android.text.PrecomputedTextMemoryUsageTest (bytes):
MemoryUsage
Arabic Hyphenation : 17,135 -> 18,116: ( +981, +5.7%)
Arabic NoHyphenation : 17,135 -> 18,116: ( +981, +5.7%)
CJK Hyphenation : 29,000 -> 31,584: (+2584, +8.9%)
CJK NoHyphenation : 29,000 -> 31,584: (+2584, +8.9%)
Latin Hyphenation : 16,526 -> 17,185: ( +659, +4.0%)
Latin NoHyphenation : 14,200 -> 14,784: ( +584, +4.1%)
Bug: 119312268
Test: atest CtsWidgetTestCases
Test: atest CtsTextTestCases
Test: atest CtsGraphicsTestCases
Test: minikin_tests
Change-Id: Ia02c201afac5d7d1c086a45f15696f39a6b2a76c
Bunch of changes:
- Split public SmartSuggestionsService info ContentCaptureService and
AugmentedAutofillService
- Renamed 'intelligence' packages to either 'contentcapture' or
'autofil.augmented'
- Renamed internal packages and classes.
- Changed permissions, resource names, etc...
- Moved Augmented Autofill logic from IntelligeceManagerService (R.I.P.) to
Autofill.
- Optimized IPCs by passing a String instead of the InteractionSessionId
(that also solves the view -> service dependency).
Test: atest CtsContentCaptureServiceTestCases \
CtsAutoFillServiceTestCases \
FrameworksCoreTests:SettingsBackupTest
Test: manual verification with Augmented Autofill Service
Bug: 119638877
Bug: 117944706
Change-Id: I787fc2a0dbd9ad53e4d5edb0d2a9242346e4652d
A widget can provide a wrong service intent causing the Launcher
to go in a crash loop
Bug: 115533593
Test: Verified on device
Change-Id: I28666d8559fd23a60fbd3f1539f3b3126a0fa62d
The CL adds public getter and setters for the drawable used for the
cursor of a TextView.
Bug: 117521190
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I3801ee8642d277c96c094b7d4155e28fc5bcea87
Inline image will consume 3x memory due to no cache implementation.
This patch apply cache mechanism to each ExpandableNotificationRow and
preloads images before inflation task.
Bug: 77956056
Test: runtest systemui, observe memory usage by AndroidProfiler
Change-Id: I2c488b1d98ddf2d4670904ed4b3e8028c0d0172e
This name is too generic, so we split it in 2 parts:
- ContentCaptureManager: the public API used by views and apps to report their
structure.
- SmartSuggestionsServiec: the system service use to consume these events and
provide autofill suggestions.
This CL also:
- Optimizes ContentCaptureManager allocation so they are not created on contexts that are not
capturing events (such as views from the system server).
- Uses a generic ContentCaptureEventsRequest (rather than a list of events) to make it easier
to be extended.
- Fixed IntelligencePerUserService so it clears the sessions when the
implementation changes.
Test: manual verification
Bug: 119776618
Bug: 117944706
Bug: 119638877
Change-Id: I069bcd23dda94afe18b2781fd3981b8b555afa56
There is unsupported access to the divider. Exposing the
drawable will be tricky as the widget counts on the drawable
being a certain shape and have certain attributes. However we can
easily expose the thickness as a new attribute and document that
you can customize the divider color via XML.
Bug: 117520784
Test: atest NumberPickerTest (with new test)
Change-Id: Ib7a65c055df3b1f68c8327943fa887c89f57e00c