You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 28cfda9
Browse filesBrowse the repository at this point in the historyBrowse files
`attempt_connecting()` returns `None` without trying when another WiFi operation is running. `None` is falsy, so code that only checks `if success:` treats it as a failed attempt.
65
+
57
66
### Managing Saved Networks
58
67
59
68
```python
@@ -135,12 +144,12 @@ class WifiSettingsActivity(Activity):
WifiService runs one radio operation at a time. `auto_connect()`, `attempt_connecting()`, `scan_networks()` and `temporarily_disable()` each hold the class-level `wifi_busy` flag while they run. While another operation holds it:
219
+
220
+
| Method | While busy |
221
+
|--------|------------|
222
+
|`attempt_connecting()`| Returns `None` without trying |
223
+
|`scan_networks()`| Returns `None` (a scan that finds nothing returns `[]`) |
ConnectivityManager's periodic reconnect is skipped while the flag is held, so it can't interrupt a scan or a connect started by an app.
231
+
232
+
`is_busy()` tells you whether an operation is running, but the flag can change between that check and your call. Check the `None` return values instead of relying on `is_busy()` alone.
233
+
207
234
## API Reference
208
235
209
236
### Connection Functions
@@ -223,7 +250,7 @@ Scan for available networks and connect to the first saved network found.
0 commit comments