Commit c395a43
fix: only re-arm location updates when none is active to avoid churn
The early start() path now re-registers for location updates only when there is no active request, so a successful registration is left in place on repeated start() calls (e.g. toggling isShared or permission callbacks) instead of being cancelled and re-registered (which also reset the interval timer). Recovery after a failed first attempt is preserved because the flag is false in that case, and the focus-driven refresh path still re-registers unconditionally to pick up the new interval.
Co-Authored-By: Cursor <cursoragent@cursor.com>1 parent 59df183 commit c395a43
2 files changed
Lines changed: 10 additions & 14 deletions
File tree
- OneSignalSDK/onesignal/location/src
- main/java/com/onesignal/location/internal/controller/impl
- test/java/com/onesignal/location/internal/controller
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 59 | + | |
| 60 | + | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
| |||
202 | 200 | | |
203 | 201 | | |
204 | 202 | | |
205 | | - | |
| 203 | + | |
206 | 204 | | |
207 | 205 | | |
208 | 206 | | |
| |||
224 | 222 | | |
225 | 223 | | |
226 | 224 | | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 177 | + | |
| 178 | + | |
183 | 179 | | |
184 | 180 | | |
185 | 181 | | |
| |||
194 | 190 | | |
195 | 191 | | |
196 | 192 | | |
197 | | - | |
| 193 | + | |
198 | 194 | | |
199 | 195 | | |
200 | | - | |
201 | | - | |
| 196 | + | |
| 197 | + | |
202 | 198 | | |
203 | 199 | | |
204 | 200 | | |
| |||
0 commit comments