mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fixed crash reported on Crashlytics
This commit is contained in:
parent
9c5353e2a6
commit
a3340125cb
3 changed files with 9 additions and 3 deletions
|
|
@ -70,6 +70,10 @@ class LinphoneApplication : Application() {
|
|||
coreContext = CoreContext(context, corePreferences.config)
|
||||
coreContext.start()
|
||||
}
|
||||
|
||||
fun contextExists(): Boolean {
|
||||
return ::coreContext.isInitialized
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import android.content.BroadcastReceiver
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.compatibility.Compatibility
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
package org.linphone.core
|
||||
|
||||
import android.content.Intent
|
||||
import org.linphone.LinphoneApplication
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.LinphoneApplication.Companion.ensureCoreExists
|
||||
|
|
@ -79,8 +80,10 @@ class CoreService : CoreService() {
|
|||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
Log.i("[Service] Stopping")
|
||||
coreContext.notificationsManager.service = null
|
||||
if (LinphoneApplication.contextExists()) {
|
||||
Log.i("[Service] Stopping")
|
||||
coreContext.notificationsManager.service = null
|
||||
}
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue