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

Commit 463bf0cd authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Clear cached override frame when window removed

When removing a window, the corresponding WindowContainer of a
InsetsSourceProvider will be set to null, instead of directly removing
the provider. We need to clear all recorded information, including the
override frames to make sure the removal in effect to all windows.

Test: See b/252455307
Bug: 252455307
Change-Id: I2e59485fdf25af743afe918525ed5e6872e6fff7
parent 4d80e6f4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ abstract class InsetsSourceProvider {
        mWindowContainer = windowContainer;
        // TODO: remove the frame provider for non-WindowState container.
        mFrameProvider = frameProvider;
        mOverrideFrames.clear();
        mOverrideFrameProviders = overrideFrameProviders;
        if (windowContainer == null) {
            setServerVisible(false);
@@ -234,6 +235,8 @@ abstract class InsetsSourceProvider {
        updateSourceFrameForServerVisibility();

        if (mOverrideFrameProviders != null) {
            // Not necessary to clear the mOverrideFrames here. It will be cleared every time the
            // override frame provider updates.
            for (int i = mOverrideFrameProviders.size() - 1; i >= 0; i--) {
                final int windowType = mOverrideFrameProviders.keyAt(i);
                final Rect overrideFrame;