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

Commit c13b5436 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Re-added Dimmer for IME window container"

parents aea047a2 f29223e3
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 {