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
This commit is contained in:
Siarhei Vishniakou
2020-05-03 10:28:37 -07:00
parent 48f0527199
commit ec34675ba7

View File

@@ -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;