mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Attempt to fix random dead lock when app starts
This commit is contained in:
parent
d325203e8b
commit
ff6d722e44
2 changed files with 7 additions and 10 deletions
|
|
@ -21,7 +21,6 @@ package org.linphone.contacts
|
|||
|
||||
import android.Manifest
|
||||
import android.content.ContentUris
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.database.Cursor
|
||||
import android.graphics.Bitmap
|
||||
|
|
@ -52,7 +51,7 @@ import org.linphone.utils.ImageUtils
|
|||
import org.linphone.utils.LinphoneUtils
|
||||
import org.linphone.utils.PhoneNumberUtils
|
||||
|
||||
class ContactsManager @UiThread constructor(context: Context) {
|
||||
class ContactsManager @UiThread constructor() {
|
||||
companion object {
|
||||
private const val TAG = "[Contacts Manager]"
|
||||
}
|
||||
|
|
@ -125,16 +124,14 @@ class ContactsManager @UiThread constructor(context: Context) {
|
|||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@WorkerThread
|
||||
fun onNativeContactsLoaded() {
|
||||
nativeContactsLoaded = true
|
||||
|
||||
coreContext.postOnCoreThread {
|
||||
avatarsMap.values.forEach(ContactAvatarModel::destroy)
|
||||
avatarsMap.clear()
|
||||
avatarsMap.values.forEach(ContactAvatarModel::destroy)
|
||||
avatarsMap.clear()
|
||||
|
||||
notifyContactsListChanged()
|
||||
}
|
||||
notifyContactsListChanged()
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
|
|
@ -181,7 +178,7 @@ class ContactsManager @UiThread constructor(context: Context) {
|
|||
}
|
||||
} else {
|
||||
Log.i(
|
||||
"$TAG Friend wasn't found using SIP URI [$sipUri] and username [$username] isn't a phone number, looking in native address book directly"
|
||||
"$TAG Friend wasn't found using SIP URI [$sipUri] and username [$username] isn't a phone number, looking in native address book directly"
|
||||
)
|
||||
findNativeContact(sipUri, false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
|
||||
val emojiCompat: EmojiCompat
|
||||
|
||||
val contactsManager = ContactsManager(context)
|
||||
val contactsManager = ContactsManager()
|
||||
|
||||
val notificationsManager = NotificationsManager(context)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue