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

Commit fe1703ff authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE when handling unresponsive embedded windows" into main

parents d53f2646 c8979c3b
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -182,12 +182,19 @@ class AnrController {
            }
            windowState = target.getWindowState();
            pid = target.getPid();
            if (windowState != null) {
                // Blame the activity if the input token belongs to the window. If the target is
                // embedded, then we will blame the pid instead.
                activity = (windowState.mInputChannelToken == inputToken)
                        ? windowState.mActivityRecord : null;
            Slog.i(TAG_WM, "ANR in " + target + ". Reason:" + timeoutRecord.mReason);
                aboveSystem = isWindowAboveSystem(windowState);
            } else {
                // Embedded windows without a host window state are assumed to be above 
                // system layers
                activity = null;
                aboveSystem = true;
            }
            Slog.i(TAG_WM, "ANR in " + target + ". Reason:" + timeoutRecord.mReason);
        }
        if (activity != null) {
            activity.inputDispatchingTimedOut(timeoutRecord, pid);