Repository navigation
K2GO-439 fix(hotspot): request NEARBY_WIFI_DEVICES for LocalOnlyHotspot on targetSdk 35 - #610
Merged
Merged
Conversation
…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.
…K2GO-439-hotspot-nearby-wifi
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.
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:
32, since the hotspot (their only consumer) uses NEARBY on 33+.
and Clone gates both read it instead of hardcoding FINE_LOCATION.
(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).