From e136320e8bd2fab9b422ef5c93bdc4d6fdeefc4f Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Mon, 8 Nov 2021 23:52:42 +0800 Subject: [PATCH] Attempt to fix updateImeParent transaction synchronized issue As DC#assignChildLayers is now use getSyncTransaction() to merge layers transaction. In case updateImeParent() using getPendingTransaction() to reparent/assignRelativeLayer for IME container that may not sync with the layer computation, uses getSyncTransaction() in updateImeParent() to ensure all the layer assignments can apply in the same transaction. Bug: 204242389 Test: manual as issue steps with enabling shell transiion Change-Id: I1c5eaa1d68a7e9e313fdbf23ed77c9cbef1f1d16 --- services/core/java/com/android/server/wm/DisplayContent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index d1e9d6b600384..55ac445988230 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -4165,10 +4165,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp final SurfaceControl newParent = computeImeParent(); if (newParent != null && newParent != mInputMethodSurfaceParent) { mInputMethodSurfaceParent = newParent; - getPendingTransaction().reparent(mImeWindowsContainer.mSurfaceControl, newParent); + getSyncTransaction().reparent(mImeWindowsContainer.mSurfaceControl, newParent); // When surface parent is removed, the relative layer will also be removed. We need to // do a force update to make sure there is a layer set for the new parent. - assignRelativeLayerForIme(getPendingTransaction(), true /* forceUpdate */); + assignRelativeLayerForIme(getSyncTransaction(), true /* forceUpdate */); scheduleAnimation(); } }