Commit Graph

18191 Commits

Author SHA1 Message Date
Tiger Huang
0797d97536 Merge "Introduce updateVisibility and updateLayout" into tm-dev 2022-03-23 17:44:42 +00:00
Jon Eckenrode
11bc9c9d16 Merge "Revised the API documentation of the getMetrics and getSize methods to account for differences in API levels." am: 7ac639b11b am: d3fd072f68 am: bfad78abc6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1957098

Change-Id: I38e40ff8310cf9a4e1a1ee9b527c62ce62f8fed4
2022-03-23 15:11:39 +00:00
Jon Eckenrode
bfad78abc6 Merge "Revised the API documentation of the getMetrics and getSize methods to account for differences in API levels." am: 7ac639b11b am: d3fd072f68
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1957098

Change-Id: I534e88ec19327a174068807996f133740966741e
2022-03-23 14:55:41 +00:00
Jon Eckenrode
7ac639b11b Merge "Revised the API documentation of the getMetrics and getSize methods to account for differences in API levels." 2022-03-23 14:16:19 +00:00
TreeHugger Robot
49d28c5a9c Merge "[DO NOT MERGE] Remove the Client Suggestions APIs" into tm-dev 2022-03-23 07:25:35 +00:00
joneckenrode
25bfb7ef70 Revised the API documentation of the getMetrics and getSize methods to account for differences in API levels.
Bug: 183681583
Test: Built API documentation
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: I5659661dad29c964ac614326f79164326b3093ec
2022-03-22 23:00:03 +00:00
TreeHugger Robot
77fbf6f1d0 Merge "Use getLatestVsyncEventData for late frame." into tm-dev 2022-03-22 22:35:50 +00:00
Sally Yuen
8c3314f7aa Merge "Fixes for a11y selection" into tm-dev 2022-03-22 20:15:13 +00:00
Tiger Huang
db407ef12d Introduce updateVisibility and updateLayout
This is a step to let the client layout its window locally. The ultimate
goal is to reduce the jank while laying out the window.

With the new AIDL methods, we can divide IWindowSession.relayout into:

- IWindowSession#updateVisibility (synchronized binder call)
  - To get or update the surface
  - To fetch the latest factors about window-layout
  - Only called when the view visibility is changed

- WindowLayout#computeFrames (local function call)
  - To compute the window frames

- IWindowSession#updateLayout (one way binder call)
  - To report the result of layout to the server

In this way, if the view visibility is not changed, the UI thread of
the client won't be blocked by the binder call during relayout.

The local layout project won't be done in a single CL. In order not to
break the existing logic, this CL introduces a flag: LOCAL_LAYOUT. The
flag will be enabled when the logic of local layout is ready.

Bug: 161810301
Bug: 175861051
Test: presubmit (no behavior change)
Change-Id: Ic4b2fc78a318f3a68e1ef8a35d8f3ab705856702
2022-03-22 23:42:47 +08:00
Pablo Gamito
7fb9397972 Merge "Undeprecate animation background color" into tm-dev 2022-03-22 13:48:12 +00:00
Tiger Huang
57d28b9a6e Merge "Refine PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT" into tm-dev 2022-03-22 07:46:51 +00:00
Tiger Huang
d5a1d1e24a Merge "Use public types to update system UI visibility" into tm-dev 2022-03-22 04:09:08 +00:00
Tiger Huang
630c25ddaa Merge "Let the client compute the backdrop frame on its own" into tm-dev 2022-03-22 04:05:18 +00:00
TYM Tsai
0871d02822 [DO NOT MERGE] Remove the Client Suggestions APIs
Bug: 224871426
Test: atest CtsAutoFillServiceTestCases
Change-Id: I178e0443278383120d9e6e3321ec96be8e5705c1
2022-03-22 00:21:12 +00:00
Taran Singh
4cff41a3f2 Merge "Finish handwriting session for recents gesture" into tm-dev 2022-03-21 20:54:31 +00:00
Greg Kaiser
45e7a34c89 Merge "Revert "Replace VRI and SV sync logic with SurfaceSyncer"" into tm-dev 2022-03-21 20:00:42 +00:00
Sally Yuen
5d9e19b664 Merge "Check for null text location when applying scaling changes" into tm-dev 2022-03-21 16:25:16 +00:00
Gary Lin
5ade0d529d Revert "Replace VRI and SV sync logic with SurfaceSyncer"
This reverts commit f37c024b00.

Reason for revert: Google Camera App has black preview

Change-Id: Ib691cc8f9a80412756855e5dd7bcc2a12f842ce9
2022-03-21 10:02:35 +00:00
Tiger Huang
e389f15ca6 Use public types to update system UI visibility
Taskbar is also considered as a navigation bar. While its visibility is
changed, View#dispatchSystemUiVisibilityChanged should be called.

Bug: 225765490
Test: atest WindowInsetsControllerTests
Change-Id: Ie9624211aa6077085966d588c28601000c68a4f2
2022-03-21 17:24:40 +08:00
Jacqueline Bronger
3c5b9738c7 Merge "Implement custom PiP close action on TV." into tm-dev 2022-03-21 07:56:37 +00:00
Tiger Huang
883190cdb3 Merge "Push drag-resize mode to the client" into tm-dev 2022-03-21 05:51:13 +00:00
Tiger Huang
351d589dad Let the client compute the backdrop frame on its own
Since the new split-screen doesn't need the fullscreen backdrop frame.
The backdrop frame will always be the window frame. The server doesn't
need to send the backdrop frame to the client. The client just needs to
offset the backdrop frame to (0, 0).

This CL also moves the logic of calling onWindowSizeIsChanging to the
handler thread because it reads some fields which should only be
accessed on the handler thread. Otherwise, there might be race
conditions.

Bug: 161810301
Test: 1. Perform drag-resize and drag-move on a freeform app, and see if
         the layout is expected.
      2. Move the divider in the split-screen mode, and see if there is
         any abnormal.
Change-Id: Ie0058db0447260dd0561634179fc7721d965a9e2
2022-03-20 14:36:54 +08:00
Tiger Huang
3e194cc9fa Push drag-resize mode to the client
The goal of this CL is to remove RELAYOUT_RES_DRAG_RESIZING_DOCKED and
RELAYOUT_RES_DRAG_RESIZING_FREEFORM, which is a step to make relayout an
oneway binder call.

When the resize mode is changed at the server side, the server will send
the new mode to the client via IWindow#resized, so the client doesn't
need to obtain the resize mode from the flags returned from relayout.

Bug: 161810301
Test: Perform drag-resize and drag-move on a freeform task and see if
      there is any unexpected behavior.
Change-Id: I450abc113932b6c1dc0ce0e2b76bebdf85a60777
2022-03-20 14:36:19 +08:00
Mark Punzalan
dc59b8781e Merge "Add package name to all UiTranslationStateCallback methods." into tm-dev 2022-03-19 23:26:16 +00:00
Rob Carr
3e6bd44753 Merge "Async BLAST Sync [2/N]: Introduce seqId" into tm-dev 2022-03-19 20:06:11 +00:00
Ahaan Ugale
ff1e4a4680 Merge "Allow AutofillService can identify if fill dialog presentation is needed." into tm-dev 2022-03-19 06:11:51 +00:00
Mark Punzalan
49525ccb14 Add package name to all UiTranslationStateCallback methods.
This will be used by clients such as Gboard to ensure they are
responding to translation events for the correct activity. Ideally we
would include the activity token, in case there are multiple activities
being translated in an app, but that isn't supported right now and it
requires changes to EditorInfo (in Input Method Framework) to get the
activity token.

Also fixed an issue where the callback methods are invoked twice when
the IME itself is the translated app is registering a callback for
itself. Note: This happens in UiTranslationManagerTest where the test
activity and IME have the same uid, but shouldn't happen outside of
tests.

Bug: 223979041
Test: atest CtsTranslationTestCases
Change-Id: Id99f501b065b92fe3358c2ae525175ad3ea4b119
2022-03-19 05:28:21 +00:00
John Reck
bb0809e758 Merge "Add setBuffer w/ release callback" into tm-dev 2022-03-19 01:32:25 +00:00
Joanne Chung
23668c560e Allow AutofillService can identify if fill dialog presentation is needed.
If the fill dialog is available for the field, the FillRequest flags
will contain FLAG_ACIVITY_START. The field is hidden originally but
it needs to be get from AutofillService to avoid creating unnessary
fill dialog presentation. Rename the flag because the it's not clear
to combine the relationship with fill dialog.

Bug: 223472039
Test: manual. Build and boot pass.

Change-Id: I52c367e75100f6af2ab782f58755bc5727b1dd72
2022-03-18 22:57:51 +00:00
Chavi Weingarten
ef3f71bfa8 Merge "Replace VRI and SV sync logic with SurfaceSyncer" into tm-dev 2022-03-18 21:18:26 +00:00
Sally
631c1ed726 Check for null text location when applying scaling changes
Bug: 225379715
Test: builds
Change-Id: I3cd88c315cbf7e1b3c7f5047d051c301a9caa848
2022-03-18 20:31:51 +00:00
John Reck
f6fb6f6288 Add setBuffer w/ release callback
Also tweak SyncFence#getSignalTime javadocs

Fixes: 220897032
Bug: 222095580
Test: SurfaceControlTest
Change-Id: I83c000e1699c95b73ac7b41815e1798475c1a778
2022-03-18 13:42:09 -04:00
TreeHugger Robot
1b58550351 Merge changes from topics "presubmit-am-859dd3744ae243f9a8cb2f6234a9ef1e", "register_api" into tm-dev
* changes:
  Change parameter order to make it SAM compatible
  Fix a problem that Dialog does not close in new dispatch.
2022-03-18 17:04:05 +00:00
Vadim Caen
3686891611 Change parameter order to make it SAM compatible
Move the callback as the last paramter to registerOnBackInvokedCallback

Test: Existing
Bug: 224562951
Change-Id: I8608a03b53baa04bedee81d2e86b2339abd6c594
2022-03-17 22:19:54 +01:00
Robert Carr
5109c0dadf Async BLAST Sync [2/N]: Introduce seqId
We introduce a seqId and use it to replace the
RELAYOUT_RES_BLAST_SYNC flag. The server code block that
produces RELAYOUT_RES_BLAST_SYNC is guarded by
mNextRelayoutUseSync, and sets it to false when executed.
This block is the only place that sets it to false. We replace
every place where it is set to true, with incrementing a seqId
stored on the integer. We change this block to not check
mNextRelayoutUseSync but instead check if the seqId has changed
since we reached the block. This is evidentally equivalent conditions
and in these cases we send the client the seqId. In the else block
where we wouldn't have sent RELAYOUT_RES_BLAST_SYNC we send -1.
On the client side, we replace the USE_BLAST_SYNC conditional
with a check if the SeqId we received has increased. It's clear
that this will never execute in cases where the seqId is -1. Likewise
its clear that if the seqId has increased, it will execute. Since the
seqId increases in all cases where the server would have returned
RELAYOUT_RES_BLAST_SYNC this change is a noop by itself.

Bug: 161810301
Bug: 175861051
Bug: 175861127
Bug: 200285149
Change-Id: Ib2e45cae7709519251e4bfcc2b8adc689c590a00
2022-03-17 11:20:02 -07:00
Naomi Musgrave
4b563a2d37 Merge "Capture the contents of a single task" into tm-dev 2022-03-17 17:03:48 +00:00
chaviw
f37c024b00 Replace VRI and SV sync logic with SurfaceSyncer
Instead of using the count to keep track of sync information in VRI, use
the SurfaceSyncer to handle this. This also means changing SV since SV
would also increment the VRI counter. This cleans up the logic since
code that's used for the SurfaceSyncer can be re-used in VRI.

Test: seamless rotation, launching apps
Bug: 200284684
Change-Id: Ia3c1a13b42ceba29a75425295e41e543a00436a3
2022-03-17 10:13:09 -05:00
Haoyu Zhang
8987377b63 Merge "Use long click timeout for handwriting" into tm-dev 2022-03-16 23:01:21 +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
Haoyu Zhang
bda185a37c Use long click timeout for handwriting
We've received several feedbacks that the current tapTimeout is too short,
making it very hard to initiate handwriting. To unblock us from bug bash,
this CL temporarily use long lick timeout for handwriting timeout.
Once UX decided the final value for handwriting timeout, we will create
another CL.

Bug: 217603538
Test: atest FrameworksCoreTests:android.view.stylus.HandwritingInitiatorTest
Change-Id: Icb9f49b8b2a49c6c2a13fa377c20a3d1b3bd782c
2022-03-16 21:30:19 +00:00
Tiger Huang
fa1ec597ca Refine PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT
- If a window has PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT, the final
  frame might be larger than the requested size, and we cannot use the
  requested lengths to compute the window frame. Because the window size
  will be the new requested size, we don't want to extend the window
  size again and again.

- When we are checking if a frame is overlapped with the display cutout,
  we only need to check if displayCutoutSafe contains the frame. We
  don't need to check individual bounding rectangles. This also fixes an
  issue that the gestural navigation bar is not extended by the
  waterfall cutout because it doesn't have bounding rectangles.

Bug: 203031262
Bug: 161810301
Test: Enable double cutout or waterfall cutout in developer options and
      see if the frame of navigation bar is correct when it is at the
      same side of the cutout.
Change-Id: Ic8c090198c556f2dc3b2c0b8498c42e9ca18c795
2022-03-17 00:58:29 +08:00
Jacqueline Bronger
aa3a7e6273 Implement custom PiP close action on TV.
The custom close action will replace the system close action and
the button in the menu will be colored red to be able to tell it
apart.
If one of the custom actions matches the close actions it will be
removed to avoid duplicates resulting from the custom close action.

If the app doesn't close the PiP after five seconds the system will
continue to close the PiP as normal.

Bug: 218487423
Test: manual
Change-Id: Ic3c520c50ac0e3d2f0e73cf2f71d47a4f548f861
2022-03-16 16:32:02 +01:00
Tiger Huang
d943f85a2a Merge "Remove RELAYOUT_RES_IN_TOUCH_MODE" into tm-dev 2022-03-16 04:05:42 +00:00
Rachel Lee
7065b5aed5 Use getLatestVsyncEventData for late frame.
Then the vsync ID will be valid.

Bug:205721584
Test: atest ChoreographerTest

Change-Id: I4098b40ef3e79af40d6accc300b410b17f759ad8
2022-03-15 17:14:35 -07:00
Garfield Tan
bce590e356 Merge "Add argument checks in setScale and setCrop" into tm-dev 2022-03-15 20:53:04 +00:00
Taran Singh
d98f037ab2 Finish handwriting session for recents gesture
Finish stylus handwriting session when user swipes to recent.
Bug: 223748964
Test: Manually:
     1. Open an app with editor
     2. swipe on editor with stylus [or emulated stylus]
     3. Observe ink trail drawn on screen
     4. quickly sipe to recents, ink should go away.
     5. repeat steps 1-3 for swipe to home

Change-Id: Id750ff55cb447247c3eca75daf37cb5aeb1d0cfa
2022-03-15 20:44:30 +00:00
Tiger Huang
c1cf2472f6 Merge "Use ClientWindowFrames to collect frames computed by WindowLayout" into tm-dev 2022-03-15 18:43:37 +00:00
Arthur Hung
b1c7853e29 Merge "Prevent NPE for onKeyDown and onKeyUp" into tm-dev 2022-03-15 14:31:28 +00:00
Naomi Musgrave
13194c3ca4 Capture the contents of a single task
Introduces layer mirorring of a single task, given the task is both
identified (future work - dependency on setup flow in SysUI) and the
flag is enabled (currently disabled).

Error handling (tearing down the VirtualDisplay if task recording setup failed)
will come in a future change

Bug: 216625226
Test: atest WmTests:DisplayContentTests
Test: atest WmTests:ContentRecorderTests
Change-Id: I16abd55ce75537ff8fbbb379e4970668ea02a230
2022-03-15 14:13:11 +00:00
Tiger Huang
3072d027ec Remove RELAYOUT_RES_IN_TOUCH_MODE
When WindowManagerService.mInTouchMode is changed, we will set the new
mode to InputManagerService, and clients will be notified via
ViewRootImpl.WindowInputEventReceiver#onTouchModeChanged. We don't need
the flag to bring the information to the client.

This is also a step to make relayout an oneway binder call.

Bug: 161810301
Test: Invoke View#requestFocusFromTouch on one window and see if another
      window can receive OnTouchModeChangeListener#onTouchModeChanged.
Change-Id: Ic149c95bee89b2be83a85eb4858131224b63a7c8
2022-03-15 18:48:07 +08:00