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

Commit 05f1d7b3 authored by kenzyun_chen's avatar kenzyun_chen Committed by Steve Kondik
Browse files

force to remove window for BinderDied case

Symptom: some Exiting window still exists for a long time
Root Cause: unknown
Solution: force to remove window for BinderDied case

Change-Id: Ib2ecbcc7beb581a3ffe451a5b9d650389b43230d
parent e406be0d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2765,7 +2765,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // to hold off on removing the window until the animation is done.
        // If the display is frozen, just remove immediately, since the
        // animation wouldn't be seen.
        if (win.mHasSurface && okToDisplay()) {
        if (win.mHasSurface && okToDisplay() && !win.mBinderDied) {
            // If we are not currently running the exit animation, we
            // need to see about starting one.
            wasVisible = win.isWinVisibleLw();
+5 −0
Original line number Diff line number Diff line
@@ -333,6 +333,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    /** Is this window now (or just being) removed? */
    boolean mRemoved;

    /** Is this window going to be removed from binderDied callback? */
    boolean mBinderDied;

    /**
     * Temp for keeping track of windows that have been removed when
     * rebuilding window list.
@@ -1209,9 +1212,11 @@ final class WindowState implements WindowManagerPolicy.WindowState {
                    WindowState win = mService.windowForClientLocked(mSession, mClient, false);
                    Slog.i(TAG, "WIN DEATH: " + win);
                    if (win != null) {
                        win.mBinderDied = true;
                        mService.removeWindowLocked(win);
                    } else if (mHasSurface) {
                        Slog.e(TAG, "!!! LEAK !!! Window removed but surface still valid.");
                        WindowState.this.mBinderDied = true;
                        mService.removeWindowLocked(WindowState.this);
                    }
                }