Gamepad API (Android): axes/triggers stuck after notification shade

#575985357 CL 8688418 Blink>GamepadAPI P3

The bug

On Android, when system UI interrupts Chrome while a gamepad stick or analog trigger is deflected (notification shade pulled down, screenshot overlay), the Gamepad API keeps reporting the stale axis values after the interruption ends -- until the axis is physically moved again. Buttons recover correctly; only axes freeze.

The framework synthesizes canceled key-up events for held buttons on window focus loss, but there is no equivalent "canceled" MotionEvent for axes, so GamepadDevice.mRawAxes keeps the last deflection and keeps being reported with fresh timestamps.

Live tester

Connect a controller (Bluetooth or USB) and press any button.

press any gamepad button to start

Procedure

1. Hold the left stick fully right (axis0 → +1.000, status turns red)

2. Keep holding, pull down the notification shade

3. Release the stick while the shade is open

4. Close the shade

fixed all axes snap to 0.000, status turns green

bug axis0 stays ~1.000 (red) until the stick is moved again

Event log

The fix

CL 8688418 forwards WindowEventObserver.onWindowFocusChanged from content's Gamepad.java to GamepadList, which clears all gamepad data on focus loss via the existing GamepadDevice.clearData() -- the same reset used when a device detaches.

Verified on a Pixel 6a with an Xbox Bluetooth controller: the patched build snaps axes to 0 after the shade closes; stock Chrome keeps the stale ~1.0 axis.