Repository navigation
K2GO-587 fix(clone): keep the phones in reach on a shared Wi-Fi - #811
Merged
Merged
Conversation
Send starts on the Wi-Fi network when the phone is on one, so no Wi-Fi Direct group starts for nothing. That group can end a direct Wi-Fi link (TDLS) to the receiver on one side only. The receiver now drops a dead link to the sender and checks a "no" again.
The gateway (router or the sender hotspot) has no direct link, so SenderReach skips the repair there for every caller. A new sender gets a new repair try.
PING every 1 s, three missed PINGs close the link. The cable row showed Linked for 6 to 8 s after the sender app stopped.
Collaborator
Author
|
Added commit a526f33: the cable keepalive finds a lost peer in 3 s, not 6 s QA on OnePlus 7T (host) + OPPO (accessory): force-stop the sender app; the |
DirectLinkRepair (pure JVM, tested): repair only when the sender does not answer (a refusal proves the link works), never toward the gateway, once per run of failed checks. During a copy a 'no' is checked again only while its repair is unused.
PeerAlive owns PING_MS; DEAD_MS = 3 * PING_MS.
The reachability warning at pull start lost the reason when SenderReach replaced the inline socket check.
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
HotspotMode.initialFor). With no Wi-Fi network, it starts the hotspot as before.SenderReach.connect: when the paired sender does not answer, the receiver drops the direct Wi-Fi link (TDLS) to the sender and tries once more, through the router. The gateway (router or the sender hotspot) has no direct link, so there is no repair there.CloneLinkRows) and the pull (SyncStateViewModel) use the sameSenderReach.connect. One repair try per sender, again after a "yes".Why
On a shared Wi-Fi, two phones set up a direct link (TDLS) by themselves under traffic. When the sender then starts a Wi-Fi Direct group (the hotspot), some drivers end their side of that link without telling the receiver. The receiver keeps sending into the dead link: "Sender not found" until Wi-Fi restarts. Reproduced on OnePlus 7T (sender) + Samsung A16 (receiver).
Steps to QA
Baseline (main): both phones on one router Wi-Fi. Sender: Clone > Send (hotspot starts). Receiver: scan the code. Copy over Wi-Fi to the receiver, stop, Send again: the receiver shows "Sender not found" and stays there until Wi-Fi is turned off and on.
Change:
Verifications
HotspotModeTest; full suite passes (:app:testStandardDebugUnitTest).Notes
setTdlsEnabled(peer, false)is a one-time teardown in AOSP (WifiNative.startTdls): no state stays off, so nothing to undo when the receiver leaves Clone.CHANGE_WIFI_STATEis already in the manifest).