From 97f738a9c3db9ec68fb211e470091a37b8ca3c89 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 14 Sep 2021 18:34:08 +0800 Subject: [PATCH] Use sync transaction for insets animation Otherwise if the display is rotating with sync transaction, the insets animation leash may apply the rotated position too early. Bug: 199836343 Test: setprop persist.debug.shell_transit 1; reboot Rotate display and check status/nav bar won't show in weird position before executing rotation animation. Change-Id: I3989da3b689c77829d4f48b36ed14bed4e2ab5a3 --- .../core/java/com/android/server/wm/InsetsSourceProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java index f93e08531b676..767e2c2f19171 100644 --- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java +++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java @@ -267,7 +267,7 @@ class InsetsSourceProvider { && mWin.okToDisplay()) { mWin.applyWithNextDraw(mSetLeashPositionConsumer); } else { - mSetLeashPositionConsumer.accept(mWin.getPendingTransaction()); + mSetLeashPositionConsumer.accept(mWin.getSyncTransaction()); } } if (mServerVisible && !mLastSourceFrame.equals(mSource.getFrame())) { @@ -331,7 +331,7 @@ class InsetsSourceProvider { if (getSource().getType() == ITYPE_IME) { setClientVisible(target.getRequestedVisibility(mSource.getType())); } - final Transaction t = mDisplayContent.getPendingTransaction(); + final Transaction t = mDisplayContent.getSyncTransaction(); mWin.startAnimation(t, mAdapter, !mClientVisible /* hidden */, ANIMATION_TYPE_INSETS_CONTROL);