Commit 5cd6ccd
Fix Garmin ConnectIQ crash with malformed messages
Fixes app crash when receiving corrupted or malformed messages from
Garmin ConnectIQ devices that cause IllegalArgumentException or
BufferUnderflowException during deserialization.
Changes:
- IQMessageReceiverWrapper: Changed catch block from specific exception
types to generic Exception to handle all deserialization errors
including wrapped exceptions
- Garmin: Refactored initialization to create wrapped context BEFORE
getInstance() call, ensuring ALL BroadcastReceivers registered by
the SDK (including during getInstance) pass through the wrapper
Root cause: The SDK was receiving the original context in getInstance()
before the wrapper was created, so some receivers bypassed the wrapper's
exception handling. Now the wrapped context is created first and passed
to both getInstance() and initialize().
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 2e0bd25 commit 5cd6ccd
2 files changed
Lines changed: 21 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
| |||
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 164 | + | |
| 165 | + | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| |||
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments