Prevent crash when removing service task if Core isn't alive
This commit is contained in:
parent
b9c178cc29
commit
f3ad232c1f
1 changed files with 11 additions and 9 deletions
|
@ -70,6 +70,7 @@ class CoreService : CoreService() {
|
|||
}
|
||||
|
||||
override fun onTaskRemoved(rootIntent: Intent?) {
|
||||
if (LinphoneApplication.contextExists()) {
|
||||
if (coreContext.core.callsNb > 0) {
|
||||
Log.w("[Service] Task removed but there is at least one active call, do not stop the Core!")
|
||||
} else if (!corePreferences.keepServiceAlive) {
|
||||
|
@ -82,6 +83,7 @@ class CoreService : CoreService() {
|
|||
} else {
|
||||
Log.i("[Service] Task removed but we were asked to keep the service alive, so doing nothing")
|
||||
}
|
||||
}
|
||||
|
||||
super.onTaskRemoved(rootIntent)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue