Commit 64cf0f9
fix: add timeout to BLE RSSI polling to prevent ANR
Uses withTimeout(5.seconds) instead of Dispatchers.IO to prevent the
main thread from blocking indefinitely when readRssi() hangs. This approach:
- Keeps the operation on the appropriate dispatcher (the BLE library manages threading)
- Breaks out of the polling loop if RSSI read times out or fails
- Prevents 5-second ANR without affecting BLE connection flow
Previous approach (Dispatchers.IO) was interfering with connection state observation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 71d9caf commit 64cf0f9
File tree
1 file changed
+9
-1
lines changed- app/src/main/java/com/geeksville/mesh/ui/connections/components
1 file changed
+9
-1
lines changedLines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | 85 | | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
| |||
0 commit comments