Commit Graph

16889 Commits

Author SHA1 Message Date
Hongwei Wang
4eaeabe8bd Merge "Pass AppOps result for PiP in RemoteAnimationTarget" into sc-v2-dev 2021-07-31 03:14:11 +00:00
Hongwei Wang
c9a7c24e3e Pass AppOps result for PiP in RemoteAnimationTarget
This result will be used by Launcher when deciding if we should start
the auto-enter-pip transition.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/c9raN4jiaNqbiV7DF4YTJ6
Bug: 194272108
Test: try auto-enter-pip with permission disabled
Change-Id: Iea3a45fd68b54d74e7d5da91b63684c206a0132e
2021-07-30 15:57:39 -07:00
TreeHugger Robot
4a6ae54ab9 Merge "Clarify on return value of IC#setImeConsumesInput()" into sc-dev am: 16065df252
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15429835

Change-Id: I0dcc29bb91482e856d2e86131741693010ec9ba4
2021-07-30 19:00:31 +00:00
Yohei Yukawa
d8c0b18ea5 Clarify on return value of IC#setImeConsumesInput()
This CL aims to clarify on what the return value of

  InputConnection#setImeConsumesInput()

means for both the IME authors and editor authors [1][2].

In short, the semantics is exactly the same as

  InputConnection#performSpellCheck()

hence this CL reuses its @return section.

Other than clarifying an API doc, this CL changes nothing.

 [1]: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318
      30fe6aa964
 [2]: I8ac1ea4d53f747b0086ed415ff90793dfc6155bc
      66b21086e3

Bug: 175362887
Fix: 194099171
Test: presubmit
Change-Id: Ibdfe81a9dd1448856797aaed2f14de1314da1cac
Merged-In: Ibdfe81a9dd1448856797aaed2f14de1314da1cac
(cherry picked from commit f9ca70be57)
2021-07-30 13:49:02 +00:00
Naomi Musgrave
45dd2a3202 MediaProjection captures DisplayArea
MediaProjection is used by apps to capture the contents of
a display. Apps consume the content from a surface passed
in to MediaProjection#createVirtualDisplay. The images
written out to the surface can be used for saving
screenshots of the current display, screen recording,
or casting to a different display.

MediaProjection is currently tied to capturing a physical
display. This change instead captures the DisplayArea
the app is launched on. This is consistent with Display API
sandboxing, which returns the DisplayArea bounds rather
than the physical display bounds.

Note that apps use the Display APIs to size the
VirtualDisplay and output surface.

Verified: screenshots, screen recording, and casting

Bug: 180624777
Test: atest WmTests:DisplayContentTests
Change-Id: I909e9d32f573aec33869d9f49d6caffc8d7420aa
2021-07-30 09:48:42 +00:00
Evan Rosky
adb7e53532 Add some more transition filter properties
These are needed for keyguard transitions. The ones added are:

A NOT requirement which will reject transitions with a matching
change.

The ability to match containers that aren't independent.

Checks for global transition flags as well as individual change
flags.

Match only if container is a task.

Bug: 191799478
Test: atest ShellTransitionTests
Change-Id: I963c6c91cdfc0b71a75ba9656261bb0e237f11f1
2021-07-29 15:05:24 -07:00
Evan Rosky
58fd4834b9 Merge "Enable keyguard remote animation when WMShell is used." into sc-v2-dev 2021-07-28 20:37:38 +00:00
Tiger Huang
0e517ebc04 Merge "Refine the bounds of the wrap-content sides" into sc-v2-dev 2021-07-28 14:51:28 +00:00
Winson Chung
95b87d420e Merge "Add mechanism for a task's windows to be trusted overlays" into sc-dev am: 24706f0654
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15150506

Change-Id: I2f7757dd1a5dff1101f4ee5469312f03ed9dbc9d
2021-07-28 14:46:21 +00:00
Tiger Huang
a7eef6e459 Refine the bounds of the wrap-content sides
Previously, the maximum length the client window can get for the
wrap-content side is the non-decor display width (or height) which
doesn't take the system bar visibilities into account.

This CL gives the wrap-content window more space if any of the system
bars is hidden.

This CL also refines the logic of selecting the fake control target
which is not always the focused window.

Fix: 193978485
Test: Open "Start Recording?" dialog on YouTube in fullscreen mode.
      See if the dialog can fill the screen while its content is not
      fully displayed.
      Swipe down from top, and see if the dialog is shifted down.
Change-Id: I3f7a71729196311e8f7406c6e07f68d23febe9a6
2021-07-28 14:57:34 +08:00
Shawn Lin
f04b9b8231 Merge "[DO NOT MERGE] Support display cutout for multi-display devices" into sc-v2-dev 2021-07-28 06:31:21 +00:00
shawnlin
348c66b52b [DO NOT MERGE] Support display cutout for multi-display devices
- Add a new string array config that stores the unique id of each
  display and when loading the cutout configs we first look up the index
  of the unique id of the added display in the array and use this index
  to load the corresponding cutout configs.
- Add new array configs for every cutout configs.

Bug: 186604541
Test: make
Test: check the device and see if the cutout is correctly set for each
display

Change-Id: I038832795c11cd16969caff5031fa1090493b008
2021-07-28 11:54:43 +08:00
Issei Suzuki
142179fbc8 Enable keyguard remote animation when WMShell is used.
This also adds a WAKE transition type to handle situations where
a showWhenLocked activity is made visible during wake.

Bug: 191799478
Bug: 183993924
Test: atest ActivityStarterTests
Change-Id: I18f9f5a0af41766a52efd87855f6a3b074aa98f1
2021-07-27 10:09:45 -07:00
Tiger Huang
090c0cbcb0 Use InsetsVisibilities to carry requested visibilities
InsetsState contains much more information than visibilities, such as
display frame, display cutout, rounded corners, privacy indicator
bounds, and frames of of insets sources. The control target only needs
to send the requested visibilities to WMS, so it can be too heavy to use
InsetsState.

This CL introduces an new class, InsetsVisibilities, which only contains
which type has which visibility. So it uses less memory, and it is more
efficient on copying and checking the equality.

Fix: 194186241
Test: atest InsetsVisibilitiesTest WindowAddRemovePerfTest
            InsetsControllerTest RegisterStatusBarResultTest
            CommandQueueTest LightsOutNotifControllerTest
            ActivityRecordTests DisplayContentTests
            DisplayPolicyLayoutTests InsetsPolicyTest
            InsetsSourceProviderTest InsetsStateControllerTest
            WindowFrameTests WindowManagerServiceTests WindowStateTests
Change-Id: I86c1b26b4383bfa3b924726d580e5706e13ba735
2021-07-26 21:55:34 +08:00
Winson Chung
954ce27d13 Add mechanism for a task's windows to be trusted overlays
- Exposes a method to set that a certain part of the SF hierarchy is
  trusted, and sets this state for tasks in PIP.

Bug: 191529039
Test: Manual, try using permission dialog while PIP is active

Change-Id: I170cb5a7d22ef569eb36de21cc0bcbef60dd385e
2021-07-21 12:59:50 -07:00
Vishnu Nair
9fd93a4133 Merge "SurfaceView: Update transform hint only if the view is visible" into sc-dev am: 861ba140a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302836

Change-Id: I48261545315b21c41a5c6802f7870e3a946d88ef
2021-07-19 23:29:28 +00:00
Vishnu Nair
861ba140a1 Merge "SurfaceView: Update transform hint only if the view is visible" into sc-dev 2021-07-19 23:17:07 +00:00
Vishnu Nair
bc9be8e428 SurfaceView: Update transform hint only if the view is visible
Transform hint should only be updated when creating the
surface or the view is visible. If the view is not visible, BBQ
will be null. This fixes a NPE in SurfaceView.

Test: go/wm-smoke
Fixes: 193618182
Change-Id: I98a463ae23a93d89ac803e2c2d80ecfd56ca97d2
2021-07-19 09:25:08 -07:00
Sally Yuen
6ee44d7939 Merge "Don't query a null AccessibiiltyNodeInfo when populating ViewStructure" into sc-dev am: ea5ce681f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15305983

Change-Id: Icd17aeb6cdb7b06cf6bb097b225f23f884869ee4
2021-07-16 16:56:04 +00:00
Sally Yuen
ea5ce681f3 Merge "Don't query a null AccessibiiltyNodeInfo when populating ViewStructure" into sc-dev 2021-07-16 16:53:17 +00:00
Sally
3b548655fd Don't query a null AccessibiiltyNodeInfo when populating ViewStructure
Chrome may crash with an NPE

Bug: 193839657
Test: builds
Change-Id: I106bdf80678f9edd6fbd5193d3a79a48c95a1d7a
2021-07-16 01:07:13 +00:00
Rob Carr
e72dd84066 Merge "ViewRootImpl: Use mWindowAttributes directly for BBQ" into sc-dev am: b10b4141a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14908372

Change-Id: I786f43585a19cb157a5b09dd063ae097a2f480e4
2021-07-15 20:33:46 +00:00
Rob Carr
b10b4141a5 Merge "ViewRootImpl: Use mWindowAttributes directly for BBQ" into sc-dev 2021-07-14 16:23:45 +00:00
Robert Carr
e9c2e84d28 ViewRootImpl: Use mWindowAttributes directly for BBQ
The logic we are using to handle the params == null case doesn't make
sense, params=null just indicates nothing was changing on this relayout
and so we avoid passing to WM, not that we should default the format. We
can just use mWindowAttributes directly to avoid this problem.

Test: Existing tests pass
Bug: 190483641
Change-Id: I4a765914eb8ca33a432fc808af96847bb78fb054
2021-07-13 13:22:58 -07:00
Charles Chen
427a66fa71 Merge "Send DA's config directly when attaching to DA" into sc-v2-dev 2021-07-10 05:02:32 +00:00
Tiger Huang
efe2a20ec1 Merge "Use the real behavior to decide the animation" into sc-dev am: 26c159d640
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15232838

Change-Id: I0d3b8ab1074e3e3dcbce151f0b92f9751b079edd
2021-07-09 19:57:04 +00:00
Tiger Huang
26c159d640 Merge "Use the real behavior to decide the animation" into sc-dev 2021-07-09 19:36:27 +00:00
Rob Carr
4718d33ee0 Merge "ViewRootImpl: Fix issue with early draw report in seamless rotation" into sc-dev am: 5f28230d34
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15235723

Change-Id: I49ddbea622e2ff431d86716bf29384e8b8ac09db
2021-07-09 02:55:26 +00:00
Rob Carr
5f28230d34 Merge "ViewRootImpl: Fix issue with early draw report in seamless rotation" into sc-dev 2021-07-09 02:28:27 +00:00
Robert Carr
a93fcc9e33 ViewRootImpl: Fix issue with early draw report in seamless rotation
When we receive RELAYOUT_RES_BLAST_SYNC from the WindowManager, we
trigger reportNextDraw, incrementing the pending draw count by one.
At the moment we unfortunately do this after dispatching callbacks
to SurfaceView. In the span of these callbacks, SurfaceView may
increment and decrement pending draw count, once it reaches zero
we will notify the WM of draw early, terminating the sync operation
without ever waiting for the ViewRootImpl to draw. By processing
RELAYOUT_RES_BLAST_SYNC before emitting the SurfaceView callbacks
we can avoid this issue.

Bug: 191921061
Test: Existing tests pass
Change-Id: I2f1096c9cdc79b89413c3f0bfd9b3054ef45f2d2
2021-07-08 13:23:33 -07:00
Evan Rosky
5b003d97e8 Merge "Hook up split-launch to legacy transition system" into sc-v2-dev 2021-07-08 18:10:40 +00:00
Evan Rosky
5ca3820ae6 Hook up split-launch to legacy transition system
Part 1 of hooking up stage-split to legacy stuff. This
actually routes the legacy remoteAnimation through shell
in order to gather the dividerbar and interract with the
WindowProcessController

Bug: 192279476
Test: atest WindowOrganizerTests.
      use SPLIT_SELECT to launch 2 apps in split and observe.
Change-Id: I4f8802e6eb33f068fae0e4b3c12942bea76e332b
2021-07-08 09:02:59 -07:00
Vishnu Nair
682565243f Merge "SurfaceControl: Query native object for transform hint" into sc-dev am: 07576112d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15191721

Change-Id: I5830ac71715a1b5c6a32033a2641ca91323be20d
2021-07-08 15:57:11 +00:00
Vishnu Nair
07576112d9 Merge "SurfaceControl: Query native object for transform hint" into sc-dev 2021-07-08 15:45:31 +00:00
John Reck
c2697f38cc Merge "Reduce number of weakrefs per frame" into sc-dev am: a8bb119574
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15226230

Change-Id: Id8a534f1b04e1e09eb6ebd3f1d4170ddaab7115f
2021-07-08 15:23:15 +00:00
Tiger Huang
b4eac9b5d6 Use the real behavior to decide the animation
If the appearance or the behavior are not controlled by APIs,
InsetsController will still return the default values, but the
internal logic will access the real value.

Fix: 192635471
Test: Open an app which hides system bars with
      SYSTEM_UI_FLAG_IMMERSIVE_STICKY, but not
      BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE.
Change-Id: I1c2f947e3707fcb4c151c1ad19c9cd16527e11d9
2021-07-08 17:32:28 +08:00
John Reck
b7039c6aa5 Reduce number of weakrefs per frame
Disable end-to-end input latency metric to reduce the
number of JNI WeakGlobalRef acquires per-frame.

Bug: 189738006
Test: Observe trace section no longer appears in calculator
Change-Id: I062dad8e7cec93cca5599e51d2b0b1a1b6e39a07
2021-07-07 19:18:34 -04:00
Charles Chen
eb07884f01 Send DA's config directly when attaching to DA
WindowContext relies on WindowTokenClient#onConfigurationChanged after
calling WMS#attachWindowContextToDisplayArea.
However, it took some time to wait for onConfigurationChanged callback
from the server side so that we may get a stale value right after
creating WindowContext.
This confuses developers especially when the foreground activity is in
size compat mode or freeform because the process config is overridden
by activity's config.
This CL makes #attachWindowContextToDisplayArea return DA's configuration
and applies to WindowContext direcly.
It also benefits WindowProviderService because it can obtain DA's
 configuration before onCreate() based on [1] and this CL.

Bug: 190019118
Bug: 190745506
Test: manual - 1. launch an Activity in size compat mode
               2. create a WindowContext and verify if WindowMetrics
                  matches DA bounds.
Test: atest WindowContextTest WindowContextTests
Test: atest WindowContextControllerTest ContextGetDisplayTest
[1]: dd4a748af0

Change-Id: I8dd3987b731662502bc01e9d2ed67e718ada5f46
2021-07-05 14:02:02 +08:00
Yinglei Wang
1943d7c240 Merge "Allow app usage of AccessibilityInteractionClient#getInstance and clearCache before T" into sc-dev am: 69d877992b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15181867

Change-Id: I9dbabae9045f67d595836608de23065030ee17ba
2021-07-02 21:27:43 +00:00
Yinglei Wang
69d877992b Merge "Allow app usage of AccessibilityInteractionClient#getInstance and clearCache before T" into sc-dev 2021-07-02 21:21:33 +00:00
Vishnu Nair
f4cc95956c SurfaceControl: Query native object for transform hint
When a new SurfaceControl was created, the java object's transform
hint was not updated. This created a mismatch between the java and
native objects resulting in the client getting an incorrect transform
hint. Fix this by making the native object the source of truth for
transform hints.

Test: in landscape mode, dismiss apps and check launcher does not reject buffers
Bug: 191841127

Change-Id: Icc87b8cf8158eedb87eea886392a0460a76c6443
2021-07-02 13:08:33 -07:00
Mark Renouf
f5ff9a0425 Merge "Revert "Revert "Fix mPositionInWindow to not use global coords""" into sc-dev am: 2fe11f121d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15172668

Change-Id: I4dcb7a6bca2038484f5399dc4d3871aff2fb5352
2021-07-02 19:06:15 +00:00
Mark Renouf
2fe11f121d Merge "Revert "Revert "Fix mPositionInWindow to not use global coords""" into sc-dev 2021-07-02 18:54:07 +00:00
yingleiw
81f366110d Allow app usage of AccessibilityInteractionClient#getInstance and clearCache before T
These are needed to have a workaround fix for a11y cache filled with
stale data before android T.

NoNonSdkCheck: set maxTargetSdk to S in UnsupportedAppUsage is not allowed yet.

Bug: b/192110374

Test: it builds fine.
Change-Id: Iaa0f68b2b8e4702f6b638cb3060714a22850af7e
2021-07-02 16:58:59 +00:00
TreeHugger Robot
3760ff5953 Merge "Switch back to sync IInputMethodManager" into sc-dev am: 4e944d4634
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15176334

Change-Id: I98fc3154d5384ac6c0d75428c059d6fe8e4c7b68
2021-07-02 15:37:19 +00:00
TreeHugger Robot
4e944d4634 Merge "Switch back to sync IInputMethodManager" into sc-dev 2021-07-02 15:22:21 +00:00
Yohei Yukawa
9dde701446 Switch back to sync IInputMethodManager
This CL logically reverts recent CLs [1][2][3][4][5][6][7][8][9] to
switch back to the previous sync IPC approach in IInputMethodManager
except for the following two IPCs.

 * reportPerceptibleAsync
 * removeImeSurfaceFromWindowAsync

Reason for revert:
We need more time to understand its performance implications.

 [1]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1
 [2]: If79e063641a01b325c63eb9f871f5b992d7c0b72
      5a5648dcb5
 [3]: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
      d833f0dab4
 [4]: I646ef4ae0570aae1812ea267f309441fdec6938d
      38fd020616
 [5]: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
      4a820ccc41
 [6]: Id516fd1c961f43ac3e139c88d7ed004c188d458b
      0a32fd21ef
 [7]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
      c4663ba6a9
 [8]: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
      f226a79fee
 [9]: Ic584203c1221fbae17f5e2d8f09e3992df061646
      5e2d9f271d

Bug: 163453493
Bug: 174892351
Fix: 190486491
Test: atest CtsInputMethodTestCases
Change-Id: If16ac0de536d9089eb04f6e07b1ee47378124658
Merged-In: If16ac0de536d9089eb04f6e07b1ee47378124658
2021-07-02 07:06:07 +00:00
Joanne Chung
da14b09d4b Merge "Fix translation reference gone problem." into sc-dev am: 3d088cbb09
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15172174

Change-Id: If5e44d08cf649d90380a7ccb14ed833f17d42b14
2021-07-02 04:11:13 +00:00
Joanne Chung
3d088cbb09 Merge "Fix translation reference gone problem." into sc-dev 2021-07-02 03:58:36 +00:00
Charles Chen
56e17bfcd8 Merge "Remove updateImeDisplayId" into sc-v2-dev 2021-07-02 03:20:32 +00:00