android, desktop: withLongRunningApi when needed (#3710)
This commit is contained in:
committed by
GitHub
parent
ab9a6dcab5
commit
5d8bb24d1c
@@ -104,7 +104,7 @@ class SimplexService: Service() {
|
||||
if (wakeLock != null || isStartingService) return
|
||||
val self = this
|
||||
isStartingService = true
|
||||
withBGApi {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
val chatController = ChatController
|
||||
waitDbMigrationEnds(chatController)
|
||||
try {
|
||||
@@ -114,7 +114,7 @@ class SimplexService: Service() {
|
||||
Log.w(chat.simplex.app.TAG, "SimplexService: problem with the database: $chatDbStatus")
|
||||
showPassphraseNotification(chatDbStatus)
|
||||
safeStopService()
|
||||
return@withBGApi
|
||||
return@withLongRunningApi
|
||||
}
|
||||
saveServiceState(self, ServiceState.STARTED)
|
||||
wakeLock = (getSystemService(Context.POWER_SERVICE) as PowerManager).run {
|
||||
|
||||
Reference in New Issue
Block a user