Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cc978fc authored by Riddle Hsu's avatar Riddle Hsu Committed by Gerrit Code Review
Browse files

Merge "Update IME relative layer if it can be the control target" into main

parents c018edbd 06fc801d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4668,6 +4668,17 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            scheduleAnimation();

            mWmService.mH.post(() -> InputMethodManagerInternal.get().onImeParentChanged());
        } else if (mImeControlTarget != null && mImeControlTarget == mImeLayeringTarget) {
            // Even if the IME surface parent is not changed, the layer target belonging to the
            // parent may have changes. Then attempt to reassign if the IME control target is
            // possible to be the relative layer.
            final SurfaceControl lastRelativeLayer = mImeWindowsContainer.getLastRelativeLayer();
            if (lastRelativeLayer != mImeLayeringTarget.mSurfaceControl) {
                assignRelativeLayerForIme(getSyncTransaction(), false /* forceUpdate */);
                if (lastRelativeLayer != mImeWindowsContainer.getLastRelativeLayer()) {
                    scheduleAnimation();
                }
            }
        }
    }

+4 −0
Original line number Diff line number Diff line
@@ -2635,6 +2635,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        return mLastLayer;
    }

    SurfaceControl getLastRelativeLayer() {
        return mLastRelativeToLayer;
    }

    protected void setRelativeLayer(Transaction t, SurfaceControl relativeTo, int layer) {
        if (mSurfaceFreezer.hasLeash()) {
            // When the freezer has created animation leash parent for the window, set the layer
+0 −1
Original line number Diff line number Diff line
@@ -448,7 +448,6 @@ public class ZOrderingTests extends WindowTestsBase {
        mDisplayContent.updateImeParent();

        // Ime should on top of the popup IME layering target window.
        mDisplayContent.assignChildLayers(mTransaction);
        assertWindowHigher(mImeWindow, popupImeTargetWin);
    }