From e614fc5e8eeac06cc6a9c2b8d2aeda921eb44907 Mon Sep 17 00:00:00 2001 From: Tiger Date: Tue, 6 Jun 2023 20:35:15 +0800 Subject: Use the same transaction to set position of the leash When a leash of an insets source is being created, it's initial position would be set in InsetsSourceProvider.ControlAdapter#startAnimation. And then, when the position changes, the new position would be set in InsetsSourceProvider#onPostLayout. Both places should use the same transaction. Otherwise, there is no guarantee which transaction will be applied first. Fix: 282880421 Test: Fold and unfold a foldable device. See if taskbar stays at bottom. Change-Id: Ib959e91dd25bf1ddb34b25aecda45ffcd396c4c6 --- services/core/java/com/android/server/wm/InsetsSourceProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java index 1a322ff0196f..5e2618b00e2e 100644 --- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java +++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java @@ -454,7 +454,7 @@ class InsetsSourceProvider { if (mSource.getType() == WindowInsets.Type.ime()) { setClientVisible(target.isRequestedVisible(WindowInsets.Type.ime())); } - final Transaction t = mDisplayContent.getSyncTransaction(); + final Transaction t = mWindowContainer.getSyncTransaction(); mWindowContainer.startAnimation(t, mAdapter, !mClientVisible /* hidden */, ANIMATION_TYPE_INSETS_CONTROL); -- cgit v1.2.3-59-g8ed1b