Stabilize two gesture navigation tests.

For GestureNavRule, sets gesture navigation mode by overlay, and ignore
switch from Settings since it's hard to ask OEM has the same Settings
app.

For simulate back gesture, inject input event for every 5 ms without
waiting the synchronization in input and window manager. Otherwise the
motion event might be canceled as long press.

Bug: 239210685
Bug: 238996991
Bug: 238379807
Bug: 238164904
Bug: 239154472
Bug: 237725333
Bug: 237753859
Bug: 238038113

Test: set gesture to 3btn mode then screen off before run the tests, to
verify the system gesture can override by GesturenavRule correctly.
Test: set gestures.back_timeout to 50, then verify the motion event
won't be thought as long press when running
atest BackNavigationLegacyGestureTest BackInvokedOnWidgetsTest

Change-Id: Ia329dd54595b6b964570fc992e3f1a2b6878ee84
3 files changed