Commit Graph

9381 Commits

Author SHA1 Message Date
Treehugger Robot
bef30a8056 Merge "Update OWNERS for RemoteViews related files." am: 00545d0fd6 am: ea4b4e5a83 am: 4e5571fd30 am: 82812dd066
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2180621

Change-Id: I0ade83d702a47dd3ec12d08a01d5104e80085070
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 18:24:35 +00:00
Treehugger Robot
ea4b4e5a83 Merge "Update OWNERS for RemoteViews related files." am: 00545d0fd6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2180621

Change-Id: I4beccbf68d0b3b841b2e629be2a5f2662fe90f42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 17:07:04 +00:00
Mihir Patel
f333fa0c93 Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev am: 25192d7d0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19054708

Change-Id: I6b8ffade431d057334147ae9cd5386afbad13cbc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 17:41:15 +00:00
Mihir Patel
25192d7d0c Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev 2022-08-10 16:35:13 +00:00
TreeHugger Robot
9c1576da1c Merge "RemoteViews: fix BitmapCache after immutable Bitmap switch" into tm-qpr-dev am: fe195e6f74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19450080

Change-Id: I7ea562c9433a85dcad6cb3241954140dcb8905b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 04:34:20 +00:00
TreeHugger Robot
fe195e6f74 Merge "RemoteViews: fix BitmapCache after immutable Bitmap switch" into tm-qpr-dev 2022-08-10 04:13:07 +00:00
Pinyao Ting
8767364abf Update OWNERS for RemoteViews related files.
Change-Id: I50719c5d5b19f0d5fd542a94726221b165020860
2022-08-09 23:40:35 +00:00
Mihir Patel
a6e0f74c90 Reporting the Autofill IDs and Positions of active views in list view
Test: atest CtsContentCaptureServiceTestCases, observed events reported only once on scroll and stop as well as on fling
Bug: 211899037
Change-Id: Id67fcc360bf63fcab1d9f345c31d2bf7b9a173d6
2022-08-09 15:37:50 -07:00
Sunny Goyal
b4b25e4f9e Merge "Wrapping various apply parameters into a separate class" into tm-qpr-dev am: b4b3a8bdeb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19531583

Change-Id: I1c24d06db68910c8a99028eca57b233c7e6c5b0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 16:39:36 +00:00
Sunny Goyal
6224d07127 Wrapping various apply parameters into a separate class
> This would allow us to easily extect the options
> Also passing the executor for async inflation. This will allow
  containing adapters to also be async if the parent View is using
  async inflation

Bug: 202766048
Test: Presubmit
Change-Id: I60a9b5db5f9b5f8d6e56521ee00de4be30decce6
2022-08-05 14:53:00 -07:00
Tim Murray
c930727226 RemoteViews: fix BitmapCache after immutable Bitmap switch
Test: widgets appear correctly
Bug: 237256275

Change-Id: I864ac1ba8ac771c326dc215ae4e712ceb0b6057b
2022-07-27 17:45:14 +00:00
Yi-an Chen
89e8a943d8 Merge "Add PbA branding to clipboard" into tm-qpr-dev am: 2b04393a1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19152769

Change-Id: I5e965626328b0d60f67ff43094f38e28304287c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-25 16:25:47 +00:00
Yi-an Chen
2b04393a1d Merge "Add PbA branding to clipboard" into tm-qpr-dev 2022-07-25 16:08:26 +00:00
Sean McQuillan
cd4d5991b2 Merge "Don't crash after unsetting char[] in TextView" into tm-qpr-dev am: 469768f559
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19340644

Change-Id: Id975fe1ef50e8bab6a0ac851eab071b3f246c2ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-20 16:22:58 +00:00
Yi-an Chen
edfc44079c Add PbA branding to clipboard
Bug: 213357911

Test: Manually on Raven
Change-Id: If9944393fe64c7f94a5be139a538833d91ae98fe
2022-07-19 13:52:13 -07:00
Sean McQuillan
81cde0b584 Don't crash after unsetting char[] in TextView
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."

Merged-In: I35a2a76d58ec1946dace2f615cacf6a6085efdeb

Change-Id: I35a2a76d58ec1946dace2f615cacf6a6085efdeb
(cherry picked from commit 166c7217f4)
2022-07-19 20:38:10 +00:00
TreeHugger Robot
3c7b2c3fe0 Merge "Explain the difference between setBreakStragegy() and setLineBreakStyle() in API doc" into tm-dev am: 2b868683ad am: 4e9b6a3839 am: e0d6f903b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18769766

Change-Id: I530759c97e64b8be4254b411b1e9021857db3d64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 07:50:25 +00:00
TreeHugger Robot
6ff694f3cc Merge "Explain the difference between setBreakStragegy() and setLineBreakStyle() in API doc" into tm-dev am: 2b868683ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18769766

Change-Id: If473607c0c66734e62805e398be3fee2a1f08558
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 06:21:25 +00:00
allenwtsu
289d576548 Explain the difference between setBreakStragegy() and setLineBreakStyle() in API doc
Bug: 217951279
Test: build pass
Change-Id: Ida98327a656edc4878f7ce1c7f2bc99b72cd91d6
2022-06-07 13:06:52 +08:00
Treehugger Robot
9942758628 Merge "Fix owner files in text components in the widget directory" am: 5078370e5f am: a375a95fd4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2115546

Change-Id: I275376ed1252beb7bb26d27de6d435c5c2760407
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 23:21:20 +00:00
Treehugger Robot
a375a95fd4 Merge "Fix owner files in text components in the widget directory" am: 5078370e5f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2115546

Change-Id: I10ff5646a9168fa2a4737a680fd539bf8a3b4b60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 22:53:37 +00:00
Seigo Nonaka
fa29f96603 Fix owner files in text components in the widget directory
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
2022-06-03 21:16:55 +00:00
Mark Punzalan
6758b3f7e7 Translate selectable TextViews by temporarily disabling selectable.
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
2022-05-25 20:03:10 +00:00
Shan Huang
7caa2c1c6b Migrate AutoCompleteTextView to use OnBackInvokedDispatcher.
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
2022-05-18 19:08:59 +00:00
Lucas Dupin
06ac74c54f Merge "Don't trigger full relayout if DateTimeView doesn't change" into tm-dev 2022-04-22 15:21:23 +00:00
Tim Murray
e9a0acdfda Merge "RemoteViews: make bitmaps immutable" into tm-dev 2022-04-21 18:32:21 +00:00
Jernej Virag
8d056ab409 Don't trigger full relayout if DateTimeView doesn't change
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
2022-04-21 11:56:42 +00:00
TYM Tsai
2ab23eed06 Merge "Auto append password hint for TextView" into tm-dev 2022-04-21 08:13:10 +00:00
TYM Tsai
1f5c147eb5 Auto append password hint for TextView
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
2022-04-20 03:55:33 +08:00
Tim Murray
21a8baaeb1 RemoteViews: make bitmaps immutable
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
2022-04-18 18:36:02 +00:00
Vadim Caen
a2173652a0 Migrate PopupWindow to use OnBackInvokedDispatcher
Bug: 219968356
Test: In BackTestApp, show popup window and swipe back to close it.
Test: CTS: android.widget.cts.BackInvokedOnWidgetsTest#popupWindowDismissedOnBackGesture
Change-Id: Ic22c12e2ed9f1c961f6e0abfdaf3d2a9a7bd2934
2022-04-04 16:02:38 +02:00
Vadim Caen
d0923a2197 Merge "Split animation methods out of OnBackInvokedCallback" into tm-dev 2022-04-01 20:13:30 +00:00
Vadim Caen
c627777dda Split animation methods out of OnBackInvokedCallback
This makes OnBackInvokedCallback SAM compatible

Bug: 227789359
Test: atest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationLegacyTest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationTests \
        WmTests:com.android.server.wm.BackNavigationControllerTests \
        FrameworksCoreTests:android.window.BackNavigationTest \
        FrameworksCoreTests:android.window.WindowOnBackInvokedDispatcherTest \
        CtsViewTestCases:android.view.cts.OnBackInvokedDispatcherTest
Change-Id: Iab86b0488f1b3048eb02042191acaeb6a645a0bc
2022-04-01 20:09:26 +00:00
Sally Yuen
b9d928eae3 Merge "Revert "Fixes for a11y selection". Reverts hiding some selection UI" into tm-dev 2022-04-01 18:14:37 +00:00
TYM Tsai
e6ae224102 Merge "Make TextView do not show IME when fill dialog popup" into tm-dev 2022-03-31 14:09:17 +00:00
Sally Yuen
8021a8fb09 Revert "Fixes for a11y selection". Reverts hiding some selection UI
This reverts commit 55022a5880.

Reason for revert: b/226418848
Test: builds

Change-Id: Id709d131754e14a67805ee981bc5ad0bc759121f
2022-03-30 22:12:57 +00:00
Shan Huang
116b6300d0 Merge "Migrate MediaController to use OnBackInvokedDispatcher" into tm-dev 2022-03-24 18:14:27 +00:00
Joanne Chung
8121a43efd Merge "Fix the translation not work if the animation is off" into tm-dev 2022-03-24 13:15:40 +00:00
Shan Huang
1506886e06 Merge "Migrate TextView to use OnBackInvokedDispatcher." into tm-dev 2022-03-24 07:41:49 +00:00
Presubmit Automerger Backend
fd025bac1b [automerge] Fix the translation not work if the animation is off 2p: 880a59217d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17312465

Bug: 215386127
Change-Id: I21f5af8a13b89c2e68441cae002ee6b297bf051d
Merged-In: Id0d02c422100effcf842209971052f4d6e9b0bd2
2022-03-24 07:20:13 +00:00
Joanne Chung
880a59217d Fix the translation not work if the animation is off
The system will show translation after the animation is done but it
doesn't work if the animation is off. To fix the issue, we will
check the animation status before showing translation.

Bug: 215386127
Test: atest testUiTranslationWithoutAnimation

Change-Id: Id0d02c422100effcf842209971052f4d6e9b0bd2
Merged-in: Id0d02c422100effcf842209971052f4d6e9b0bd2
2022-03-24 15:19:05 +08:00
Joanne Chung
fe6fddb4f0 Fix the translation not work if the animation is off
The system will show translation after the animation is done but it
doesn't work if the animation is off. To fix the issue, we will
check the animation status before showing translation.

Bug: 215386127
Test: atest testUiTranslationWithoutAnimation

Change-Id: Id0d02c422100effcf842209971052f4d6e9b0bd2
2022-03-24 14:55:15 +08:00
Shan Huang
76561c0ce8 Migrate TextView to use OnBackInvokedDispatcher.
The OnBackInvokedCallback will be called when an app is requesting the new back dispatch behavior. Otherwise we keep dispatching KEYCODE_BACK to TextViews.

Test: Use backTestApp WidgetTestsActivity. Try selecting texts and
dimisss selection by swiping back. Both on TextView and EditText and
AutoCompleteTextView.

Change-Id: I9422f28ab650c5d77c75394fe6dcf2a3981f79c7
2022-03-23 22:37:40 +00:00
Shan Huang
18eec9cf40 Migrate MediaController to use OnBackInvokedDispatcher
The OnBackInvokedCallback will be called when an app is requesting the new back dispatch behavior. Otherwise we keep dispatching KEYCODE_BACK to MediaController.

Test: In BackTestApp, try dismissing media controller by swiping back, both in new and legacy back dispatch.

Change-Id: I9ad3c199277838639c875c78a3a8dfb0963b3ca4
2022-03-23 22:33:36 +00:00
TYM Tsai
8f502801e1 Make TextView do not show IME when fill dialog popup
Make to show fill dialog only if IME is not showing. And if the field
will show fill dialog, ignore to show ime when clicks on the field.

Bug: 210926084
Test: Manual
  launch sample and click on password field -> show fill dialog
  click on username field (no fill dialog) -> show fill UI and IME
  IME is showing and click on password field -> show fill UI
Test: atest android.autofillservice.cts.dialog.LoginActivityTest
Test: atest android.widget.cts.EditTextTest
Change-Id: I6080510d87c50969d85fd9ed746ceba7e3c1c685
2022-03-23 15:02:12 +08:00
Sally Yuen
8c3314f7aa Merge "Fixes for a11y selection" into tm-dev 2022-03-22 20:15:13 +00:00
Haoyu Zhang
b989691d71 Scribe in View: disable cursor drag when handwriting is enabled
Bug: 224587325
Test: manually tested
Change-Id: I607c0d9b71cb6cfd69704d850a2d3e00745c3fb4
2022-03-16 23:02:09 +00:00
Sally
55022a5880 Fixes for a11y selection
- TextView should request focus before performing selection on
  non-editable text, since selection requires focus. On the a11y
  service side, input focus should not matter when selecting
  non-editable text.
- Remove clickable and long-clickable states, since these are present
  due to TextView#setTextIsSelectable.
- Make UI controller changes consistent between SET_SiELECTION and
  SET_TEXT. Using SET_SELECTION means the action mode menu won't pop up
  and the left/right selection handles won't appear. Interactions
  between multiple EditTexts were previously inconsistent

- Delete some obsolete javadoc

Bug: 218357385
Test: builds and install: highlighting is consistent between SET
actions. highlighting works when selecting text in TalkBack, without
the service needing to purposely put input focus,
atest AccessibilityTextTraverssalText

Change-Id: I67986020aa112d45bd670f77b2b415617226c094
2022-03-16 22:01:19 +00:00
TreeHugger Robot
e8acb4a612 Merge "Update the text wrapping API." into tm-dev 2022-03-14 23:09:41 +00:00
James.cf Lin
396c789426 Update the text wrapping API.
1) Update the LineBreakConfig class to be immutable.
2) Do not return null in the PrecomputedText.Params#getLineBreaiConfig API

Bug: 216638444
Test: atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest; atest TextViewPrecomputedTextTest; atest StaticLayoutLineBreakingVariantsTest
Merged-In: I93bcb6ebc35344e34e9bb8a24df375aa7b3a8d81
Merged-In: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
Change-Id: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
2022-03-10 09:58:40 +00:00