feat(android): force 3-button nav during runs to prevent app drift

On gesture navigation a fuzzer swipe can trigger swipe-up-home or
edge-back and fling the app off screen. Device-prep now switches to
3-button navigation for the run (no edge gestures; the nav bar's buttons
are systemui-owned and already excluded from action candidates) and
restores the original navigation mode when the run ends. Best effort:
leaves nav untouched if the overlay command is unavailable.
This commit is contained in:
pj committed 2026-06-10 18:59:23 +05:30
1 parent 229f015281
commit 542bf11a02
3 files changed
+112

No files matched your search

+5
View File
@@ -54,6 +54,11 @@ func Execute(ctx context.Context, options Options, stdout io.Writer) error {
if err := android.PrepareDevice(ctx, options.Device, stdout); err != nil {
return err
}
// Switch to 3-button navigation for the run so fuzzer swipes cannot
// trigger the gesture-nav home/back and fling the app off screen;
// restore the original mode when the run ends.
restoreNav := android.ForceThreeButtonNav(ctx, options.Device, stdout)
defer restoreNav()
case "ios":
resolved, err := resolveIOSTarget(ctx, options, stdout)
if err != nil {