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

Commit 45d66518 authored by Pan Fang's avatar Pan Fang Committed by Gerrit - the friendly Code Review server
Browse files

WindowManager: remove freezing window to fix UI freezing issue

 In some corner case, some window is at exiting state, but can't be
 removed. This will result the windownmanger fall into freezing state.
 The fix will remove this exiting window when encounter this case.

CRs-Fixed: 803491
Change-Id: I8ba72ab0566e9d13a0405be1fa4472f826d0af50
parent ab62e68d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ public class WindowManagerService extends IWindowManager.Stub
    private static final String SIZE_OVERRIDE = "ro.config.size_override";

    private static final int MAX_SCREENSHOT_RETRIES = 3;
    private static final int WINDOW_EXITING_TIME_OUT = 6000;

    // The flag describing a full screen app window (where the app takes care of drawing under the
    // SystemUI bars)
@@ -9675,6 +9676,11 @@ public class WindowManagerService extends IWindowManager.Stub
                final int N = windows.size();
                for (i=N-1; i>=0; i--) {
                    WindowState w = windows.get(i);
		    if(w.mExiting && (w.mLastFreezeDuration > WINDOW_EXITING_TIME_OUT)
                        && w.mInputChannel == null) {
                        removeWindowInnerLocked(w.mSession, w);
                    }

                    final TaskStack stack = w.getStack();
                    if (stack == null && w.getAttrs().type != TYPE_PRIVATE_PRESENTATION) {
                        continue;