Add @NonNull to TextView.setText(@NonNull char[], ...)
This has always thrown a NPE since API 1.
Bug: b/227218386
Test: atest android.widget.TextViewTest
Relnote: "TextView.setText(@NonNull char[], ...) added nullability
annotation."
Change-Id: I212bb5b73d00185f83adb5e74d4acd07a1410ca8
TextView.setText(char[]) is from API 1 and follows a running with
scissors API style of not copying the passed array.
To avoid a leak, in TextView.setText(String), the char[] would be nulled
out. However, an internal object could have been read using .getText()
prior to this second setText would immmediatly become a
CharSequence that crashed when you called any methods on it.
After this change, the CharWrapper will stay valid if had been
previously retrieved. The general shape of the API will be maintained.
Fixes: b/227218386
Test: atest android.widget.TextViewTest
Relnote: "Calling TextView.getText() after calling TextView.setText(char[])
will now return a valid CharSequence. The char[] pointed to by this char
sequnece may still be mutated by future calls to setText(char[]), but it
will no longer allow a (char[]) null to be set, which lead to crashes
when reading CharSequence returned from getText on TextView."
Change-Id: I35a2a76d58ec1946dace2f615cacf6a6085efdeb
Bug: 232903223
When a user flings the overscroll toward the scrolling
content, the user might think that any left-over velocity
should apply to scrolling the content. This CL makes that
happen. If the fling is less than the overscroll distance,
then the normal spring is applied.
This CL changes ListView, ScrollView, and HorizontalScrollView.
Test: manual testing and new CTS tests
Change-Id: I1a759377f5183eec805598a6b016515297191624
This is the third step towards deprecating
InputMethodManager#mRequestUpdateCursorAnchorInfoMonitorMode,
which was introduced as a minimum implementation to support
CursorAnchorInfo API in EditText [1].
With this CL, mRequestUpdateCursorAnchorInfoMonitorMode is effectively
deprecated and does nothing except for methods marked with
@UnsupportedAppUsage.
All the remaining valid usages will be handled by the following newly
introduced fields:
- Editor.InputMethodState#mUpdateCursorAnchorInfoMode
- Editor.InputMethodState#mUpdateCursorAnchorInfoFilter
[1]: I3c6b69bd9d79b199afe68d838f25effa6048e5cc
cf8421df856a5950729ff1d0e73f21d480aa98fb
Bug: 236713697
Test: atest CtsInputMethodTestCases:InputMethodServiceTest#testOnUpdateCursorAnchorInfo
Test: atest CtsInputMethodTestCases:StylusHandwritingTest
Change-Id: I9fc930fbe39c3bdf913e3d7012fdd22805564d3b
Use CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE in place of
CAPITALIZATION_FOR_STANDALONE for date formats, since ICU does not
capitalize (at least) month names correctly today according to
https://unicode-org.atlassian.net/browse/ICU-21631. The motivating
example is the DatePicker/SimpleMonthView for Vietnam with "{month}
{year}" (as used in the manual date selection in the Date & Time screen
of the System settings): it does not capitalize the month without this
change.
It's difficult to know which formats will be affected, so this change
modifies all the formats found in frameworks/base/ that currently
express a preference for STANDALONE. The fix may be available by ICU 72,
at which point this change can presumably be reverted as signified in
the TODOs.
Bug: 229287642
Test: Inspection of Date & Time settings + compilation only
Change-Id: Iea753d0318aef55c6dd4f7e09068a0362ac970d8
Text team owns the text related module in widget.
The previous per-file line was not working due to extra spaces between
files list.
Fixed by removing white spaces and also change to refer the text team
OWNERS file.
Bug: 234759754
Test: N/A
Change-Id: I3302de8fd90a12e7745f15d07c8c53c900bb3a14
The text is not selectable while translated. Making translated text
selectable requires many more changes.
This was tested in Nextdoor in the feed/posts activity. When there is a
"Read more" link in the post, the link doesn't work while translated,
and doesn't behave the same way after translation is paused.
Bug: 202966891
Test: atest CtsTranslationTestCases
Test: Manually - with Nextdoor on feed and chat activities
Change-Id: I6e8f532d427d85ff22df0deb248d8416a15f4821
With ag/17952046 we now actively intercept KEYCODE_BACK before they are
sent to IME when new back flow is used. This requires us to migrate
AutoCompleteTextView#onKeyPreIme, and is also what causes the test
failure in b/231960630.
Test: atest AutoCompleteTextView test.
Test: Test back behavior of AutoCompleteTextView in BackTestApp.
Bug: 231960630
Change-Id: I1a5e01c9a4f8f0e762b493284650854a230aecd3
Introduced View#setHandwritingBoundsOffset and xml attributes to
enlarge the view's stylus handwriting bounds. With this API, it's
possible to make handwriting bounds larger than the view's visible
bounds, and makes handwriting easier to trigger.
Bug: 211764956
Test: atest android.view.stylus.HandwritingInitiatorTest
Test: atest android.view.cts.HandwritingBoundsOffsetTest
Change-Id: I7a3749f78df82eee08ad29761cd52d7452114873
This enables handwriting to be started before the input connection is created for custom text editor views which are not EditTexts.
Fix: 218907674
Test: atest CtsInputMethodTestCases:android.view.inputmethod.cts.StylusHandwritingTest
Change-Id: I1ff3b0ffd609e1ec9f1efc477d00fee998ac9966
Right now, when an update is triggered, DateTimeView will trigger a full
relayout of its parents because it always calls setText, even if it
doesn't change the contents (later down the line, TextView will call
requestLayout() for wrap_content, even if size didn't change).
Checking if the content actually changed avoids that extra layout pass
which avoids needless relayouts in e.g. SystemUI Notifications.
Bug:220712538
Test: atest DateTimeView (new test failed before fix / passes after fix)
Change-Id: Ib391d6715136b64b98f0bda3b3d4a3f991809c89
Some TextViews are made as password via input type but does not
contain autofill password hint. This change auto append a hint
for autofill to identify.
Bug: 219844915
Test: atest android.autofillservice.cts.dialog.LoginActivityTest
Change-Id: Ifd18c56ffe788a601821d178ace41413f9e0454e
Because mutability is propagated across Parcel and Binder, any mutable
Bitmaps passed to RemoteViews will end up mutable on the other side
even though those Bitmaps can't be modified from the RemoteViews
recipient.
Make all Bitmaps passed to RemoteViews immutable in order to ensure
that they can be sent without additional copies instead of the one
ashmem object.
Test: TH, RemoteViews work for widgets
Bug: 227920378
Change-Id: I477e7132f9ff78333c1eda56b9d0fc6ac520abd0
Bug: 219968356
Test: In BackTestApp, show popup window and swipe back to close it.
Test: CTS: android.widget.cts.BackInvokedOnWidgetsTest#popupWindowDismissedOnBackGesture
Change-Id: Ic22c12e2ed9f1c961f6e0abfdaf3d2a9a7bd2934