Otherwise it could lead to parameters applied in the wrong frame,
leading to jank.
Test: Open notification
Bug: 78611607
Change-Id: Ia7900e753b29187a7a7b81f393666687e8b8e04b
We use ids to break ties when sorting views just to
guarantee that we won't break sorting. But we don't
want to have our swipe order determined by arbitrary
ids.
Before resorting to such a crude tie-breaker, look at
a view's children to try to break a tie using their
bounds. That sort is more based on what's on the
screen, and will also produce the same result from
the same ui.
Bug: 78348191
Test: Switch access order is much more sensible on
Recents. Also ran a11y cts.
Change-Id: I918eae3b0d27e889a53d05a6ebe925e38ce5d7b4
IME used to allow startInput() *only* when window has focus.
This is no longer the case after we made changes to allow autofill
window to get window focus to receive physical keyevents.
The fix changed precondition of when InputMethodManager can startInput:
(hasWindowFocus() || isAutofillUIShowing()).
Test: manual test:
- install two IMEs
- install autofill sample service and autofill sample service
- launch the Autofill sample app, click on edittext, both
IME and autofill window are showing.
- type "username", autofill datasets are being filtered.
- click "globe" button in IME window to switch IME.
- continue typing "username2" using new IME and autofill window
continues to filtering.
- also try the "IME switch" button in bottom bar to switch IME.
Bug: 79494235
Change-Id: I0d222b5fc13ad46834aa861647d8f2e1649093ec
If we depend on legacyIntent, then TextClassifierService implementations
will have to always popuplate a deprecated field.
To avoid breaking legacy clients, the returned legacyOnClickListener should
represent the first pendingIntent (i.e. primary action) that was parcelled.
Bug: 78340399
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: manual check with a TCS that only sets non-deprecated fields vs a
legacy TC client
Change-Id: I41d27a65f1ede6369dd2a66d92b2210edb0d11e2
We were only updating accessibility in View#setAlpha,
but View#setAlphaNoInvalidation would also change alpha,
and accessibility would never find out.
Bug: 78101543
Test: TalkBack now works on nightlight conditional and
battery saver slider.
Change-Id: I1ebb62aa7f4de700b2d7fbaae8dbbd1c84fc4ece
No logs were being sent via the TextClassificationManagerService to
the TextClassifierService.
Also, SelectionEvent.getSessionId() is nullable. Handle appropriately.
Bug: 79418429
Test: manual - manually tested via a debugger. Auto tests coming soon.
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Change-Id: I196885d9b03c0c11cae7686a5835d14791065e78
This field is used on pretty much all Autofill metrics, except
AUTOFILL_USERDATA_UPDATED, AUTOFILL_SERVICE_DISABLED_SELF, and
AUTOFILL_INVALID_PERMISSION.
Test: atest CtsAutoFillServiceTestCases
Test: adb shell logcat -b events | grep sysui
Bug: 79351659
Change-Id: I2e2f3dcc780a3896162b158926f5ee89c7cb342d
* changes:
Revert "Rotate IMEs (subtypes) by Meta+Space."
Revert "Show toast when subtype is rotated by Meta-Space."
Revert "Shift+Meta+Space should reverse-rotate subtypes."
Revert "Shift+Meta+Space should reverse-rotate subtypes part 2."
Revert "Make sure that Toast is always shown by Meta-Space."
This reverts commit ae61f7118a [1].
Reason for revert: to deprecate Meta-Space short cut.
[1]: I4005692215edfcf8bed3e86b1e07000148f986f5
Bug: 79150878
Test: Manually tested as follows.
1. make -j SoftKeyboard
2. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
3. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
4. Connect a hardware keyboard
5. adb shell settings get secure default_input_method
6. Hit Meta+Space on the hardware keyboard.
7. adb shell settings get secure default_input_method
8. Make sure that the results of step 5 and step 7 are the same.
Change-Id: I5ed0feb5a6d7171564d358644b04ee2a43e4d6b3
The CL fixes the magnifier's behavior when its parent window has
positive insets in its surface:
- we compute the content copy coordinates sent to the pixel copy request
relative to the surface the content is copied from. We were clamping
them inside the visible region of the magnified view as returned by
belonging to the view which is magnified. However, the method returns
coordinates relative to the window. Therefore, the CL offsets the
visible rectangle with the window insets, to account for them.
Otherwise, when the insets were non-zero, on a text line we were
allowing the magnifier to display content from the left outside of the
text line, while a certain region at the end of the text line could have
never been magnified
- when clamping against the visible view region, when the surface we
copy from is a SurfaceView, #getGlobalVisibleRect is still returning
coordinates relative to the main window, whereas the coordinates we are
trying to clamp are relative to the surface of the SurfaceView. In order
to make the visible rectangle relative to the surface of the SurfaceView
instead, this CL negatively offsets the visible rectangle with the
SurfaceView position in the parent surface
- the selection/insertion handles are hidden when they overlap the
magnifier. To check this, we intersect the magnifier rectangle with the
rectangle of each handle. However, when we were performing this check,
the magnifier rectangle was relative to the surface, whereas the
handles' rectangle was relative to the main window. The CL negatively
offsets the magnifier position with the surface insets, to make both
rectangles relative to the window.
Bug: 78621162
Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I0d749c1abb38520fe8fc477d22d6523f470e9abc
As this signifies releasing the native resources protected by the guard. See comment
for more indepth discussion.
Bug: 78629612
Test: Manual.
Change-Id: Iee9fe9558b1fee171789580c48f4890c2be1c219
Prior to the implementation of detachChildren we handled this
case via the "mWindowStopped" codepath in SurfaceView.java which this
CL deletes. That codepath however causes confusion due to it's failure
to set null the SurfaceControl, meaning we may not necessarily
recreate it when resuming if we didn't hit any other code-path
to do such as happens in linked bug 78588930. Anyway it seems clearest
to handle all these preserve-child-surfaces-on-tear-down cases via
one mechanism (detachChildren).
Bug: 78588930
Test: Manual.
Change-Id: Iac7c0bc0c6b4da0d405bdc2b57d13d5c881611b0
Problem was RemoteAction(...) takes a non-null PendingIntent but
TextClassification.createPendingIntent(...) returns a nullable PendingIntent.
Bug: 78515224
Test: manual
- Disable Contacts apps in settings
- Select a phone number in a TextView
- Verify that a Phone smart action is displayed
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Change-Id: Icab581d4eef38b4801d1b9ee3af04ffefd1eec6f