From ec34675ba7c911462aa15979cb4b9d6b2dabc314 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Sun, 3 May 2020 10:28:37 -0700 Subject: [PATCH] Provide a timeout for SurfaceControl Currently, the timeout for SurfaceControl is set to "-1", which means that whenever an input event is sent to the view, the view should respond to the input event "yesterday". Now that we are actually enforcing these timeouts in ag/10847700, this is causing any input event going to the SurfaceControl (even the focus events) to time out. Set a proper 5 seconds timeout to make these expectations reasonable. Bug: 143459140 Test: atest android.server.wm.SurfaceControlViewHostTests Change-Id: I3328b8f71e7f7bd2ccc7a3a64eb25589e68b0f05 --- .../core/java/com/android/server/wm/WindowManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 84d749f148fb2..ef329e70bb7e9 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -8044,7 +8044,7 @@ public class WindowManagerService extends IWindowManager.Stub | LayoutParams.FLAG_SLIPPERY); h.layoutParamsFlags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | sanitizedFlags; h.layoutParamsType = 0; - h.dispatchingTimeoutNanos = -1; + h.dispatchingTimeoutNanos = DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; h.canReceiveKeys = false; h.hasFocus = false; h.hasWallpaper = false;