Skip to content

K2GO-439 fix(hotspot): request NEARBY_WIFI_DEVICES for LocalOnlyHotspot on targetSdk 35 - #610

Merged
luisguzman-adfa merged 4 commits into
mainfrom
fix/K2GO-439-hotspot-nearby-wifi
Oct 2, 2026
Merged

luisguzman-adfa merged 4 commits into
mainfrom
fix/K2GO-439-hotspot-nearby-wifi

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

At targetSdk 35 the SIM-less sharing hotspot (LocalOnlyHotspot) stopped starting.

Cause: from API 33 WifiManager.startLocalOnlyHotspot requires NEARBY_WIFI_DEVICES;
ACCESS_FINE_LOCATION only sufficed on API 32 and below. The permission was not
declared or requested, so the call was denied (confirmed on Android 15 and 16).

Changes:

  • Declare NEARBY_WIFI_DEVICES (neverForLocation); scope FINE/COARSE to maxSdkVersion
    32, since the hotspot (their only consumer) uses NEARBY on 33+.
  • Add HotspotPermissions: the single per-API permission rule, unit-tested. The Connect
    and Clone gates both read it instead of hardcoding FINE_LOCATION.
  • On permission-denied, show the retry hint instead of a perpetual "starting"; the hint
    (34 locales, machine-translated pending review) now names both Wi-Fi and the permission.

Verified: unit test, lint and both flavors build; on-device the hotspot starts on a
Samsung A16 (Android 16).

…ot on targetSdk 35

From API 33 startLocalOnlyHotspot needs NEARBY_WIFI_DEVICES; FINE location only
sufficed on 32 and below, so the hotspot failed at targetSdk 35. Add HotspotPermissions
as the single per-API permission source, shared by the Connect and Clone gates, and
reword the failed-state hint away from Location (33 locales, machine-translated).
…slice

Point LocalHotspotManager's doc at HotspotPermissions (not FINE location); note
requiredFor assumes targetSdk >= 33; scope FINE/COARSE to maxSdkVersion 32 (NEARBY
covers 33+); and show the retry hint on permission-denied instead of a perpetual
"starting" (Connect and Clone), the hint now naming Wi-Fi and the permission (34 locales).
…n is granted

Final-review fix: ConnectFragment stayed on "Starting..." when the user granted the permission
in Settings and returned, because onResume re-rendered but never re-ran ensureHotspot(). onResume
now starts the hotspot when mode is HOTSPOT and the permission is already granted (gated so it does
not re-prompt while denied). CloneFragment already recovered via its per-render ensureHotspot.
@luisguzman-adfa
luisguzman-adfa merged commit 6b93cde into main Oct 2, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-439-hotspot-nearby-wifi branch October 2, 2026 07:40
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