mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-12-05 04:44:45 +00:00
android: hold wakelock for 30 seconds after received event was processed, to prevent race condition with incoming call activity. (#6224)
* android: hold wakelock for 45 seconds after event is received * create new lock instances, delay release by 30 seconds * comment
This commit is contained in:
1 parent
98b11b3df1
commit
d1d2e4bc18
3 files changed
+14
-7
No files matched your search
+5
-2
@@ -12,8 +12,11 @@ actual fun getWakeLock(timeout: Long): (() -> Unit) {
|
||||
}
|
||||
}
|
||||
return {
|
||||
wakeLock?.release()
|
||||
wakeLock = null
|
||||
val lock = wakeLock
|
||||
if (lock != null) {
|
||||
if (lock.isHeld) lock.release()
|
||||
wakeLock = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user