Commit Graph

18232 Commits

Author SHA1 Message Date
Hiroki Sato
2c06ff3da8 Merge changes from topics "presubmit-am-166ca8e59ac8499bb6b4f4cad6aae045", "presubmit-am-1a825bf4d182432b91541a8629e0e351" into tm-dev
* changes:
  Add private API InputMethodManager#reportVirtualDisplayGeometry
  Reland CursorAnchorInfo#createForAdditionalParentMatrix()
2022-03-31 00:15:59 +00:00
Garfield Tan
3bea7df55b Merge "Hide CaptionDecorView behind CAPTION_ON_SHELL flag" into tm-dev 2022-03-31 00:03:59 +00:00
Sumir Kataria
ef65e8b8e1 Merge "Add documentation clarifying the differences between Surface/TextureView" into tm-dev 2022-03-30 23:07:34 +00:00
Evan Laird
8908730d94 Merge "Update docs for WindowInsets#getPrivacyIndicatorBounds" into tm-dev 2022-03-30 19:03:18 +00:00
Mark Punzalan
6d57b10190 Merge "Trigger newly-registered callbacks with events from currently active translations." into tm-dev 2022-03-30 18:15:07 +00:00
Tiger Huang
957b746c51 Merge "Bring fullscreen backdrop frame back" into tm-dev 2022-03-30 14:26:03 +00:00
Mark Punzalan
6c3d2f7b7d Trigger newly-registered callbacks with events from currently active
translations.

Bug: 192331240
Test: atest android.translation.cts.UiTranslationManagerTest
Test: Manually on device:
  1. Kill Gboard
  2. Open translatable Chat conversation, wait for Live Translate
  4. Focus on chat input
  5. Auto-translate on Gboard is opened, and debug logs show
     "TranslationManagerServiceImpl: Triggering callback for..."

Change-Id: Ida82a947491e8157fac5cd43939d6d358fbe6c7b
2022-03-30 05:35:46 +00:00
Sumir Kataria
4ea4f632da Add documentation clarifying the differences between Surface/TextureView
Test: Built docs
Change-Id: Iec47b85bbfc537932832b1ad3fa98975a93075df
2022-03-30 04:32:47 +00:00
Garfield Tan
47acf93da2 Hide CaptionDecorView behind CAPTION_ON_SHELL flag
Also introduce a system property to facilitate debugging of caption in
shell.

Bug: 165794636
Test: Caption shows when the property is unset. Caption goes away when
the property is set.

Change-Id: I57060778c46da217a957910f0cc9d1fe1592cfa1
2022-03-29 19:59:50 +00:00
Chavi Weingarten
8089e6f249 Merge "Force draw during a blast sync and disable rt animations" into tm-dev 2022-03-29 18:38:02 +00:00
Evan Laird
8bf356b5e6 Update docs for WindowInsets#getPrivacyIndicatorBounds
Added a paragraph to be more descriptivea bout how the bounds are
loaded, and when they would be expected to change. In particular, added
a clause to state that the bounds should never be null so long as there
is a StatusBar window.

Fixes: 189190379
Test: read docs
Change-Id: I0392310d3a19ea6f6a74010266e90ffe5c1543e9
2022-03-29 14:35:39 -04:00
Tiger Huang
918d95ca89 Bring fullscreen backdrop frame back
We might need to bring the legacy split-screen back. This CL restores
the logic of the fullscreen backdrop frame.

Bug: 161810301
Test: Drag the split-screen divider after setting
      ActivityTaskManager#setSplitScreenResizing to true
Change-Id: Ifdc8b7695595e81e381b3311cf0d266f9af4be23
2022-03-29 17:22:12 +00:00
Aurimas Liutikas
f5b7e1f67d Merge "Add siyamed@ to android/view OWNERS" am: 30cbfdba0a am: 98ce07baf9 am: 500742b6ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2046963

Change-Id: I1cef4b1bff1d0db2e4a8ecf0949da1e147ec3e6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 15:34:33 +00:00
Aurimas Liutikas
500742b6ec Merge "Add siyamed@ to android/view OWNERS" am: 30cbfdba0a am: 98ce07baf9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2046963

Change-Id: Iab5975be189871e3e5432d0c85ad666cbb53d200
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 00:46:39 +00:00
Aurimas Liutikas
7b08f0d899 Add siyamed@ to android/view OWNERS
Change-Id: I9b4f911451e1bbd6d87d012f3c553a5da597c027
Test: None
2022-03-28 21:39:28 +00:00
Prabir Pradhan
a4f617f451 Merge "Ensure handwriting session can only be started from inside app bounds" into tm-dev 2022-03-28 19:24:20 +00:00
Vadim Caen
09f7f6f69b Merge changes from topic "presubmit-am-b87ddd3bbf2947f1aa639cddcee6ecb8" into tm-dev
* changes:
  Remove callback before WindowState removal
  Improve startBackNavigation stability
2022-03-28 18:53:26 +00:00
chaviw
7b7dabc218 Force draw during a blast sync and disable rt animations
When ViewRootImpl is going to draw a frame due to a blast sync request,
we call forceDrawNextFrame to ensure we get a draw this vsync, even if
RT animation rendered a frame. This will ensure that we aren't required
to reschedule a draw either in rt thread or ui thread since we'll get a
frame back as long as there's an available buffer.

We also disable rt animations if a sync set has started with Syncer and
then re-enable when the sync set is complete. This ensures we don't
continue to acquire buffers for a render thread scheduled animation
during a UI animation since we want the UI request to get the buffer.

Test: Open internet dialog from notification shade on 60hz device
Fixes: 217621394
Bug: 200284684
Change-Id: Ic1534d21b0ee2ad82f20ff34df4cbbbad87557fd
2022-03-28 09:41:25 -05:00
Hiroki Sato
708c957fa3 Add private API InputMethodManager#reportVirtualDisplayGeometry
This logically relands the change [1] which added an @hide api
InputMethodManager#reportActivityView() with renaming as
reportVirtualDisplayGeometry().

Because ActivityView was removed, this API was removed [2] once.
However, because this API is useful for OEM customization, this change
adds the same API with a generalized method name.

Note that there was a change on how cross-display input connection
cursor update is blocked [3]. Thus, this CL adapts to it.

[1] Id0411a80456182111bb5b681c6d1230b58e7ec2e
[2] Idd60d96a39f827197d189beb5de016446576d9cd
[3] Iec12733d37e112b7271436bba15094ae2a55a450

Bug: 224424149
Test: manual. Cursor is updated in cross-display connection.
Change-Id: I35b491da5a340844e17542d7a6198f8152bbeda3
2022-03-28 20:03:24 +09:00
Hiroki Sato
62af809a65 Reland CursorAnchorInfo#createForAdditionalParentMatrix()
This logically relands the CL [1], which added an @hide method
CursorAnchorInfo#createForAdditionalParentMatrix().
The corresponding change was once removed in [2].
This is a preparation to reland a change that supports
InputMethodManager#reportActivityView() again.

[1] Ic7f9057623ffc61ec7a6121735dc39adecf4649d
[2] I0a05453eeed863db5bfe4b965ab4bcbad67f2783

Bug: 224424149
Test: CursorAnchorInfoTest
Change-Id: I0a411453c7c26795d28e913a96be8eb8fa3684d7
2022-03-28 20:03:15 +09:00
Tiger Huang
5b19a1584a Merge "Send InsetsState to the client via IWindow#resized" into tm-dev 2022-03-26 03:50:44 +00:00
Chavi Weingarten
381743d2ee Merge "Remove consumeNextDraw and replace with SurfaceSyncer" into tm-dev 2022-03-25 22:08:17 +00:00
Robert Horvath
9d55afe25d Merge "Prevent ArrayList allocation for prefer keep clear areas" into tm-dev 2022-03-25 13:57:41 +00:00
Vadim Caen
d1a57ed491 Remove callback before WindowState removal
ViewRootImpl was removing the callback from the server after the
windowState was removed, which was consistently failing resulting in an
exception in the log.

Now the removal is done before the ViewRootImpl's window removal

Test: Manually check that the error is not appearing in the log
Bug: 226089354
Change-Id: Ie9cb9940791b16d6ae1b243079794583c87b1a5c
2022-03-25 14:11:45 +01:00
Tiger Huang
d5d86912aa Merge "Check mAttachInfo.mSystemUiVisibility to see if a SysUI flag exists" into tm-dev 2022-03-25 10:30:49 +00:00
Tiger Huang
29b8170f55 Merge "Fix setSystemBarsAppearances" into sc-v2-dev am: baedc4fdda am: 491d113504
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17378203

Change-Id: Idf7d59382d9cae3161c10655e4533a42ebc5b080
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 06:46:23 +00:00
Tiger Huang
491d113504 Merge "Fix setSystemBarsAppearances" into sc-v2-dev am: baedc4fdda
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17378203

Change-Id: I09077452f12c192afc32f5a209d454c6c115ed1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 06:32:14 +00:00
Tiger Huang
baedc4fdda Merge "Fix setSystemBarsAppearances" into sc-v2-dev 2022-03-25 06:15:12 +00:00
Tiger Huang
bc1d8093db Send InsetsState to the client via IWindow#resized
In some cases, the InsetsState and the window frame can be changed at
the same time (such as orientation changed). Reporting them separately
might produce incorrect insets.

When the window layout is moved to the client, it uses the configuration
and the InsetsState to compute the window frame. They need to be
reported together as well.

Bug: 161810301
Bug: 160732586
Test: atest ActivityRecordTests WindowStateTests
Test: Add logs to check if we dispatch the correct insets to apps while
      rotating the display.
Change-Id: I5c9f628eda40932def97c5caf968cb62db128e80
2022-03-25 12:39:18 +08:00
Tiger Huang
491c07a9e0 Check mAttachInfo.mSystemUiVisibility to see if a SysUI flag exists
Previously, we checked info.globalVisibility to see if a system UI flag
exists, but since updateCompatSysUiVisibility can process more than one
type of one system bar, info.globalVisibility might be changed by one
type before the other type checks it. For example, if we process
ITYPE_CLIMATE_BAR first with visible=true and hasControl=false, and
then, when we process ITYPE_STATUS_BAR with visible=true and
hasControl=true, we cannot clear SYSTEM_UI_FLAG_FULLSCREEN by setting it
to info.localChanges, because wasVisible is false now.

Fix: 226555579
Bug: 225765490
Test: atest WindowInsetsControllerTests
Change-Id: I820842c7fe14fc47141a4fa09cfddf68f89dbd41
2022-03-25 11:53:29 +08:00
TYM Tsai
12354226af Merge "API feedback: Modify javadoc for showAutofillDialog" into tm-dev 2022-03-24 21:21:07 +00:00
chaviw
a2e1f4482a Remove consumeNextDraw and replace with SurfaceSyncer
Replace the usage of consumeNextDraw with the SurfaceSyncer since
it's safer and integrated with VRI in a cleaner way.

Test: Internet Dialog in Notification Shade
Bug: 200284684
Change-Id: Ia837086040329c5fd3b8bb5b0adb0fddb339f3f9
2022-03-24 16:18:37 -05:00
Vadim Caen
6a074eca5c Improve startBackNavigation stability
- Use the focused window instead of the topApp window
    - Instead we now rely on WindowManagerService to get
     the focused window.
    - SystemUI does not have ActivityRecord so we can't rely
     on the top window of the Task to find the correct
      window on which the callback will be called.

  - Introduce a Builder for BackNavigationInfo
    - This reduces the number of variable needed outside the synchonized
    block.
    - It also reduces the number of early return of BackNavigationInfo
    instances

  - Adding log messages to help further debug the method.

Test: BackNavigationControllerTests
Test: Manual dismiss of SystemUi dialog in QS
Bug: 216604581
Fixes: 221458292
Change-Id: I9ba2c7f89956f34d6338824502c210b3e58dc076

Introduce builder for BackNavigationInfo

Change-Id: I14b4a4b3abc8f417998b7b32831cb3d5c4faa491
2022-03-24 14:14:26 +01:00
Tiger Huang
43047efed7 Fix setSystemBarsAppearances
We should compare the existing appearance with the new appearance which
is about to be applied to insetsFlags.appearance, not the raw appearance
from the argument, before deciding if we can skip it.

Bug: 224613946
Fix: 226227461
Test: atest WindowInsetsControllerTests#testSetSystemBarsAppearance
Change-Id: I1283089a3dadf4ca2c3136f80d1472a34351306a
2022-03-24 12:17:37 +00:00
Robert Horvath
e10a3513f4 Prevent ArrayList allocation for prefer keep clear areas
This avoids creating an ArrayList if there are no keep clear areas,
returning early with an empty or singleton list where possible.

Bug: 222567277
Test: android.view.ViewShowHidePerfTest#testVisibleToInvisible
Change-Id: Id718a37ea8aa4fcf4edbaade532cea826b15adf0
2022-03-24 12:29:05 +01: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
TYM Tsai
9573239064 API feedback: Modify javadoc for showAutofillDialog
Bug: 220079814
Test: make sdk
Change-Id: Id31459e91e119ed4443a7411f89468d5ed6859c7
2022-03-24 07:47:34 +08:00
Robert Carr
7b5408d87a Async BLAST Sync[3/N]: Push sync-id around
We push the syncId around via MSG_RESIZED and via
finishDrawing. We can see the finishDrawing change
is no-op, as it's not used on the server side. Likewise
we can see the MSG_RESIZED change is noop, since even if it
is received, it wont be used unless we call relayoutWindow
in which case it will be overwritten by the one used there. This
change is thus a noop until we actually remove relayout window.

Bug: 161810301
Bug: 175861051
Bug: 175861127
Bug: 200285149
Change-Id: I30627ddad805731109aebeeaf6c74867dcd1ecca
2022-03-23 15:26:11 -07:00
chaviw
48cda45ffa 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
Fixes: 225776224
Change-Id: Idb505b35eef9f99b2f76e9d1f1b26f5c50ed9a90
2022-03-23 15:25:20 -07:00
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
Prabir Pradhan
4f4eece2c4 Ensure handwriting session can only be started from inside app bounds
Initialize the touchable region of the handwriting window to be cropped
to the focused window bounds. This means the handwriting window will
only spy over the app bounds.

When attempting to start a handwriting session, ensure that we are
currently recording a gesture in the handwriting window. This means we
can only start handwriting if the gesture originated within the app
bounds.

When a handwriting session starts, change the touchable region of the
handwriting window to be over the entire display, so that scribbles
outside the app window can sent to the IME.

Bug: 226081811
Test: manual: using test apps in split screen
Change-Id: I95b67ec7be40dc80ed67c91d0ee0b32296e532ca
2022-03-22 15:14:06 +00:00