mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
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:
1 parent
229f015281
commit
542bf11a02
3 files changed
+112
No files matched your search
@@ -201,6 +201,37 @@ func TestParseFocusedWindowPackage(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseEnabledNavOverlay(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
listing string
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "gesture nav active",
|
||||
listing: "[ ] com.android.internal.systemui.navbar.threebutton\n[x] com.android.internal.systemui.navbar.gestural\n[ ] com.android.internal.systemui.navbar.transparent",
|
||||
want: "com.android.internal.systemui.navbar.gestural",
|
||||
},
|
||||
{
|
||||
name: "three-button active",
|
||||
listing: "[x] com.android.internal.systemui.navbar.threebutton\n[ ] com.android.internal.systemui.navbar.gestural",
|
||||
want: "com.android.internal.systemui.navbar.threebutton",
|
||||
},
|
||||
{
|
||||
name: "ignores enabled non-nav overlays",
|
||||
listing: "[x] com.some.other.overlay\n[ ] com.android.internal.systemui.navbar.gestural",
|
||||
want: "",
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
if got := parseEnabledNavOverlay(tc.listing); got != tc.want {
|
||||
t.Errorf("parseEnabledNavOverlay = %q, want %q", got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestAntiFreezeCommands_DisablesFreezersAndExemptsDriver(t *testing.T) {
|
||||
commands := antiFreezeCommands()
|
||||
joined := make([]string, len(commands))
|
||||
|
||||
Reference in new issue
Block a user