Improved some logs

This commit is contained in:
Sylvain Berfini 2020-07-28 11:22:47 +02:00
parent 003b32aa9e
commit 09ebb7e63b
3 changed files with 5 additions and 4 deletions

View file

@ -32,8 +32,9 @@ class LinphoneApplication : Application() {
lateinit var corePreferences: CorePreferences lateinit var corePreferences: CorePreferences
lateinit var coreContext: CoreContext lateinit var coreContext: CoreContext
fun ensureCoreExists(context: Context) { fun ensureCoreExists(context: Context, pushReceived: Boolean = false) {
if (::coreContext.isInitialized && !coreContext.stopped) { if (::coreContext.isInitialized && !coreContext.stopped) {
Log.d("[Application] Skipping Core creation (push received? $pushReceived)")
return return
} }
@ -49,7 +50,7 @@ class LinphoneApplication : Application() {
val appName = context.getString(R.string.app_name) val appName = context.getString(R.string.app_name)
Factory.instance().setDebugMode(corePreferences.debugLogs, appName) Factory.instance().setDebugMode(corePreferences.debugLogs, appName)
Log.i("[Application] Core context created") Log.i("[Application] Core context created ${if (pushReceived) "from push" else ""}")
coreContext = CoreContext(context, config) coreContext = CoreContext(context, config)
coreContext.start() coreContext.start()
} }

View file

@ -66,7 +66,7 @@ class NativeContactEditor(
private var pictureByteArray: ByteArray? = null private var pictureByteArray: ByteArray? = null
init { init {
Log.i("[Native Contact Editor] Using sync account $syncAccountName with type $syncAccountType") Log.d("[Native Contact Editor] Using sync account $syncAccountName with type $syncAccountType")
val contentResolver = coreContext.context.contentResolver val contentResolver = coreContext.context.contentResolver
val cursor = contentResolver.query( val cursor = contentResolver.query(
RawContacts.CONTENT_URI, RawContacts.CONTENT_URI,

View file

@ -27,7 +27,7 @@ import org.linphone.core.tools.Log
class CorePushReceiver : BroadcastReceiver() { class CorePushReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
ensureCoreExists(context.applicationContext) ensureCoreExists(context.applicationContext, true)
Log.i("[Push Receiver] Push notification received") Log.i("[Push Receiver] Push notification received")
} }
} }