Commit 954f53b
committed
Fixed: Playstore reported a crash for
* Android 15 introduced a limitation where an app can run a foreground service in the background for only `6 hours per day`, unless the user explicitly opens the app again, which resets this timer.
* To prevent this crash, we have overridden the `onTimeout` method in both `DownloadMonitorService` and `HotspotService`, and we now stop the service when the timeout limit is reached.android.app.RemoteServiceException$ForegroundServiceDidNotStopInTimeException.1 parent 55a599a commit 954f53b
File tree
2 files changed
+43
-0
lines changed- app/src/main/java/org/kiwix/kiwixmobile/webserver/wifi_hotspot
- core/src/main/java/org/kiwix/kiwixmobile/core/downloader/downloadManager
2 files changed
+43
-0
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
73 | 92 | | |
74 | 93 | | |
75 | 94 | | |
| |||
core/src/main/java/org/kiwix/kiwixmobile/core/downloader/downloadManager/DownloadMonitorService.kt
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
113 | 134 | | |
114 | 135 | | |
115 | 136 | | |
| |||
358 | 379 | | |
359 | 380 | | |
360 | 381 | | |
| 382 | + | |
361 | 383 | | |
| 384 | + | |
| 385 | + | |
362 | 386 | | |
363 | 387 | | |
364 | 388 | | |
| |||
0 commit comments