Commit Graph

18585 Commits

Author SHA1 Message Date
TreeHugger Robot
4ab2bc56dd Merge "Make sure to cleanup views that couldn't be added" into tm-qpr-dev am: c01cce0313
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19138536

Change-Id: I7d52c9d73afd051076c6f4516272f7464fa88352
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 21:29:21 +00:00
TreeHugger Robot
c01cce0313 Merge "Make sure to cleanup views that couldn't be added" into tm-qpr-dev 2022-07-12 20:42:06 +00:00
Alex Stetson
82b58cf3a3 Merge "Scale light z value relative to screen size" into tm-qpr-dev am: ed5f49d918
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19197402

Change-Id: I4e34c9333dfe15cf38a3ead28a60d82d17006fb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 18:01:36 +00:00
Alex Stetson
ed5f49d918 Merge "Scale light z value relative to screen size" into tm-qpr-dev 2022-07-07 17:42:00 +00:00
TreeHugger Robot
121abb9c75 Merge "Fix leak of RemoteAccessibilityController through SurfacePackage." into tm-qpr-dev am: b2ba1a1b28
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19154172

Change-Id: Ie61e1294f95c9dbb07b367b3b00d198f252f0b7e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 11:06:35 +00:00
TreeHugger Robot
b2ba1a1b28 Merge "Fix leak of RemoteAccessibilityController through SurfacePackage." into tm-qpr-dev 2022-07-07 10:47:18 +00:00
Tiger Huang
3f5a711d0a Merge "Refine excludeInvisibleImeFrames" into tm-qpr-dev am: 973d686da7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149188

Change-Id: I6e0dfcff1fbe9d12278d43a6d52803e14d2cb67d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 09:35:54 +00:00
Tiger Huang
973d686da7 Merge "Refine excludeInvisibleImeFrames" into tm-qpr-dev 2022-07-07 09:31:05 +00:00
Mark Renouf
1c479ea1eb Merge "Fix crash due to race on close()" into tm-qpr-dev am: faf0b610d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19194567

Change-Id: Ifa6a92cb60683f42afb541a977d255adacf029f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 20:34:56 +00:00
Mark Renouf
faf0b610d3 Merge "Fix crash due to race on close()" into tm-qpr-dev 2022-07-06 20:10:15 +00:00
Alejandro Nijamkin
f167b6fec9 Merge "Adds ViewTreeObserver window visibility listeners" into tm-qpr-dev am: ef6b610b10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19122497

Change-Id: I57e3230f16494253c6145814e2352eacf1fd7767
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 19:50:01 +00:00
Alejandro Nijamkin
ef6b610b10 Merge "Adds ViewTreeObserver window visibility listeners" into tm-qpr-dev 2022-07-06 19:31:20 +00:00
Alex Stetson
670bce215d Scale light z value relative to screen size
On larger screens, having the light z value lower down creates an
undesirable amount of shadow since the source to view angle can be quite
large. By scaling the z position of the source relative to the screen
size, we can avoid these extreme shadows.

Bug: 227425789
Test: run cts -t android.uirendering.cts.testclasses.ShadowTests --module CtsUiRenderingTestCases
Change-Id: I8b7a3fcf93daaa565256a08f38deffed74b24ad4
2022-07-06 18:59:45 +00:00
Mark Renouf
a433556fc0 Fix crash due to race on close()
It's possible for close to be called during local cleanup concurrently
with the remote call.

A recent change (ag/15993920) added a missing Binder.unlinkToDeath
call to close(). This now causes a crash now if the registration
was removed at just the right time in another thread. This synchronizes
access to close() to avoid this.

Bug: 237406501
Test: atest ScrollCaptureConnectionTest
Change-Id: I0126bfac1efdece2e4eff144a44f29a963553b74
2022-07-06 13:09:59 +00:00
Yunfan Chen
ac87a97077 Merge "Make sure to extend insets frame when the bar layout with cutout" into tm-qpr-dev am: 0251a89274
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18910309

Change-Id: I40f61529acaab2d4bce8990a694ee7a54909b19d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 04:40:04 +00:00
Yunfan Chen
0251a89274 Merge "Make sure to extend insets frame when the bar layout with cutout" into tm-qpr-dev 2022-07-06 04:19:58 +00:00
Alejandro Nijamkin
a567fea83e Adds ViewTreeObserver window visibility listeners
Follows the same exact pattern as the window attach and window focus
listeners in the same class.

Bug: 235403546
Test: Verified as part of follow-up systemui CLs
Change-Id: I7c825baf5913e6e0b85f475503639a4d17483d4e
2022-07-04 14:22:34 -07:00
Tiger Huang
f9705dd8b1 Refine excludeInvisibleImeFrames
When adding a window to WMS, its z-order may be higher than IME
initially. And then, WMS will move IME to the top of the new window.
Although IME is invisible during launching an app, that causes a change
in WindowState#mAboveInsetsState. And it would trigger a redundant
onApplyWindowInsets at the client side.

This CL treats null IME source as invisible IME source in
InsetsState#equals when excludeInvisibleImeFrames is true.

Bug: 237749017
Test: Add logs in dispatchApplyWindowInsets, and see if it gets printed
      twice while launching an app.
Change-Id: I5eba7732619f7ceebe3152e81037a43e9ab3d91f
2022-07-04 17:27:59 +08:00
Ahaan Ugale
b5a17e8e5c Fix leak of RemoteAccessibilityController through SurfacePackage.
When a child SurfacePackage is set on a SurfaceView, the view's
RemoteAccessibilityController calls linkToDeath on the SurfacePackage's
IAccessibilityEmbeddedConnection. The death recipient -- the controller
itself -- is unlinked when the Surface is destroyed -- being notified
through a SurfaceChangedCallback registered on the ViewRootImpl.

There are 2 issues there:
* When the SurfaceView is detached, the SurfaceChangedCallback is
  unregistered, so the unlinkToDeath never happens.
* The Surface holding the SurfaceView may never be destroyed, for
  example in the case of the IME.

SurfacePackages sent over ipc seem to be used in only 2 places
currently:
* For inlined autofill suggestions in the input method. This bug causes
  a serious leak here, since the memory is held in 2 persistent
  processes -- autofill Session data in the system server (referenced
  from the SurfaceViews), and SurfaceViews in the IME.
* The Wallpaper app.

For now, this is fixed by using a WeakRef for the
RemoteAccessibilityController. The root cause will be fixed in a
followup change in a later release.

Fix: 183402294
Test: manual:
 * atest CtsAutoFillServiceTestCases:InlineLoginActivityTest\
   --iterations 5
 * Force gc: adb shell kill -10 $(adb shell pgrep ext.services mockime\
   system_server -d '\ ')
 * Rerun that a couple of times so the binder objects get cleared.
 * Check for leaks of autofill.Session in system_server and
   SurfaceViews or RemoteAccessibilityEmbeddedConnection in
   com.android.cts.mockime.
Change-Id: I5447b173313919507969872bdeb7ff3038152c23
2022-07-02 04:25:11 +00:00
Beverly
56ac2e2475 Make sure to cleanup views that couldn't be added
ie: due to BadTokenException or InvalidDisplayException

Previously, only views that were already in the viewhierarchy
before attempted to be re-added would be removed. This makes
sure if the view was newly added, it'll also be removed.
This prevents a memory leak of views.

Test: manually show and cancel multiple toasts,
check the hierachy viewer that no Toast views remain
Fixes: 234694098

Change-Id: I06bbae70c277d0615753edc9ec0a8e7439ad7020
2022-07-01 16:22:24 +00:00
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
Yunfan Chen
2a4fc3c9ba Make sure to extend insets frame when the bar layout with cutout
The private flag to let the layout system know the bar should extend its
requested size by the cutout size is not included in the insets
calculation, and the bar size will have a mis-match if they want to do
so. To modify the calculation of the insets to make them match.

Bug: 236101339
Test: See the bug
Test: atest DisplayPolicyInsetsTests
Change-Id: If76f3325196db7e8ab90d6dc56c9f67e0cd61ca9
2022-06-27 12:52:46 +09: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