Commit Graph

17963 Commits

Author SHA1 Message Date
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
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
Nikolas Havrikov
e854c600b5 Recycle obtained TypedArrays
Bug: 218835043
Test: make
Change-Id: I069b84684fd3a7505516c014420d55d1e3272ae7
2022-02-10 15:00:48 +01: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
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
chaviw
e12e51892a Add gatherPendingTransactions in BBQ
Instead of applying the pending transactions when a frame wasn't
rendered, we gather the transactions and merge them with the transaction
that will be used to sync. This is to ensure these frames are sent to
the caller that requested the sync so they can ensure it's applied at
the correct time.

Test: Builds and run
Bug: 200284684
Change-Id: I087c67138f31cc93e79df42c29464ab4f7989d52
2022-02-08 11:22:57 -06:00
Lucas Dupin
ce69d4336f Merge "Make IRemoteAnimationFinishedCallback oneway" 2022-02-08 17:13:32 +00:00
Vishnu Nair
615186a1b3 Merge "SurfaceView: Remove blast debug flag" 2022-02-08 15:57:54 +00:00
TreeHugger Robot
024074187e Merge "IME: Fix broken IME when detaching served (but not next served) view" 2022-02-08 04:15:18 +00:00
John Reck
ffa81f86ba Add setDataSpace SurfaceControl API
Also change DataSpace from long to int (HAL & native are both ints)

Bug: 217776226
Fixes: 218320444
Test: make && SurfaceControlTest#testSurfaceTransaction_setDataSpace
Change-Id: Ic2b9ccb1d0ba3c1d049839310b4fef0881a3d2e2
2022-02-08 03:05:30 +00:00
Winson Chung
80fbf9b04b Merge "Add hidden flag for SysUI to control the return drag animation" 2022-02-08 00:33:18 +00:00
Vishnu Nair
fc859eed70 SurfaceView: Remove blast debug flag
BufferStateLayer is the now the default interface to SurfaceFlinger
and BufferQueueLayer code path is obsolete and non-functional.

Test: presubmit
Bug: 217973491
Change-Id: I0d083230f3a27d4b0380a1d958fdc5c1b6c3aa51
2022-02-07 15:26:39 -08:00
Lucas Dupin
4d28f3f89d Make IRemoteAnimationFinishedCallback oneway
RA#onAnimationFinished() has been called from the UI thread when
animations finish, causing missed frames (in at least 7 isolated places
in SystemUI.)

On top of that, this method returns void, and it doesn't seem like
there's good reason for halting the main thread until it finishes.

IRemoteAnimationFinishedCallback should follow the same pattern that
IRemoteAnimationRunner does, not blocking the caller.

Bug: 191971782
Test: https://ui.perfetto.dev/#!/?s=556228b5c78df93f1721f62b97a2715d9dd579602bc2c9c0c9812265bdfaec9
Change-Id: Ia257dc4cff64ced20727de9e514fffe3e0ec6186
2022-02-07 14:56:46 -08:00
Alan Viverette
7c9b826042 Merge "Nullability annotations for view and widget" 2022-02-07 17:36:41 +00:00
Felipe Leme
969f745873 Merge "Changes Activity to use Dumpable for "legacy" cases." 2022-02-07 17:32:52 +00:00
John Reck
ab43db35ba Merge "Adjust where TransactionCommittedListener lives" 2022-02-07 16:42:09 +00:00
Chavi Weingarten
f696a43966 Merge "Shorten mTag in VRI" 2022-02-07 14:58:27 +00:00
Shan Huang
56fc3f5e5c Merge "Add compatibility back callbacks." 2022-02-05 06:31:15 +00:00
Winson Chung
22e0d342be Add hidden flag for SysUI to control the return drag animation
- When a drag is not dropped or the drop is not consumed, the system will
  play a canned animation to the origin of the drag. However, there are
  scenarios where this is not sufficient (ie. dragging from a folder or
  all apps in the taskbar, which are closed once global drag starts). As
  a result, the return animation will return to the wrong location.

  The CL adds a hidden flag DRAG_FLAG_REQUEST_SURFACE_FOR_RETURN_ANIMATION
  which only SysUI can request (protected by START_TASKS_FROM_RECENTS)
  which indicates to the system that when a return animation is to be
  played, it should defer to the calling app to animate the surface
  instead.

  The surface will be returned with the DRAG_ENDED event only if the
  result is false (a return animation), to ensure that it does not
  collide with the DROP animation by the Shell.  The system will
  also continue to schedule a timeout to clear the surface if the
  caller does not handle it correctly.

Bug: 179390870
Test: atest DragDropControllerTests
Change-Id: I65d749f9fba186a0e43e155bebb136926642a90a
2022-02-05 04:53:49 +00:00
Shan Huang
025b9e5ceb Add compatibility back callbacks.
For pre-T apps, the default back callback dispatches KEYCODE_BACK to the
application's root view.
For T+ apps, the default KEYCODE_BACK listener invokes the registered
OnBackInvokedCallback.

Test: m -j
Bug: 195946584
Change-Id: I62342b249e6cd6f8b036f7e950cc3f9754418ee4
2022-02-05 01:53:25 +00:00
John Reck
65ce82ee56 Adjust where TransactionCommittedListener lives
android.view.TransactionCommittedListener sounds generic
& broad, but this is really very specific to a single
callback in SurfaceControl. So move the listener there.

Test: make
Bug: 217776226
Change-Id: Ib51a525c5b5ca5fd5c08b667ade6742774047131
2022-02-04 19:00:06 -05:00
Felipe Leme
2eea07021e Changes Activity to use Dumpable for "legacy" cases.
Test: adb shell am start com.android.settings && adb shell dumpsys activity com.android.settings --autofill
Test: atest CtsAppTestCases:android.app.cts.ActivityDumpTest

Bug: 149254050

Change-Id: I658b18a965f3d35c3ecbb2aae58c7c7d7527c6e4
2022-02-04 15:39:13 -08:00
Tianhao Yao
6207fc138f Add identifier for EmbeddedWindows
Use LayoutParams title as identifier for EmbeddedWindows

Test: `adb shell dumpsys input` shows the names for EmbeddedWindows
Bug: 205621873
Change-Id: I5c10b1e38aafff0734f42429c4f421a95de3d0da
2022-02-04 22:34:20 +00:00
chaviw
62df8ad093 Make setRecentsScreenshotEnabled public
Enable setRecentsScreenshotEnabled as a public API to allow apps to
disable the screenshot that is shown in recents.

There's no need for a getter method because it's only set by the app so
it will not be changed by system

Test: SnapshotTaskTests
Fixes: 166729178
Change-Id: I06f1e4fa62ad50c050b6259e04a4af27cd25be67
2022-02-04 16:27:26 -06:00
Ameer Armaly
ed1d6e1639 Merge "Add AccessibilityEvent TYPE_SPEECH_STATE to receive assistant speaking / listening state" 2022-02-04 18:15:05 +00:00
Jordan Demeulenaere
9edeecff35 Merge "Allow DiP values in the translate XML animation (1/2)" 2022-02-04 12:14:12 +00:00
chaviw
abc9e9740b Shorten mTag in VRI
The current mTag is ViewRootImpl[name] which can be very long. Shorten
ViewRootImpl to VRI since this is a common acronym.

Test: Log tag and BBQ name is updated
Bug: 217621394
Change-Id: Ibcd0ac72733a74dade64491d853a7c98700eb60d
2022-02-03 18:16:30 -06:00
Ameer Armaly
135a7610bb Add AccessibilityEvent TYPE_SPEECH_STATE to receive assistant speaking / listening state
Bug: 215600524
Test: atest AccessibilityEventTest
Change-Id: Ic391457b46436b165f1bebf92b98bc38ed936800
2022-02-03 13:09:46 -08:00
Yeabkal Wubshit
8f53596943 Merge "Fix Incorrect Documentation for View#isHapticFeedbackEnabled" 2022-02-03 20:55:03 +00:00
Alan Viverette
68c65e58b4 Nullability annotations for view and widget
I inferred nullability annotations in Jetpack based on the guaranteed
behavior of the platform, so now I'm propagating those inferences back
to the platform as annotations.

Test: nullability presubmit checks
Fixes: 206801689
Change-Id: I78a1997faeecdafc51d303b0fc766369938b9101
2022-02-03 15:51:17 -05:00
Vadim Caen
8e59ca9a3a Merge "Save the OnBackInvokedCallback in WindowState" 2022-02-03 17:26:12 +00:00