diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index b86273d94..b589d56e9 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index b2c751a35..a8a2b162e 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9183cb482..0636d2b1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,7 @@ Group changes to describe their impact on the project, as follows:
- one for user to choose whether to sort contacts by first name or last name
- one to hide contacts that have neither a SIP address nor a phone number
- one to let app auto-answer call with video sending already enabled
+ - one to let edit native contacts Linphone copy in-app instead of opening native addressbook third party app
- Added a vu meter for recording & playback volumes (must be enabled in developer settings)
- Added support for HDMI audio devices
diff --git a/app/src/main/java/org/linphone/core/CorePreferences.kt b/app/src/main/java/org/linphone/core/CorePreferences.kt
index 60291e329..f47a2d7e5 100644
--- a/app/src/main/java/org/linphone/core/CorePreferences.kt
+++ b/app/src/main/java/org/linphone/core/CorePreferences.kt
@@ -264,6 +264,13 @@ class CorePreferences
config.setString("app", "friend_list_to_store_newly_created_contacts", value)
}
+ @get:AnyThread @set:WorkerThread
+ var editNativeContactsInLinphone: Boolean
+ get() = config.getBool("ui", "edit_native_contact_in_linphone", false)
+ set(value) {
+ config.setBool("ui", "edit_native_contact_in_linphone", value)
+ }
+
@get:AnyThread @set:WorkerThread
var disableAddContact: Boolean
get() = config.getBool("ui", "disable_add_contact", false)
diff --git a/app/src/main/java/org/linphone/ui/main/contacts/viewmodel/ContactViewModel.kt b/app/src/main/java/org/linphone/ui/main/contacts/viewmodel/ContactViewModel.kt
index 9da8cd5bb..c53e46fe4 100644
--- a/app/src/main/java/org/linphone/ui/main/contacts/viewmodel/ContactViewModel.kt
+++ b/app/src/main/java/org/linphone/ui/main/contacts/viewmodel/ContactViewModel.kt
@@ -352,7 +352,7 @@ class ContactViewModel
coreContext.postOnCoreThread {
if (::friend.isInitialized) {
val uri = friend.nativeUri
- if (uri != null) {
+ if (uri != null && !corePreferences.editNativeContactsInLinphone) {
Log.i(
"$TAG Contact [${friend.name}] is a native contact, opening native contact editor using URI [$uri]"
)
diff --git a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt
index 2a79235a0..3d481a515 100644
--- a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt
+++ b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt
@@ -112,6 +112,8 @@ class SettingsViewModel
AppUtils.getString(R.string.contact_editor_last_name),
)
val sortContactsByValues = arrayListOf(0, 1)
+
+ val editNativeContactsInLinphone = MutableLiveData()
val hideEmptyContacts = MutableLiveData()
val ldapAvailable = MutableLiveData()
@@ -343,6 +345,7 @@ class SettingsViewModel
)
sortContactsBy.postValue(if (corePreferences.sortContactsByFirstName) 0 else 1)
+ editNativeContactsInLinphone.postValue(corePreferences.editNativeContactsInLinphone)
hideEmptyContacts.postValue(corePreferences.hideContactsWithoutPhoneNumberOrSipAddress)
presenceSubscribe.postValue(core.isFriendListSubscriptionEnabled)
@@ -585,6 +588,15 @@ class SettingsViewModel
}
}
+ @UiThread
+ fun toggleEditNativeContactsInLinphone() {
+ val newValue = editNativeContactsInLinphone.value == false
+ coreContext.postOnCoreThread {
+ corePreferences.editNativeContactsInLinphone = newValue
+ editNativeContactsInLinphone.postValue(newValue)
+ }
+ }
+
@UiThread
fun toggleHideEmptyContacts() {
val newValue = hideEmptyContacts.value == false
diff --git a/app/src/main/res/layout/settings_contacts.xml b/app/src/main/res/layout/settings_contacts.xml
index d381c4d73..ee8d39bab 100644
--- a/app/src/main/res/layout/settings_contacts.xml
+++ b/app/src/main/res/layout/settings_contacts.xml
@@ -78,6 +78,35 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/hide_empty_contacts_switch"/>
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/edit_native_contacts_in_linphone_switch" />
Marquer la conversation comme lue lorsqu\'une notification de message est supprimée
Contacts
Trier les contacts par
+ Editer les contacts natifs dans &appName;
Masquer les contacts sans adresse SIP ni numéro de téléphone
Souscrire aux informations de présence
Ajouter un serveur LDAP
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index af4aaff6d..5fb0c1668 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -268,6 +268,7 @@
Mark conversation as read when dismissing message notification
Contacts
Sort contacts by
+ Use &appName; contact editor for native contacts
Hide contacts without SIP address nor phone number
Subscribe to presence info
Add LDAP server