Fix android service restart

This commit is contained in:
problematicconsumer
2023-11-09 16:49:07 +03:30
parent 9bea38f605
commit c211b3f77a
2 changed files with 3 additions and 3 deletions

View File

@@ -114,7 +114,7 @@ class MethodHandler(private val scope: CoroutineScope) : FlutterPlugin,
if (restart) {
mainActivity.reconnect()
BoxService.stop()
delay(200L)
delay(1000L)
mainActivity.startService()
return@launch success(true)
}

View File

@@ -180,7 +180,7 @@ class BoxService(
}
if (delayStart) {
delay(200L)
delay(1000L)
}
newService.start()
@@ -195,7 +195,7 @@ class BoxService(
override fun serviceReload() {
status.postValue(Status.Starting)
GlobalScope.launch(Dispatchers.IO) {
runBlocking {
val pfd = fileDescriptor
if (pfd != null) {
pfd.close()