Repository navigation
Commit 03c32b5
Stop the sync service when its foreground-service time runs out (#40)
* Stop the sync service when its foreground-service time runs out
Since Android 15, dataSync foreground services may run for 6 hours per
24 hours in the background. When the budget is used up the system calls
Service.onTimeout(), and a service that has not stopped a few seconds
later crashes the app with a RemoteServiceException. SyncService did not
override onTimeout(), so a backend that hangs long enough would crash
the app. Stop the service there, as the platform requires.
* Delete src/app/src/test/java/com/health/openscale/sync/core/service/SyncServiceTimeoutTest.kt
---------
Co-authored-by: OliE <olie.xdev@googlemail.com>1 parent 8a216f6 commit 03c32b5
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
360 | 371 | | |
361 | 372 | | |
362 | 373 | | |
| |||
0 commit comments