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

Commit 0319e06c authored by Li Li's avatar Li Li
Browse files

Kill the app if it fails to set visibility

If any window is out of sync in visibility, it's fine to kill.
WM will catch the exception in resumeTopActivity() and restart it.

Bug: 231624308
Test: drain async binder buffer and verify WM kills and restarts app.

Change-Id: Id382f92da946a68ec0b1548a0597bed5602c49fa
parent 646b0c13
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3468,7 +3468,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    "Setting visibility of " + this + ": " + clientVisible);
            mClient.dispatchAppVisibility(clientVisible);
        } catch (RemoteException e) {
            // The remote client fails to process the visibility message. That means it is in a
            // wrong state. E.g. the binder buffer is running out or the binder threads are dead.
            // The window visibility is out-of-sync that may cause blank content or left over, so
            // just kill it. And if it is a window of foreground activity, the activity can be
            // restarted automatically if needed.
            Slog.w(TAG, "Exception thrown during dispatchAppVisibility " + this, e);
            android.os.Process.killProcess(mSession.mPid);
        }
    }