Commit Graph

18564 Commits

Author SHA1 Message Date
Chavi Weingarten
caff4c4c32 Merge "Allow canceled draws to get retried for sync" into tm-qpr-dev am: de765a95ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19120050

Change-Id: Iffedae628ade79fc0d1eddbca68cc5fa1138a7e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 13:27:08 +00:00
Chavi Weingarten
de765a95ea Merge "Allow canceled draws to get retried for sync" into tm-qpr-dev 2022-07-01 13:11:49 +00:00
Wale Ogunwale
0b1ab342a8 Merge "Revert "Get rid of double measure"" into tm-dev am: 80832d2efe am: 466a54e4eb am: c8ecb00a83
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19119508

Change-Id: Iee8c2f407f3a58d5984fa9979f9a0044da7314a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 23:31:39 +00:00
Wale Ogunwale
c8ecb00a83 Merge "Revert "Get rid of double measure"" into tm-dev am: 80832d2efe am: 466a54e4eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19119508

Change-Id: If48890cd227b4af541d32f9d0b947d75b510aec7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 23:04:05 +00:00
Wale Ogunwale
80832d2efe Merge "Revert "Get rid of double measure"" into tm-dev 2022-06-29 22:14:24 +00:00
Issei Suzuki
97641ffe50 Merge changes from topic "RemoteAnimationCanceled_with_Occluded-tm-dev" into tm-dev
* changes:
  Set occluded state on remote animation cancel.
  Pass keyguard occluded status in onAnimationCancelled.
2022-06-29 18:03:07 +00:00
Chavi Weingarten
1adc33b5ff Allow canceled draws to get retried for sync
Apps can cancel draws using the PreDrawListener. When this happens during a sync request, we don't allow another draw to happen since we are trying to avoid multiple draw requests until a sync is complete.

This change makes sure we can draw once before respecting the cancelDraw flag sent from WMS. So even if WMS says it can't draw again, we will allow retries if the cancel happened due to PreDrawListener

Test: Apps that cancel draw don't get stuck during sync
Fixes: 236910512
Change-Id: I67742d03b78306855e258f06c1496b2ba29ca74e
2022-06-29 17:36:11 +00:00
Wale Ogunwale
084bac819a Revert "Get rid of double measure"
This reverts commit 4234e6cea8.

Reason for revert: b/231383951

Change-Id: I41cbc5b4c036109cf45463bddb5b5cc12d11f88e
2022-06-29 08:50:17 -07:00
Issei Suzuki
c77d9bda04 Pass keyguard occluded status in onAnimationCancelled.
Test: No visible changes yet. Pass existing tests.
Bug: 235463625
Change-Id: Iabee71bc76e19f20702f8a2739f565aa915f9b52
Merged-In: Iabee71bc76e19f20702f8a2739f565aa915f9b52
2022-06-28 19:12:24 +00:00
Issei Suzuki
56ff35fcf3 Merge "Pass keyguard occluded status in onAnimationCancelled." into tm-qpr-dev am: d5fec58feb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19069535

Change-Id: If20848d0c736897eb3786dd91ce73b5cb5f816af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-28 18:02:53 +00:00
Issei Suzuki
a60723b1c8 Pass keyguard occluded status in onAnimationCancelled.
Test: No visible changes yet. Pass existing tests.
Bug: 235463625
Change-Id: Iabee71bc76e19f20702f8a2739f565aa915f9b52
Merged-In: Iabee71bc76e19f20702f8a2739f565aa915f9b52
2022-06-25 01:36:07 +00:00
Tiger Huang
d20e6a8d27 Merge "Revert "Introduce updateVisibility and updateLayout"" into tm-qpr-dev am: cf1e9e2682
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19009478

Change-Id: Ie4288a66c35ca1c0240b8ed415af022225d5c159
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 03:43:15 +00:00
Tiger Huang
cf1e9e2682 Merge "Revert "Introduce updateVisibility and updateLayout"" into tm-qpr-dev 2022-06-24 03:23:21 +00:00
Tiger Huang
9dbae141fa Merge "Send the attached frame to the client" into tm-qpr-dev am: 228988d5e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17860764

Change-Id: Idb753ae683fee277a5cb10c4872c85d5b1da8b81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 06:32:55 +00:00
Tiger Huang
228988d5e7 Merge "Send the attached frame to the client" into tm-qpr-dev 2022-06-23 06:11:07 +00:00
Tiger Huang
20eb3c91db Revert "Introduce updateVisibility and updateLayout"
This reverts commit:
db407ef12d, and
d8aa7f7882.

Reason for revert:
The surface size would be reduced by mTranslator unexpectedly.

Fix: 233017734
Test: Open a legacy app which has CompatibilityInfo.SCALING_REQUIRED
      and see if the app is cropped.
Change-Id: If830866328a5709cf6856fe840a804b304052003
2022-06-22 21:41:18 +08:00
Chavi Weingarten
a435d43eb2 Merge "Prevent windows from drawing if they're in an active sync set" into tm-qpr-dev am: 7534f6e76f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18716321

Change-Id: I6492531f7ced56d6acfba38043650b90089784b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 22:09:17 +00:00
Chavi Weingarten
7534f6e76f Merge "Prevent windows from drawing if they're in an active sync set" into tm-qpr-dev 2022-06-21 21:52:38 +00:00
Yunfan Chen
4e01e2f250 Merge "Print layout extended by cutout private flag in toString()" into tm-qpr-dev am: d9fa425f92
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18871019

Change-Id: Ia61c121ff1610e380b7501eb404bcef4a4478cab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 06:04:43 +00:00
Yunfan Chen
d9fa425f92 Merge "Print layout extended by cutout private flag in toString()" into tm-qpr-dev 2022-06-21 05:43:03 +00:00
Vadim Caen
c21bb6a1b1 Merge "Prevent callback registration when back flag is disabled" into tm-dev am: 1c6de844ce am: 0592820f44 am: 9e2a134dde
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18794217

Change-Id: Id3181b7f8155aa5e3bda8c1604fd70a0cd290601
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 22:35:13 +00:00
Vadim Caen
9e2a134dde Merge "Prevent callback registration when back flag is disabled" into tm-dev am: 1c6de844ce am: 0592820f44
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18794217

Change-Id: I367c3888b726f0f7c83d382881741478e715d549
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:19:32 +00:00
Tiger Huang
157514510f Send the attached frame to the client
The attached frame is the frame of the parent window that its child
attaches to, as long as the child is not
TYPE_APPLICATION_ATTACHED_DIALOG. It is a factor while computing the
window frame.

Previously, we let the child obtain the attached frame from its parent
view root. However, if the parent and the child are not in the same
process, it can be tricky.

This CL sends the attached frame from the server to the client via
ClientWindowFrames. In this way, the child can compute its window frame
without having to accessing the parent view root.

Bug: 161810301
Bug: 175861127
Test: atest ActivityRecordTests WindowLayoutTests
Change-Id: Ia844a4c927027e305a56114216eaee2bf7933b1f
2022-06-20 21:09:40 +08:00
Vadim Caen
a2e45f1ed1 Prevent callback registration when back flag is disabled
When the enableOnBackInvokedCallback is set to false (or not set),
registering an OnBackInvokedCallback should be a no-op to avoid
overriding the default compat callback.

Test: Manual testing registering a callback on an app with the flag
disabled and doing a back gesture. Currently we don't have test
executing a back gesture so automated tests are not possible

Bug: 235206960

Change-Id: I54d843f11130a78ed5a68cbe4722e601a2086ee1
Merged-In: I54d843f11130a78ed5a68cbe4722e601a2086ee1
(cherry picked from commit aa48dc3c2d)
2022-06-20 11:40:18 +02:00
Vishnu Nair
18627bb02f Merge "Updated OWNERS file" am: 1f02cb71f6 am: 2fb7421c5e am: b8616e8bed am: 47d8c11d13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2128756

Change-Id: I81f2ed7745fb0b4376fb232261aff3616a27b970
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 00:11:27 +00:00
Vishnu Nair
b8616e8bed Merge "Updated OWNERS file" am: 1f02cb71f6 am: 2fb7421c5e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2128756

Change-Id: I3712dc538e0a665b7641b53c82c798dce9b6bfe6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 23:39:53 +00:00
Chavi Weingarten
3768beaf83 Updated OWNERS file
Test: N/A
Change-Id: I413016ac7d4a10c192009d30e3e0f74be986ffbb
2022-06-17 20:07:41 +00:00
Xin Li
195b02b570 Merge "Merge Android 12 QPR 3" 2022-06-16 18:51:54 +00:00
An An Yu
0b81c263d1 Merge "Setup T style clear top transition animation for ActivityEmbedding." into tm-qpr-dev am: 37b3f06461
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18416106

Change-Id: Id6d017d790b39df793a82d2bfbe2f87dec61602f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 21:39:29 +00:00
An An Yu
37b3f06461 Merge "Setup T style clear top transition animation for ActivityEmbedding." into tm-qpr-dev 2022-06-15 21:21:21 +00:00
Yunfan Chen
6bc2232a3c Print layout extended by cutout private flag in toString()
This is missing while introduced the new private flag. To include it and
print it out when it's set to help debugging layout related issue.

Bug: 236101339
Test: LayoutParams#toString()
Change-Id: Ifa37a989f497f6f6d0f4d2ac2f884f83d537c9aa
2022-06-15 18:29:20 +09:00
Louis Chang
f1e4008d9d Merge "Make sure the relayoutWindow is called when Activity restarted" into tm-dev am: 909495e9d6 am: 046ee5ce74 am: c885c27e57
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18886507

Change-Id: Icc6d5af78ba520240a14aa3234df928e9402406b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 06:30:54 +00:00
Louis Chang
c885c27e57 Merge "Make sure the relayoutWindow is called when Activity restarted" into tm-dev am: 909495e9d6 am: 046ee5ce74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18886507

Change-Id: I26d4b5afbc5a00a400a8b54d9d3e205cdcff48ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 06:22:33 +00:00
Louis Chang
e2aa1639a7 Merge "Make sure the relayoutWindow is called when Activity restarted" into tm-dev am: 909495e9d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18886507

Change-Id: Iece28800aa6cb3ad007e155ee594a760e74ae724
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 06:18:43 +00:00
Cheng Shi
3ff201a713 Fix the problem that the turn_screen_on Activity does not draw.
A phone call came when the screen was off, displayState may change from Display.STATE_OFF to STATE_ON before registerDisplayListener, which causes ViewRootImpl.mAttachInfo.mDisplayState of InCallActivity to remain Display.STATE_OFF, which causes performDraw to return directly. So we should update ViewRootImpl.mAttachInfo.mDisplayState after registerDisplayListener.

Bug: 235446909

Change-Id: I60b2da453da0ac5c4df6e5a1040defe4bfe726ec
Merged-In: I60b2da453da0ac5c4df6e5a1040defe4bfe726ec
2022-06-15 01:01:28 +00:00
An An Yu
588e1f94d2 Setup T style clear top transition animation for ActivityEmbedding.
This registers system default clear-top xmls and propagate the
showBackdrop flag.
Test: atest RemoteAnimationsControllerTest
Bug: 221048002

Change-Id: I664f7edd181fd7d625b7010a77cd1f7b58fc3113
2022-06-14 13:36:57 -07:00
Pablo Gamito
77ec5b8c3d Merge "Expose transaction id" into tm-qpr-dev am: e58a36c1c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18799654

Change-Id: I5df72b9e9b2c9db416157067ef7c14ac536ec795
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:06:42 +00:00
Tiger Huang
3e1ad3930f Merge "Replace WindowState#getLayoutingAttrs with LayoutParams#forRotation" into tm-qpr-dev am: f017558a95
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18231784

Change-Id: Id78ec1c17e3375eea1b64f10a5922a2e57edf919
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:05:35 +00:00
Pablo Gamito
e58a36c1c3 Merge "Expose transaction id" into tm-qpr-dev 2022-06-14 14:41:25 +00:00
Tiger Huang
f017558a95 Merge "Replace WindowState#getLayoutingAttrs with LayoutParams#forRotation" into tm-qpr-dev 2022-06-14 12:36:25 +00:00
Louis Chang
4b91fbf942 Make sure the relayoutWindow is called when Activity restarted
The host visibility was always invisible while making an Activity
window active because the host visibility was updated afterward
(in ActivityThread#handleStartActivity). Therefore, #relayoutWindow
could be skipped and not recreating Surface if the view visibility is
not changed since last traversal.

Bug: 226324982
Test: repro steps on the bug
Change-Id: Id677a375bc2f75b055a9d35c8b8488e97c24eae9
2022-06-14 17:23:42 +08:00
Tiger Huang
c003eacc7c Replace WindowState#getLayoutingAttrs with LayoutParams#forRotation
When LOCAL_LAYOUT is enabled, the client needs to use the params for the
rotation to layout.

Bug: 161810301
Test: presubmit
Change-Id: I41c94970a600a7a4a3d5bcbab9e79adc1d93d72e
2022-06-14 16:31:34 +08:00
Chris Li
68a81a2aca Merge "Fix the problem that the turn_screen_on Activity does not draw." into tm-dev-plus-aosp am: 73bfd93217 am: 8c67207294
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18871668

Change-Id: I4d84bd9ad38d6ef2ea77a0a310710cbe7220999a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 06:57:57 +00:00
Cheng Shi
c6c0d0da5c Fix the problem that the turn_screen_on Activity does not draw.
A phone call came when the screen was off, displayState may change from
Display.STATE_OFF to STATE_ON before registerDisplayListener, which
causes ViewRootImpl.mAttachInfo.mDisplayState of InCallActivity to
remain Display.STATE_OFF, which causes performDraw to return directly.
So we should update ViewRootImpl.mAttachInfo.mDisplayState after
registerDisplayListener.

Bug: 235446909
Test: pass existing
Change-Id: I60b2da453da0ac5c4df6e5a1040defe4bfe726ec
2022-06-14 00:37:24 +00:00
Chavi Weingarten
acc2838241 Merge "Make sure VRI waits for SV to draw before report" into tm-dev am: 4c2c7ebfaa am: 1ee9e52fe4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18820396

Change-Id: I8284e93eeac89f6693ccef251ceda92db41d0b85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 23:38:17 +00:00
chaviw
d1ada44ddb Prevent windows from drawing if they're in an active sync set
If a window is in a sync, but it already drew it's sync buffer, it
normally would be allowed to continue processing draws and just block
when it runs out of buffers. It would unblock once the sync is complete
at the sync buffer was sent to SF. However, this has a few issues

1. In some cases, WMS wants to retry the draw again due to configuration
   changes. This could cause deadlocks because the client may already be
   blocked since there are no more buffers. Instead, the client will
   block and WMS would be responsible for dropping the last buffer and
   notifying the client that it can draw for a sync again

2. If there are multiple UI threads, each can block each other due to
   the shared Render Thread. If one of the windows in the sync continues
   to draw and then blocks RT due to no more buffers, all other UI
   threads are unable to draw. If the behavior in 1 is desired, we'd
   need to make sure no one in the same sync continues to draw until
   everyone is complete. This is to ensure dropping will actually allow
   another render to occur. If other windows are blocking the RT, then
   even with dropping, the requested sync window cannot get another buffer
   and will cause a deadlock.

Test: Current sync requests work
Bug: 233625646
Change-Id: I3a0a4f36bf61a6677507672578e447060b806651
2022-06-13 13:21:55 -07:00
Tiger Huang
12b430a7a0 Merge "Fix InsetsState#calculateUncontrollableInsetsFromFrame" into tm-qpr-dev 2022-06-13 12:28:18 +00:00
Yunfan Chen
7ced0e2438 Refine the provide insets parameters
There're 3 different parameters trying to affect the insets provided by
a window and can be set independently but are related. This change will
make a new class InsetsFrameProvider to let the window set all the
information needed for the insets at the same place.

Besides, this change also extends the insets calculation logic to
support more use cases. With this, the bars can provide insets outside
of its window frame as well.

Test: atest DisplayPolicyLayoutTests
Bug: 161689946
Bug: 232044523
Merged-In: I7059b3a222745818b6852a288416e197e2afd7b2
Change-Id: I7059b3a222745818b6852a288416e197e2afd7b2
2022-06-13 03:13:37 +00:00
chaviw
783ae3c7d9 Make sure VRI waits for SV to draw before report
VRI is not currently waiting for SV to draw since SV may start its draw
before VRI opened the SyncSet. If that happens, VRI will not include SV
in its SyncSet and report draw finished even if SV is not complete.

This fix has SV create its own SyncSet when redrawNeeded. Then if VRI
creates a sync, SV will merge its own SyncSet into that one. If SV
already finished drawing, then nothing will get merged, but it means SV
is ready already. If SV is not finished, VRI will now also wait for SV's
draw to finish before calling finishDraw.

Test: Long delay in surfaceRedrawNeededAsync
Test: SurfaceSyncerTest
Bug: 230998394

Change-Id: I44331b8f54951e6dc633a4845bbf690abde0f95e
2022-06-10 12:15:00 -05:00
Pablo Gamito
0ada73d3f5 Expose transaction id
We will need to dump the transaction id in transition traces to be able to reliably associated the start and end of a transition to the states in the SF trace.

Bug: 230462538
Test: N/A
Change-Id: I2a040503d9e1f4f4636549bae6b7fe12d5632049
2022-06-10 11:05:49 +00:00