Skip to content

K2GO-561 fix(clone): stop the Clone hotspot when sharing ends; receive never reaches itself - #752

Merged
luisguzman-adfa merged 6 commits into
mainfrom
fix/K2GO-561-clone-hotspot-teardown
Nov 8, 2026
Merged

luisguzman-adfa merged 6 commits into
mainfrom
fix/K2GO-561-clone-hotspot-teardown

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What changes

  • Clone send releases the Wi-Fi Direct hotspot on Stop sharing, on a switch to Wi-Fi and on leaving Clone.
  • LocalHotspotManager records who holds the hotspot (Connect, Clone, Content Exchange share). The last release() stops it. This replaces the per-feature ownership flags.
  • Clone receive stops the own hotspot and waits until the sender address is not local before it probes (same guard as Content Exchange receive). The local-address check moves to NetworkInterfaces.isLocalAddress.
  • The hotspot band defaults to Automatic (was 2.4 GHz). A stored choice is kept.
    (UI changes: no string added or changed. A new install shows "Automatic" in Settings > Hotspot > Wi-Fi band.)

Why

  • A Wi-Fi Direct group left up made a later receive reach its own 192.168.49.1, and slowed Wi-Fi to about 1 MB/s.
  • A 2.4 GHz group next to 5 GHz Wi-Fi makes the radio split time between two channels: Clone over the hotspot ran at about 3 MB/s. Automatic puts the group on the channel of the connected Wi-Fi.

Verifications

  • OnePlus 7T -> Samsung A16 on device:
    • The group goes down on the switch to Wi-Fi and on Stop sharing.
    • Clone over Wi-Fi: about 50 MB/s.
    • Clone over the hotspot with the group on the Wi-Fi channel: about 44 MB/s (was about 3 MB/s on 2.4 GHz).
    • Automatic picked 5240 MHz, the channel of the connected Wi-Fi.
  • HotspotBandTest passes.

Notes

  • Deferred: the group still outlives a process death (force-stop or OOM kill) during a send. Related: K2GO-470.

…e never reaches itself

Clone send stops the Wi-Fi Direct group it started on Stop sharing, on a switch to Wi-Fi and on leaving Clone. A left-up group made a later receive reach its own 192.168.49.1 and slowed Wi-Fi to about 1 MB/s. Clone receive stops the own hotspot and waits until the sender address is not local, as Content Exchange receive does; the local-address check now lives in NetworkInterfaces.
… hotspot

Connect, Clone and Content Exchange share acquire and release the shared hotspot; the last release stops it. Replaces the per-feature ownership flags, which a recreated Clone screen lost mid-send.
…er phase

postConnecting is async, so the probe thread read IDLE and quit; the receiver stayed on Connecting. Cancel now clears the pending creds instead.
A fixed 2.4 GHz group next to 5 GHz Wi-Fi makes the radio split time: Clone over the hotspot ran at ~3 MB/s. Automatic follows the connected Wi-Fi channel (~44 MB/s). A stored choice is kept.
@luisguzman-adfa
luisguzman-adfa merged commit 54e1961 into main Nov 8, 2026
3 of 5 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-561-clone-hotspot-teardown branch November 8, 2026 10:56
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