mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Merge pull request #6547 from element-hq/feature/bma/fixCrashInFetchPushForegroundService
Fix crash in FetchPushForegroundService: No super method onTimeout
This commit is contained in:
+5
-1
@@ -106,7 +106,7 @@ class FetchPushForegroundService : Service() {
|
|||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
delay(wakelockTimeout)
|
delay(wakelockTimeout)
|
||||||
onTimeout(startId)
|
onTimeoutAction(calledByTheSystem = false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,11 @@ class FetchPushForegroundService : Service() {
|
|||||||
|
|
||||||
override fun onTimeout(startId: Int) {
|
override fun onTimeout(startId: Int) {
|
||||||
super.onTimeout(startId)
|
super.onTimeout(startId)
|
||||||
|
onTimeoutAction(calledByTheSystem = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun onTimeoutAction(calledByTheSystem: Boolean) {
|
||||||
|
Timber.d("onTimeoutAction, calledByTheSystem: $calledByTheSystem, isOnForeground: $isOnForeground")
|
||||||
if (isOnForeground) {
|
if (isOnForeground) {
|
||||||
Timber.d("Wakelock timeout reached, stopping FetchPushForegroundService")
|
Timber.d("Wakelock timeout reached, stopping FetchPushForegroundService")
|
||||||
coroutineScope.launch { pushHandlingWakeLock.unlock() }
|
coroutineScope.launch { pushHandlingWakeLock.unlock() }
|
||||||
|
|||||||
Reference in New Issue
Block a user