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

Commit f29223e3 authored by chaviw's avatar chaviw
Browse files

Re-added Dimmer for IME window container

The dimmer was only set for AboveAppWindowContainers so IME couldn't
add a dim layer. Moved Dimmer so all NonAppWindowContainers can add a
dim layer, which includes AboveAppWindowContainers and IME container.
This also fixes the flicker issue from the bug.

Change-Id: I747eb3db4982f820f8a09b7a184d0467d240b335
Fixes: 72645607
Test: Dim layer appears when using search from IME.
Test: go/wm-smoke-auto
parent cf40a9ab
Loading
Loading
Loading
Loading
+19 −18
Original line number Diff line number Diff line
@@ -3599,8 +3599,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    }

    private final class AboveAppWindowContainers extends NonAppWindowContainers {
        private final Dimmer mDimmer = new Dimmer(this);
        private final Rect mTmpDimBoundsRect = new Rect();
        AboveAppWindowContainers(String name, WindowManagerService service) {
            super(name, service);
        }
@@ -3632,22 +3630,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                imeContainer.assignRelativeLayer(t, getSurfaceControl(), Integer.MAX_VALUE);
            }
        }

        @Override
        Dimmer getDimmer() {
            return mDimmer;
        }

        @Override
        void prepareSurfaces() {
            mDimmer.resetDimStates();
            super.prepareSurfaces();
            getBounds(mTmpDimBoundsRect);

            if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
                scheduleAnimation();
            }
        }
    }

    /**
@@ -3679,6 +3661,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        };

        private final String mName;
        private final Dimmer mDimmer = new Dimmer(this);
        private final Rect mTmpDimBoundsRect = new Rect();

        NonAppWindowContainers(String name, WindowManagerService service) {
            super(service);
            mName = name;
@@ -3722,6 +3707,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        String getName() {
            return mName;
        }

        @Override
        Dimmer getDimmer() {
            return mDimmer;
        }

        @Override
        void prepareSurfaces() {
            mDimmer.resetDimStates();
            super.prepareSurfaces();
            getBounds(mTmpDimBoundsRect);

            if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
                scheduleAnimation();
            }
        }
    }

    private class NonMagnifiableWindowContainers extends NonAppWindowContainers {