Repository navigation
fix(gateway): keep touches from pausing a task before its background display opens - #135
Merged
Merged
Conversation
…display opens A touch on the phone's own screen paused a background-display task, and put the person in control until Hand back, whenever the task's display was not open at that moment: while phone_connect was still opening it, or after the phone dropped (as Wi-Fi ADB does) and before the next call opened another. Person control outlives the task, so the next task on a background display started paused too, and only Hand back on the computer cleared it (#131). A touch now counts as use of the phone's own screen for any task meant to run on a background display, open or still to open. When the display then cannot open and the task moves to the phone's own screen, a person who used that screen in the last minute keeps it until they hand it over, as when an app refuses the display. The Take over button, and a touch during a task on the phone's own screen, still pause until Hand back, across tasks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #131
What happened
A touch on the phone's own screen is meant never to pause a task that works on a background display (README;
takeOveronly notespersonAtthen). ButtakeOverdecided that byl.bg != nil, whether the display was open at that moment. It is not open:phone_connectis still opening it (a few seconds on a real phone), andsetOfflinesetsl.bg = niland the next call opens another).A touch in either window took the
byInputpath for an own-screen task:d.person = true, the task paused. Since person control belongs to the device and only Hand back clears it, the next background task (phone_connectwithoutown_screen) also started paused, with "The person is in control…; call phone_handoff", and only Hand back in the desktop app cleared it: the state in #131.A touch after
phone_release, with no task holding the phone, does not pause anything (tested);Releaseends the lease at once, so there is no lingering lease there.Change
lease.background(): the task works on a background display, open or still to open (l.bg != nil || l.bgWanted && !l.bgOff).takeOveruses it, so such touches only notepersonAt.readyScreen: when the display then fails to open and the task falls to the phone's own screen, a person who used that screen in the last minute keeps it until they hand it over, asleaveForPhonealready does when an app refuses the display. Without this the fix would let an agent take a screen the person was just touching.Unchanged on purpose: the Take over button, and a touch during a task on the phone's own screen, keep the person in control across tasks until Hand back (the issue asks that an explicit Take over never be cleared automatically).
Tests
TestBackgroundTaskAfterTouches(internal/gateway/bgperson_test.go), with a fake Android phone that has background displays:user_took_over, next task pausedextraDevgets abgOpeninghook to touch while a display opens.make checkpasses.Not done
The issue's request, a Hand back control in Pinky on the Android phone, is left to the owner.
Suggested release notes
🤖 Generated with Claude Code