Commit Graph

18519 Commits

Author SHA1 Message Date
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
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
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
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
Chavi Weingarten
78b2a87d6b Merge "Report sync complete when VRI won't draw" into tm-dev am: 72a26f7912 am: 8ebe22e33b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18775294

Change-Id: I6cd47246a4046e634e1a5189cf15beab41c17a6c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:58:22 +00:00
Chavi Weingarten
72a26f7912 Merge "Report sync complete when VRI won't draw" into tm-dev 2022-06-07 21:14:42 +00:00
Chet Haase
f6541ab73e Pause animators when app is not visible am: b99cc5b4c8 am: f2e66fa4ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528824

Change-Id: I4a220654954199c26f29a93d8afc3ad8a448547e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 20:28:07 +00:00
Chet Haase
f2e66fa4ed Pause animators when app is not visible am: b99cc5b4c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528824

Change-Id: I2b041e112cfa55949a9d3f753388de3536dbd33a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 20:06:35 +00:00
Steven Terrell
a4ac1574bd Merge changes from topic "stop-leaked-animators" into tm-dev
* changes:
  Use System Property to Control Animator Pausing
  Disable debug logging in AnimationHandler
  Allow system to disable behavior of pausing animators for bg apps
  Pause animators when app is not visible
2022-06-07 19:49:48 +00:00
chaviw
71e6329765 Report sync complete when VRI won't draw
There is some checks in performDraw that will skip drawing. For example,
if the display is off or if there's no view. In those cases, we don't
want to wait for a frame since there will be none and instead
immediately report back that the sync for this VRI is complete.

Test: Repro from bug
Fixes: 234426290
Change-Id: I7d5993f9980b9cdafc99a5712e74a4de704aef47
2022-06-07 12:02:07 -05:00
Tiger Huang
2f6389cd28 Merge "Don't set extreme values of Integer to safe bounds" into tm-dev am: 0a194469f0 am: 7f00295029
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18746081

Change-Id: I774a3bb0757ee8e59897eea05b0bce26e2f14877
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 12:41:43 +00:00
Tiger Huang
32dd1b916a Don't set extreme values of Integer to safe bounds
This is to prevent getting unexpected results while calculating the
width or height of the rectangle, due to the overflow.

This CL defines the borders of the window layout with large enough
integers, which are also the borders of the safe bounds.

Fix: 227276622
Test: atest ConfigurationScreenLayoutTest#testScreenLayout
Change-Id: Iee14e6de48f57be4999f64dbdce01815de88a9df
2022-06-06 13:02:59 +00:00
TreeHugger Robot
8e8c28eea2 Merge "Fix modulo div by 0 in Choreographer." into tm-dev am: 6dadf45f60 am: 994032fc1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18718035

Change-Id: I2f73342ddf5ab1e6dfafb2050eb90766eb1b1de7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:12:58 +00:00
TreeHugger Robot
6dadf45f60 Merge "Fix modulo div by 0 in Choreographer." into tm-dev 2022-06-03 19:03:33 +00:00
TreeHugger Robot
2b27ef0a4b Merge "Make GPU duration metrics more accurate for Vulkan" into tm-dev am: 9bcdb76b98 am: 258905ed7e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18639113

Change-Id: Ia75d3e4724d5e91b0ca5cf19d1b2bf402629387f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 06:43:38 +00:00
TreeHugger Robot
9bcdb76b98 Merge "Make GPU duration metrics more accurate for Vulkan" into tm-dev 2022-06-02 06:12:33 +00:00
Rachel Lee
2c303b3f51 Fix modulo div by 0 in Choreographer.
Bug: 234483897
Test: atest ChoreographerTest
Change-Id: I7d7766f6ea120109490d307e971a3da80a3d92ad
2022-06-01 15:24:05 -07:00
Alec Mouri
3afb3972f4 Make GPU duration metrics more accurate for Vulkan
In the Vulkan pipeline, the GPU start time was measured to be when
swapBuffers starts. But the command queue has already been submitted at
this point, which means that the GPU work would already have begun. This
means that it's possible to measure a negative time since for very light
GPU workloads, the GPU fence can fire prior to CPU making it to
swapBuffers().

To compensate, instead measure from after skia completed submitting GPU
commands, until the GPU fence fires. Since it is theoretically possible
for GPU work to complete if the render thread gets descheduled
immediately after submitting the GPU, we also add some clamping to
ensure that the duration from command submission -> completion of GPU
work is nonnegative.

Bug: 230713131
Test: atest android.view.cts.FrameMetricsListenerTest
Change-Id: Ia30b7732eaab71e4e29766f788d5cd94ec63c38a
2022-06-01 21:18:30 +00:00
Chavi Weingarten
beab74891e Merge "Remove lock when calling Surface.destroy" into tm-dev am: 3868362584 am: 9eb9c476f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18674393

Change-Id: I729b871bde2b714f8fb85795af0f3b6aeabfee34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 17:27:04 +00:00
Chavi Weingarten
3868362584 Merge "Remove lock when calling Surface.destroy" into tm-dev 2022-06-01 16:36:34 +00:00
Pablo Gamito
9fd0212e95 Merge "Revert "Revert "Add ability to trace shell transitions""" into tm-qpr-dev 2022-06-01 12:19:49 +00:00
TreeHugger Robot
0232f47db6 Merge "Log why presentation was not shown" into tm-dev am: bd26701a6b am: e25d1148e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18519537

Change-Id: I6a7a3a46319f614e4a13cf73ffdd328714970c08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 09:17:05 +00:00
TreeHugger Robot
bd26701a6b Merge "Log why presentation was not shown" into tm-dev 2022-06-01 08:04:53 +00:00
Ryan Lin
e49dcfca1b Merge "Drop the cloned windows from visible window list" into tm-dev am: 8ef351123b am: 2684945fb5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18659076

Change-Id: Ib2521d2807afeeb61614532957caa48c82785d7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 01:52:06 +00:00
Ryan Lin
8ef351123b Merge "Drop the cloned windows from visible window list" into tm-dev 2022-06-01 01:29:36 +00:00
skxu
48a5cbb2d6 Log why presentation was not shown
Fixes: 219613425
Test: b/233833739
Change-Id: Ic95cc69b912e8144726124ebc8355c2d1e24079e
Merged-In: Ic95cc69b912e8144726124ebc8355c2d1e24079e
2022-06-01 00:10:02 +00:00
chaviw
9e3cd0533f Remove lock when calling Surface.destroy
Surface already has a lock on the native object so it's safe to call
destroy without holding additional locks. This also fixes ANR issues
where an app is still attempting to render when the window is destroyed.

Test: App from bug doesn't ANR
Bug: 234006724
Change-Id: I0d323c03f299e5857d1950870498f3182d019924
2022-05-31 13:48:56 -05:00
Tiger Huang
ea97f83f8f Fix InsetsState#calculateUncontrollableInsetsFromFrame
If a type of insets doesn't provide any insets to a window, the previous
logic would think the type is controllable. This is wrong.

If a type of insets provides the entire inset to a window, the previous
logic would think the type is not controllable when the width or height
doesn't match the display frame. This doesn't make much sense as well.

This CL fixes the issues mentioned above and also refines
WindowInsetsTests. It displays the name (string) of the controllable
types, not the value (number).

Fix: 234426300
Test: WindowInsetsTests
Test: atest InsetsControllerTest
Change-Id: Ice71db61cc4963c6d8489096bec9c295d58bfd78
2022-05-31 13:38:29 +00:00
ryanlwlin
70764c141a Drop the cloned windows from visible window list
Currently the cloned windows is avaialbe from window list,
however the node info from the cloned window is incorrect.
To avoid confusion, we would drop them for a short term solution.

Bug: 230300971
Test: manually test with switchaccess
      adb shell dumpsys accessibility to observe the window list
Change-Id: I7a03376567698a493c9eb5e26d1f3390aacdb408
2022-05-31 13:48:08 +08:00
Pablo Gamito
fcdcd75faf Revert "Revert "Add ability to trace shell transitions""
This reverts commit 0dced9da30.

Reason for revert: Re-land change

Change-Id: I6f0159d239582c655d3a10f57f10a54f42967ebd
2022-05-30 14:42:34 +00:00
Tiger Huang
d95834c214 Merge "Only update the compat system UI visibility if the source is valid" into tm-dev am: 1fab45404b am: 8893bc9d06
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18583184

Change-Id: I887327b4d504f7c9576f11bf263c8e4d942c757e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-30 09:20:07 +00:00
Tiger Huang
1fab45404b Merge "Only update the compat system UI visibility if the source is valid" into tm-dev 2022-05-30 08:40:03 +00:00
Mark Punzalan
b8432ae0ad Merge "Don't clear translation state on temporary detachment." into tm-dev am: 76ba87f909 am: 29e91d3a0a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18624095

Change-Id: Ie2f7e9d9f56c31ba342b790e565b547728524bae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 17:57:31 +00:00
Mark Punzalan
76ba87f909 Merge "Don't clear translation state on temporary detachment." into tm-dev 2022-05-27 17:15:29 +00:00
Mark Punzalan
a695631475 Don't clear translation state on temporary detachment.
Change I97cc418a8 broke translation on apps which use ListView; messages
were re-translated with the animation even while on-screen. A new
message arrival triggers a re-layout which causes the temporary
detachment, which caused translation to be cleared, and the views get
translated again later.

The solution is to NOT clear translation in the case of temporary
detachment. When Views are actually recycled (e.g., by ListView and
RecyclerView), the detachment is permanent/non-temporary.

Bug: 232178488
Test: atest UiTranslationManagerTest
Test: Manual - Verified scrolling and new messages arriving when
translation is enabled. Tested on apps that use ListView and
RecyclerView.

Change-Id: Ibf1be58219c43252e00b06d4c9e27def5bd36fc2
2022-05-26 23:57:13 +00:00
Mark Punzalan
905979b385 Merge "Translate selectable TextViews by temporarily disabling selectable." into tm-dev am: 8bbc7f6554 am: 8f85334591
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18490753

Change-Id: I61c1109f8b7b4cf42bd38ab5fc234959056ca710
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 21:52:49 +00:00
Mark Punzalan
8bbc7f6554 Merge "Translate selectable TextViews by temporarily disabling selectable." into tm-dev 2022-05-26 21:06:34 +00:00
Pihuei Wang
180b752558 Merge "Revert "Add ability to trace shell transitions"" into tm-qpr-dev 2022-05-26 03:14:59 +00:00
Pihuei Wang
0dced9da30 Revert "Add ability to trace shell transitions"
This reverts commit 6ae3b6c67e.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=test_suites_arm64&lkgb=8640544&lkbb=8644278&fkbb=8640550, bug b/233875239

Change-Id: I44da4fc6d4f7ae585c122624e5cbe7838cd2a71f
2022-05-26 03:08:10 +00:00
Mark Punzalan
6758b3f7e7 Translate selectable TextViews by temporarily disabling selectable.
The text is not selectable while translated. Making translated text
selectable requires many more changes.

This was tested in Nextdoor in the feed/posts activity. When there is a
"Read more" link in the post, the link doesn't work while translated,
and doesn't behave the same way after translation is paused.

Bug: 202966891
Test: atest CtsTranslationTestCases
Test: Manually - with Nextdoor on feed and chat activities
Change-Id: I6e8f532d427d85ff22df0deb248d8416a15f4821
2022-05-25 20:03:10 +00:00
Pablo Gamito
1abf474563 Merge "Add ability to trace shell transitions" into tm-qpr-dev 2022-05-25 10:31:00 +00:00
Tony Huang
4f8c3f0841 Merge "Remove the special logic of the divider bar z-ordering" into tm-qpr-dev 2022-05-25 02:01:26 +00:00
TYM Tsai
8a29813f8a Merge "Fix inline tooltip position is wrong" into tm-dev am: edca30dce8 am: 34fe95788a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18350147

Change-Id: I21e50d80c9d89a661100e509bebbf12b409092eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 01:56:28 +00:00
TYM Tsai
edca30dce8 Merge "Fix inline tooltip position is wrong" into tm-dev 2022-05-25 01:05:17 +00:00