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

Commit 12d3ede4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not copy local insets to IME during insets traversal" into main

parents 249d273c 46ca92cc
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -4597,9 +4597,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final SparseArray<InsetsSource> mergedLocalInsetsSources =
                createMergedSparseArray(localInsetsSourcesFromParent, mLocalInsetsSources);

        // Insets provided by the IME window can effect all the windows below it and hence it needs
        // to be visited in the correct order. Because of which updateAboveInsetsState() can't be
        // used here and instead forAllWindows() is used.
        // ForAllWindows is the reliable way to visit the IME window and the windows within this
        // WindowState in the correct order. updateAboveInsetsState doesn't take the real order of
        // IME into account.
        forAllWindows(w -> {
            if (!w.mAboveInsetsState.equals(aboveInsetsState)) {
                w.mAboveInsetsState.set(aboveInsetsState);
@@ -4607,9 +4607,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            }

            if (!mergedLocalInsetsSources.contentEquals(w.mMergedLocalInsetsSources)) {
                // The traversal will reach IME if this window is an IME target window. However, we
                // should not copy the local insets to the IME window. The forAllWindow will reach
                // all IME containers by the logic in {@link #applyImeWindowsIfNeeded}.
                if (!w.mIsImWindow) {
                    w.mMergedLocalInsetsSources = mergedLocalInsetsSources;
                    insetsChangedWindows.add(w);
                }
            }

            final SparseArray<InsetsSourceProvider> providers = w.mInsetsSourceProviders;
            if (providers != null) {