[wm] Drop no focused window ANR request if the activity is stopped

If the activity is in stopped state it will not have a visible
window on screen. In this case drop any ANR request which tries to
blame the app if it's focused without a window. This can happen on
some products which do not have a focused system window when the
display is turned off.

Test: turn of display, send keyevent
Bug: 236763025

Change-Id: I773bcd9b3448654705cdad224ea4426f9545f3cf
This commit is contained in:
Vishnu Nair
2023-02-06 10:16:47 -08:00
parent c949bea2ae
commit 9c09066ff6

View File

@@ -81,6 +81,10 @@ class AnrController {
Slog.e(TAG_WM, "Unknown app appToken:" + applicationHandle.name
+ ". Dropping notifyNoFocusedWindowAnr request");
return;
} else if (activity.mAppStopped) {
Slog.d(TAG_WM, "App is in stopped state:" + applicationHandle.name
+ ". Dropping notifyNoFocusedWindowAnr request");
return;
}
// App is unresponsive, but we are actively trying to give focus to a window.