Commit fda0e07
feat(connections): wire ACCESS_LOCAL_NETWORK request into Connections screen
On Android 17 (API 37) with targetSdk=37, NsdManager.discoverServices() falls
back to the system 'Choose a device to connect' picker on every call when
ACCESS_LOCAL_NETWORK isn't granted. Wire the new core/ui permission helpers
into ConnectionsScreen so users get a proper one-time grant prompt instead of
a per-scan picker. Because ACCESS_LOCAL_NETWORK is in the NEARBY_DEVICES
permission group, users who have already granted Bluetooth permissions are
silently auto-granted with no UI shown.
- Gate ConnectionsScreen network auto-start on the runtime grant so a
previously-persisted networkAutoScan=true does not surface the picker for
users who haven't granted the permission.
- Manual scan toggle now requests the permission before starting and persists
the user's intent so the launcher's onGranted callback can start the scan.
- Add ScannerViewModel.persistNetworkAutoScanIntent for the deferred-start path.
The manifest declaration and core/ui helpers consumed here ship in the separate
permission-gating PR (#5211).
Verified on Pixel 6a / Android 17 / API 37: NSD discovery now runs without the
picker, and the permission is silently auto-granted via the NEARBY_DEVICES
group when Bluetooth perms are already held.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 26c0369 commit fda0e07
2 files changed
Lines changed: 37 additions & 4 deletions
File tree
- feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections
- ui
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
121 | 133 | | |
122 | 134 | | |
123 | | - | |
124 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | | - | |
| 139 | + | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
| |||
263 | 276 | | |
264 | 277 | | |
265 | 278 | | |
266 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
267 | 291 | | |
268 | 292 | | |
269 | 293 | | |
| |||
0 commit comments