Repository navigation
K2GO-584 feat(clone): cable prompts and link row states - #810
Merged
Merged
Conversation
The USB row says what to do and on which phone: cable found, connecting, tap OK here, access refused, waiting for the other phone, linked. One permission dialog per device, asked when K2Go is in front again. A keepalive closes a link whose peer is gone.
The first USB write blocks while the other phone does not read. Holding the lock there froze stop() and watch() on the UI thread (ANR on Stop sharing and on Receive). Peer texts also name the USB dialog on the other phone.
A closed mux is never kept as the live link; closeLink() also closes a link still in its first write. The first-frame ack is a PING, so it cannot close open channels. The permission dialog is asked again only when K2Go comes back without an answer. One enum for the cable state.
Silence closes the link only after the peer sent a PING, so a K2Go without the keepalive stays linked. Time spent writing to the local rsync socket is not counted, so slow storage does not drop a healthy link.
One rule (UsbLink.mayBePhone) decides if a USB device can be the other phone, for the link and for the cable row; USB tethering mode counts. A finished copy clears its pairing, so the next Receive does not test the old sender.
The 7 cable and Wi-Fi row strings move from strings_untranslated.xml to strings.xml in all 33 locales; the unused usb_waiting string is removed.
The share daemon writes a minimal log (sessions and a bare "send" per file, no file names) that the sender row reads: a receiver reached this phone, or finished copying, over Wi-Fi. The log is deleted on Stop sharing and Turn off. A Wi-Fi row makes no claim before it checks the sender's address, and says the phones do not reach each other instead of "not on this network".
A process that died while sharing leaves the daemon log behind; the next start deletes it. The Wi-Fi row reads the paired address once.
Three new Wi-Fi row strings in all 33 locales, and the new "phones do not reach each other" text; strings_untranslated.xml is empty again.
A phone that is only the USB device cannot tell a computer from a phone at the other end, so the plain cable text no longer says Clone will link. A device without accessory mode (Apple, or three refused switch requests) shows that it cannot use Clone, with no permission dialog and no retry until a replug.
Any switch failure counts, so the cable row cannot stay on "Switching". Only the device that leaves the bus gets new tries. The rule lives in SwitchRefusals, with unit tests.
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.
What changes
UI changes (added after review)
Why
Steps to QA
Verifications
Notes