Skip to content

K2GO-584 feat(clone): cable prompts and link row states - #810

Merged
luisguzman-adfa merged 12 commits into
mainfrom
fix/K2GO-584-clone-cable-prompts
Nov 20, 2026
Merged

luisguzman-adfa merged 12 commits into
mainfrom
fix/K2GO-584-clone-cable-prompts

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • USB row says what to do and on which phone: cable found, connecting, tap OK here, access refused, waiting for the other phone (with the step to take on it), linked.
  • One USB permission dialog per device, asked when K2Go is in front again (Files or the system chooser can cover it).
  • Cable keepalive (PING) closes a link whose peer is gone. A peer without PING (older build) stays linked; a slow local disk does not count as a dead peer.
  • The first cable write runs outside the session lock: Stop sharing and Receive no longer freeze the app (ANR).
  • Only a device that can be a phone counts as the cable (not a hub, drive or keyboard); USB tethering mode counts.
  • Sender Wi-Fi row reads its own rsync daemon log: a receiver reached this phone, or finished copying, over Wi-Fi. The log has no file names and is deleted on Stop sharing, Turn off and app start.
  • Wi-Fi rows make no claim before the check, and say the phones do not reach each other instead of "not on this network".

UI changes (added after review)

  • Cable row, phone is the USB device, no link yet:
    • Text: "USB cable connected. Clone links over it when both phones are ready." -> "USB cable connected. If a phone is at the other end, open Clone on it."
    • Badge: "Waiting" -> "Optional"
    • Why: a phone that is only the USB device cannot tell a computer from a phone. The old text promised a link that a computer never starts.
  • New cable row text: "The device on this cable cannot use Clone." Badge: "Not used".
    • Shows for an Apple device, or after 3 refused accessory-mode requests. No permission dialog and no retry until the cable is plugged in again.
    • Covered by unit tests only (no Apple device or refusing phone on hand).
  • Both strings are translated in all 33 locales. The new "present" text was verified on the OnePlus 7T and the Galaxy A16.

Why

  • During cable setup the user could not tell which phone needed an action, and some rows stated things the app had not checked.

Steps to QA

  • Baseline (main): connect two phones by cable at Clone Send step 3 and Receive. The USB row shows only a generic wait, dialogs can stack, and Stop sharing can freeze the app.
  • Change: same setup. Follow the USB row text on each phone and answer the dialogs: both rows reach "Linked". Stop sharing: no freeze; the receiver shows the waiting text within 6 s. Wi-Fi only (sender hotspot, no cable): the sender row shows "reached this phone over Wi-Fi", then "finished copying over Wi-Fi".

Verifications

  • Unit tests: LinkRule, UsbCandidate, PeerAlive, ShareSessions, RsyncConfig (all sync suites pass). Lint: nothing new.
  • Devices: OnePlus 7T and Galaxy A16, both cable roles, physical replug, mixed versions (one phone on main), Wi-Fi only on the hotspot. Evidence goes to the Jira ticket.
  • Coordination: stacked on the row-signals PR (K2GO-584 fix(clone): link rows use amber only when the user must act #808). Merge that first, then retarget this PR to main.

Notes

  • Translations are machine generated; the locale files are marked for human review.

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.
Base automatically changed from fix/K2GO-584-clone-link-row-signals to main November 19, 2026 21:24
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.
@luisguzman-adfa
luisguzman-adfa merged commit e381f38 into main Nov 20, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-584-clone-cable-prompts branch November 22, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant