An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes. (So an improvement in
both cases!)
Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.
This is a purely mechanical refactoring with no functional changes.
Bug: 154436100
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ia9e581efd7c40269342b7528ca07363deb843c0f
Using "menu" was ambiguous since ACTION_PROCESS_TEXT is also triggered
via the menu but has its own enum value.
Bug: 152068298
Bug: 154151141
Test: ran tests
atest CtsWidgetTestCases:TextViewRichContentReceiverTest
Change-Id: I3805577e9d7bbf55d40339d37820cd7f510da37e
When user types some text and then long presses on end of empty area
to open context menu, if user opens Gboard and selects text from the
reverse direction, SelectionEnd will be less than SelectionStart. The
IllegalArgumentException occurred because TextClassification does not
allow SelectionEnd is less than SelectionStart. We swap the start and
end index if end index is less than start index.
Bug: 150916165
Test: Manual. No crash occurs.
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e
- First touch on TextView blocks secondary touches on handles.
- First touch on handles blocks later touches on TextView but doesn't block secondary touches on other handles.
Bug: 150995597
Test: manually tested & automation tests:
atest FrameworksCoreTests:EditorCursorDragTest
atest FrameworksCoreTests:TextViewActivityTest
Change-Id: I7717fc061fc81514fc1dad0d3acbc73e683516cf
RemoteViews is public API used out of scope of widget. The correct place
to call noteAppWidgetTapped is in AppWidgetHostView.
Fix: 153676411
Test: manual test, tap a widget, "adb shell dumpsys usagestats | grep
USER_INTERACTION" to oberserve USER_INTERACTION event sent to UsageStas, "adb shell dumpsys appops | grep appWidgetVisible" to observer appWidgetVisible flag.
Change-Id: Ic473211b91fd952dbb81b09b1e1568d6f69a0dd8
documentation to refer to BlendMode.SRC_IN
instead of PorterDuff.Mode.SRC_IN
Fixes: 151952140
Test: N/A
Change-Id: Ie4b9a585c2dae49e633f6741180b6749493d069a
documentation to refer to BlendMode.SRC_IN
instead of PorterDuff.Mode.SRC_IN
Fixes: 151952140
Test: N/A
Change-Id: Ie4b9a585c2dae49e633f6741180b6749493d069a
Generally, the button's text is displayed next to the check box, but
Sound Settings uses its own views to display the text, distinct from
RadioGroup and RadioButton. This results in TalkBack announcing out
of list state too early, since the text content is not considered
part of the collection.
Add a check to exclude buttons with no text when counting the children
to be in the collection. Developers should be either setting the button
text or implementing their own views to appear alongside the buttons.
Bug: 149064784
Test: Added CTS test. Manual testing of Settings -> Sound -> Do no
disturb -> Advanced -> Set Duration for Quick Settings
Change-Id: Ie9abe4cccc4ab53e79a583b9a2ce45535dcf1cc0
Text toasts don't currently support multi-user. This CL prepares toasts
for multi-user by wiring the user information from who requested the
toast (in the form of uid) to ToastUI, where text toasts are actually
rendered.
We go only as far as obtaining a new user-specific context for that user
and using that to construct the view. Actual support will come in future
CLs.
Bug: 151414297
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
ToastWindowTest ToastUITest NotificationManagerServiceTest
LegacyToastTest
Change-Id: I8c92453c6a2b73c31f9a41ca9ff463d194d4f44f
In order to support multi-user, we need to create a new context based on
the user id and retrieve the services from it
(http://b/151414297#comment9). This meant retrieving the services in
ToastUI.showToast() instead of on its constructor, which would make the
code diverge from Toast$TN.handleShow(). In order to avoid that, now
seemed a good time to refactor ToastPresenter to perform show() and
hide().
This means ToastPresenter will now be instantiated in every request for
a new toast in ToastUI, but fortunately with the refactor we were able
to get rid of ToastEntry (which was also beign instantiated in every
request).
Also found out a bug with this where window tokens were being used to
locate the toasts instead of the (non-window) tokens. This is a bit
confusing because the method NM.finishToken(package, token) receives a
non-window token to locate the ToastRecord and then finish its window
token. This didn't have any side-effects because NM itself finishes the
tokens after a time-out. Added a test for this.
Bug: 152973950
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
ToastWindowTest ToastUITest NotificationManagerServiceTest
LegacyToastTest
Change-Id: I13cf18890ca22022adb7576c8ecf3285a9b82299
The new callback provides a single API that apps can implement to
support the different ways in which rich content may be inserted.
The API is added to TextView and unifies the following code paths:
* paste from the clipboard (TextView.paste)
* content insertion from the IME (InputConnection.commitContent)
* drag and drop (Editor.onDrop)
* autofill (TextView.autofill)
Corresponding API in support lib: aosp/1200800
Bug: 152068298
Test: Manual and unit tests
atest FrameworksCoreTests:TextViewRichContentReceiverTest
atest FrameworksCoreTests:AutofillValueTest
atest FrameworksCoreTests:TextViewActivityTest
Change-Id: I6e03a398ccb6fa5526d0a282fc114f4e80285099
Old APIs are kept and marked as @hide + @removed to maintain
compatibility.
Bug: 151262653
Test: manual verification
Change-Id: Ia50a1f87c194211be5256e948d43fb54c1cbf941
Also applies the max/min damping range for slop.
The max/min damping range includes lineHeight + slop.
Note: slop must >= zero.
Bug: 150531840
Test: manual & automated tests
atest FrameworksCoreTests:EditorCursorDragTest
atest FrameworksCoreTests:TextViewActivityTest
Change-Id: I26cdf69fd2cf7d4514dd2a902ed34c480c9e8781
Gate background custom toast block on targetSdk for beta 1, after
having gathered dogfood feedback. So, enabling the change for apps with
targetSdk > Q (>= R). Also removed warning toast.
Added tests in topic CL to cover all the cases.
Bug: 144152069
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
Change-Id: If368a97a2a8ff56770635615f89c79007bb27075
Text was ambiguous and could mean callback object construction instead
of toast construction.
Test: Builds
Bug: 144152069
Change-Id: I06160de2b85f339517ae45d3bd4cc1098f433ef0
When the app widget on the launcher is tapped on:
1. Update AppOps. AppOps treats the underlying app as foreground so the app can get while-in-use
permission.
2. Report a USER_INTERACTION event to UsageStats so UsageStats can
update mLastTimeUsed and mLastTimeVisible of this package.
Bug: 149043079
Test: manual test, tapped on a widget.
Change-Id: Ic8c91190881cf5dcf89f0f72cfd410b0c2e86bf6