Commit Graph

17999 Commits

Author SHA1 Message Date
John Reck
13bfbb7742 Add setBuffer w/ SyncFence
Test: atest android.view.cts.SurfaceControlTest
Bug: 217776226
Change-Id: Ia40947a8cc056d3fcc5569e522524af61c4e5b1b
2022-02-14 12:00:08 -05:00
Pablo Gamito
c533e1070c Merge "Fix typos" 2022-02-14 14:55:10 +00:00
Galia Peycheva
7c4896c5c7 Merge "Implement expanded PiP on TV." 2022-02-14 12:09:21 +00:00
Vadim Caen
ebcfbdfc58 Merge "Invoke callbacks based on back navigation type." 2022-02-14 09:55:49 +00:00
Galia Peycheva
c6876ff4c8 Implement expanded PiP on TV.
- Launch into expanded PiP
- Let user toggle expanded PiP in Menu
- Update moving the PiP via DPAD for expanded PiP
- Let app dynamically change the expanded PiP aspect ratio
- Let app dynamically change the PiP aspect ratio
- Let app dynamically enable/disable expanded PiP

Bug: 203647003
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatio
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatioMaxWidth
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatioMaxHeight

Change-Id: Ie7de6a7fcc424b0c086fdae1f66aa8de42e53b0c
2022-02-14 09:04:20 +00:00
TreeHugger Robot
698426a8d8 Merge "SurfaceView: Clean up synchronized changes with applyTransactionOnVriDraw" 2022-02-12 02:53:19 +00:00
Shan Huang
642b0d8cdd Invoke callbacks based on back navigation type.
Test: m -j.
Test: Open and swipe back on pre-T and T apps.
Test: atest .../BackNavigationControllerTests.java
Test: atest .../BackAnimationControllerTest.java
Bug: b/195946584
Change-Id: I00cf7ab5b57760d57d30ac74dc5b3443a4203f38
2022-02-11 22:59:04 +00:00
Treehugger Robot
26eecc1c62 Merge "OWNERS for ViewStructure" am: a05c4bb1bd am: 3e537e673d am: 7d63e8a6b4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1981428

Change-Id: Ibf12ff3f3e13ac8ff59b794d40db1c6b21f63775
2022-02-11 18:39:10 +00:00
Treehugger Robot
7d63e8a6b4 Merge "OWNERS for ViewStructure" am: a05c4bb1bd am: 3e537e673d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1981428

Change-Id: Ifc34a8b53b0c0e5fc626c5d506190e69c614f33f
2022-02-11 18:28:16 +00:00
Vishnu Nair
6d3b93ae15 SurfaceView: Clean up synchronized changes with applyTransactionOnVriDraw
Replace existing synchronization logic with calls to
ViewRootImpl#applyTransactionOnDraw. There is no functional change.

Test: presubmit
Bug: 217973491
Change-Id: I3b1416c2889d2c3b5c3833ffab4e28a9e0eb5d76
2022-02-11 09:41:35 -08:00
Nikolas Havrikov
4fcc248c03 Merge "Recycle obtained TypedArrays" 2022-02-11 07:29:37 +00:00
Riddle Hsu
48ea281fe4 Merge "Reduce unnecessary invocation of pokeDrawLock" 2022-02-11 06:42:56 +00:00
Ahaan Ugale
8301da241b OWNERS for ViewStructure
Change-Id: I135bfa1a5e15d3b9658028b4e430c847280d7654
Test: n/a
Fix: 218966221
2022-02-11 05:49:36 +00:00
Ahaan Ugale
d6e0516f35 Merge "API to show autofill dialog." 2022-02-11 03:08:12 +00:00
TreeHugger Robot
fca54fd47e Merge "Add more docs per API council feedback" 2022-02-11 02:25:05 +00:00
TreeHugger Robot
4f95f02d2c Merge "PIP: pass grant focus token to focus requests" 2022-02-11 01:02:30 +00:00
Haoyu Zhang
e96b638348 Merge "Scribe for View: handwriting initiation for unfocused" 2022-02-10 22:45:53 +00:00
Rob Carr
fb918b33ed Merge "ViewRootImpl: Resilience for applyOnNextDraw" 2022-02-10 22:07:10 +00:00
John Reck
a96a6df156 Add more docs per API council feedback
Test: make
Fixes: 218314633
Change-Id: I49fa3defa7907f48e650618295f7db758e247a2a
2022-02-10 16:32:04 -05:00
Vishnu Nair
70190ee138 PIP: pass grant focus token to focus requests
Update remaining uses of grantEmbeddedWindowFocus
to pass in a grantFocusToken instead of the input token.

Test: steps in b/218436735
Fixes: 218436735
Change-Id: Idadbd584c06f75ea64dd18a6a002d14426de8998
2022-02-10 20:25:50 +00:00
Haoyu Zhang
f0404bd4c3 Scribe for View: handwriting initiation for unfocused
Bug: 211763729
Test: atest FrameworksCoreTests:HandwritingInitiatorTest
Test: atest FrameworksCoreTests:HandwritableViewInfoTest
Test: atest FrameworksCoreTests:HandwritingAreaTrackerTest
Test: manually test
Change-Id: Ica9ee82cf1dc41feb5e4ff0f52ee13c1e4de8ad4
2022-02-10 10:28:14 -08:00
Rob Carr
ad597c31ce Merge "SurfaceControlViewHost: Basic child window support" 2022-02-10 18:18:54 +00:00
Alan Viverette
7d1188244c Merge "Migrate frameworks/base javadocs references to androidx" 2022-02-10 18:02:28 +00:00
Sally Yuen
6bb459d3de Merge "Expose prefetching strategies to services" 2022-02-10 17:09:37 +00:00
TreeHugger Robot
8b83e8f0ea Merge "Add identifier for EmbeddedWindows" 2022-02-10 16:58:53 +00:00
TreeHugger Robot
1e4bf7fa9e Merge "Recycle obtained TypedArrays" 2022-02-10 16:01:57 +00:00
Pablo Gamito
599f535b1b Fix typos
Test: N/A
Change-Id: I4ced02e143842f9fc38be1b991873d5c1bac7efd
2022-02-10 16:09:24 +01:00
Shan Huang
a1c62623bf Merge "Create BackEvent interface for back navigation parameters." 2022-02-10 14:59:06 +00:00
Shan Huang
27d450afa5 Merge "Avoid leaking Activity from OnBackInvokedCallback." 2022-02-10 14:58:38 +00:00
Ahaan Ugale
00209d94fc API to show autofill dialog.
This allows a UI Toolkit to display the autofill dialog instead of an
input method, if autofill suggestions are already available when the
user focuses on a view.

The dialog typically covers the input method, so it is undesirable to
show the input method under it.

Bug: 210926084
Test: atest android.autofillservice.cts.dialog.DialogTest
Change-Id: Ib982b0fcc271ed3fa2bf43ebe2f9baf494ec82ef
2022-02-10 14:21:09 +00:00
Nikolas Havrikov
e854c600b5 Recycle obtained TypedArrays
Bug: 218835043
Test: make
Change-Id: I069b84684fd3a7505516c014420d55d1e3272ae7
2022-02-10 15:00:48 +01:00
Nikolas Havrikov
55b2bc4bd2 Recycle obtained TypedArrays
Bug: 218835043
Test: make
Change-Id: I7b9c3d1039ba814ae2c6ba2a3ed2c7f02915974e
2022-02-10 14:57:14 +01:00
Riddle Hsu
250a970001 Reduce unnecessary invocation of pokeDrawLock
Now it only acquires wake lock (poke draw) for focused activity
window. Because the original purpose (commit c2932a1) is to make
sure that ambiactive activity can draw without being suspended
for wearable devices.

Check focus instead of visibility because pokeDrawLockIfNeeded
can be called from DisplayListener which happens before the
visibility change.

On a regular phone device with AOD enabled, this can reduce the
number of invocation:
 30+ times when turning screen off.
 4 times per minute (the clock on AOD).
i.e. pokeDrawLock will never be called on a device with keyguard.

Bug: 218406154
Test: Enable AOD, turn off screen to enter AOD.
      Check the section "Wake Lock Log" of "adb shell dumpsys power".
      There is no more "ACQ Window:xxx (draw)".
      And after several minutes, the clock on AOD still shows the
      latest time (because com.android.systemui.doze.DozeUi#onTimeTick
      also acquires WakeLock).
Change-Id: I6fc7f6afec68c63124d76c4734285188ab62fc41
2022-02-10 19:53:13 +08:00
Shan Huang
a39fa74923 Create BackEvent interface for back navigation parameters.
Bug: b/210539672, b/195946584
Test: m -j
Change-Id: I0264d0995aed8a73563bece0d15d2a9aac0ebf06
2022-02-10 07:01:01 +00:00
Shan Huang
b533660125 Avoid leaking Activity from OnBackInvokedCallback.
- Remove mTopCallback field
- Cleanup compat and default callbacks
- Remove the callback held by WindowState when the window is removed.

Bug: 218328707
Test: atest packages/apps/Launcher3/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
Test: atest frameworks/base/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java
Change-Id: I38fd760a617500c874aef10bc8de165880837008
2022-02-10 04:46:24 +00:00
Leon Scroggins III
73e0689d8a getDisplayDecorationSupport: return more detailed info
Call the updated native version of getDisplayDecorationSupport (added in
I961051c0a660b596039ac04b546040764ee20d34), and convert the NDK struct
into a Java class. Depend on the graphics AIDLs, which now have Java
backends. A future CL will update SysUI to call the new API.

Add a PixelFormat for R_8 to correspond to the native version. This will
allow SysUI to use COLOR_MODE_A8 when the HAL reports R_8.

If64fd6924960f592b7a211371bc2ca6536ae34f7 demonstrates using this.

Bug: 216644902
Test: manual
Change-Id: I0e34c6d6e369fda0a96231ab38c3bd5f3bfe3e06
2022-02-09 17:30:29 -05:00
Alan Viverette
406e0f6553 Migrate frameworks/base javadocs references to androidx
Does not remove Support Library artifacts from docs classpath (ApiDocs.bp)
because they are still used in development/samples, which is not as easy
to migrate as javadoc.

Bug: 158779503
Test: make docs
Exempt-From-Owner-Approval: Mass find/replace for androidx migration
Change-Id: Icf7f53ec36a0e970413352e2ebf40ce9d60ed17e
2022-02-09 22:25:14 +00:00
Robert Carr
2f1324ff70 ViewRootImpl: Resilience for applyOnNextDraw
If HWUI doesn't go on to produce a buffer (for example because
there were no changes) we need to ensure we flush the pending
transactions, otherwise our transaction can end up stuck in
BLASTBufferQueue no mans land until another draw eventually occurs.

Bug: 196926363
Bug: 217973491
Test: SurfaceViewSurfacePackageValidatorTest#testSurfacePackageNoFlicker
Change-Id: Ic830c75ed2c3d68cde7455e21a29e286a3bd3690
2022-02-09 20:18:28 +00:00
Robert Carr
d26814a018 SurfaceView: Don't reparent SurfacePackage on release
There is no need to reparent the SurfacePackage to null, if the
SurfaceView is destroyed it will naturally die, if it's not it will
persist which actually may be the intended behavior if we are
in some sort of exiting state. More so, it creates possible confusion
around releasing one SurfaceView while reparenting the SurfacePackage
to another.

Bug: 196926363
Bug: 217973491
Test: SurfaceViewSurfacePackageValidatorTest#testSurfacePackageNoFlicker
Change-Id: I4f93c4a6928f6b47371d0a264f1fc99c4e82819f
2022-02-09 10:38:34 -08:00
Vishnu Nair
77cbb96034 SurfaceView: Synchronize add/remove SurfacePackage with VRI draw
Apply the SurfacePackage reparent transactions with the next
ViewRootImpl draw so the caller can optionally synchronize attaching
SurfacePackages with contents on the main window.

Test: atest CtsWindowManagerDeviceTestCases:SurfaceControlViewHostTests
Bug: 217973491
Change-Id: I87f77cb6a5a2505592f6e9431d2964517fe497cd
2022-02-09 10:38:26 -08:00
Robert Carr
449e06dffc SurfaceControlViewHost: Basic child window support
WindowlessWindowManager already has some support for multiple
windows so the main thing we need to do is just ensure that the
Windowless session is injected in to the ViewRoot of things attached
to our token. We can do this via some somewhat unsightly glue
code in WindowManagerGlobal.

Bug: 218615203
Test: SurfaceControlViewHostTests
Change-Id: Icce97c02b6155a7ef368821670db26728b95b6b9
2022-02-09 18:37:16 +00:00
Sally
026c7ac01f Expose prefetching strategies to services
Make the prefetching strategies public so a service can choose
which strategy works best in a particular spot. This should reduce
unnecessary/redundant prefetching.

For example, the FW currently only allows hybrid descendant
prefetching, but a service may want to do depth-first or
breadth-first traversal of the view hierarchy.

Currently, if there is another user interactive request, we
immediately return prefetched nodes. Also allow services to prevent
this interruption and force prefetching to a max of 50 nodes.

Services could potentially request a certain number of nodes, but
since asynchronous prefetching immediately returns the requested
node, the  service can force prefetching of 50 nodes if desired,
and only exposing strategies touches less code, I prefer limiting this.

Also use a LinkedHashMap so ordering is kept when prefetching
descendants.

Test: Manual, talkback builds
atest AccessibilityCacheTest,
AccessibilityInteractionControllerNodeRequestsTest
Bug: 192489177

Change-Id: I3d8358411ece5d2e1380282824cd3cf1835658ac
2022-02-09 17:55:50 +00:00
Yinglei Wang
e7e3dd676c Merge changes from topic "ime"
* changes:
  Add accessibilitySessions to InputBindResult
  Add FLAG_INPUT_METHOD_EDITOR to a11y
  Allow a11y services to enter text via the path IMEs use
2022-02-09 15:42:22 +00:00
Chavi Weingarten
3d421ecf42 Merge "Add gatherPendingTransactions in BBQ" 2022-02-09 15:41:48 +00:00
Chavi Weingarten
650ce9aea4 Merge "Make setRecentsScreenshotEnabled public" 2022-02-09 15:41:12 +00:00
TreeHugger Robot
c174eb4d2e Merge "Changes the name of the live caption APIs" 2022-02-09 14:48:44 +00:00
yingleiw
107b9413a6 Add accessibilitySessions to InputBindResult
This way, we can pass back a11y sessions from direct startInput()
return value. And a11yManagerService will only request sessions
from a11y services which the client doesn't have sessions yet
(will not request existing a11y sessions again).

Bug: 187453053

Test: tested manually with talkback. Tested client switching within
"recent apps".

Change-Id: I8efdc9886ce33185a2195b741668c12e319ea660
2022-02-08 22:20:52 -08:00
yingleiw
fb17e5ae7a Allow a11y services to enter text via the path IMEs use
InputMethodService is the primary and a11y is the secondary.
InputMethodService is not
affected by a11y status. When the session from input method is
established, app can start input (pass input context to input method).
When an a11y session comes back, it will be passed to the app. When
InputMethodManagerService binds to/start input with
InputMethodService, it does the same to a11y services which
requested IME functionalities.

It is possible that input method can edit text before ally sessios are
established. So the EditorInfo passed to a11y could be stale.
So when an a11y session is passed to client, client will send
a notification (input method doesn't have this extra notification) for
the current selection. I think since the time for a11y session establish
shouldn't be long, and we get the current state later, it should be fine
for a11y services.

When input method is disconnected from app (client) (even for input
method switching), we cleared a11y and sessions too. When
input method request sessions, we must rerequest sessions for a11y. This
is mainly because when we unbindCurrentClientLocked(SWITCH_IME), we set
active to false for the current client. Suppose we don't want to
change the current structure of input method, an inactive client
probably should clear accessibility sessions too.

When we switch to a client which already has a session with input
method, there might be some a11y sessions with this client, and
some a11y services might be disabled or enabled while the client was
switched out. We pass unchanged a11y
sessions to client, and request sessions for newly enabled a11y services.
When an a11y service is disabled, it removes its session
from all clients in InputMethodManagerService.

Test: type word through modified "switchToInputMethod". Tested session
notification through logs. Tested client switching, input method
switching, a11y service enabled/disable, multiple a11y services,
a11y service enabled before device reboot.
Also tested work profile.

Bug: 187453053

Change-Id: Ia651a811093a939d00c081be1961e24ed3ad0356
2022-02-08 22:14:19 -08:00
Jacky Kao
f0e136a5db Changes the name of the live caption APIs
Changes the name of the APIs to reflect the methods actually do.

Bug: 216474106
Test: atest CaptioningManagerTest
Change-Id: I152fa9b791be0f35bdc78478e0eb0d524c120e51
2022-02-09 11:02:44 +08:00
John Reck
2be791c7de Merge "Add setDataSpace SurfaceControl API" 2022-02-08 21:49:24 +00:00