diff --git a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedCallFragment.kt b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedCallFragment.kt
new file mode 100644
index 000000000..c5ca37b06
--- /dev/null
+++ b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedCallFragment.kt
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2010-2025 Belledonne Communications SARL.
+ *
+ * This file is part of linphone-android
+ * (see https://www.linphone.org).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.linphone.ui.main.settings.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.AdapterView
+import android.widget.ArrayAdapter
+import androidx.annotation.UiThread
+import androidx.lifecycle.ViewModelProvider
+import org.linphone.R
+import org.linphone.databinding.SettingsAdvancedCallsFragmentBinding
+import org.linphone.ui.main.fragment.GenericMainFragment
+import org.linphone.ui.main.settings.viewmodel.SettingsViewModel
+
+@UiThread
+class SettingsAdvancedCallFragment : GenericMainFragment() {
+ private lateinit var binding: SettingsAdvancedCallsFragmentBinding
+
+ private lateinit var viewModel: SettingsViewModel
+
+ private val mediaEncryptionDropdownListener = object : AdapterView.OnItemSelectedListener {
+ override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
+ viewModel.setMediaEncryption(position)
+ }
+
+ override fun onNothingSelected(parent: AdapterView<*>?) {
+ }
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ binding = SettingsAdvancedCallsFragmentBinding.inflate(layoutInflater)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ postponeEnterTransition()
+ super.onViewCreated(view, savedInstanceState)
+
+ viewModel = ViewModelProvider(this)[SettingsViewModel::class.java]
+
+ binding.lifecycleOwner = viewLifecycleOwner
+ binding.viewModel = viewModel
+ observeToastEvents(viewModel)
+
+ binding.setBackClickListener {
+ goBack()
+ }
+
+ viewModel.mediaEncryptionIndex.observe(viewLifecycleOwner) {
+ setupMediaEncryptionPicker()
+ }
+
+ startPostponedEnterTransition()
+ }
+
+ private fun setupMediaEncryptionPicker() {
+ val index = viewModel.mediaEncryptionIndex.value ?: 0
+ val adapter = ArrayAdapter(
+ requireContext(),
+ R.layout.drop_down_item,
+ viewModel.mediaEncryptionLabels
+ )
+ adapter.setDropDownViewResource(R.layout.generic_dropdown_cell)
+ binding.mediaEncryption.adapter = adapter
+ binding.mediaEncryption.onItemSelectedListener = mediaEncryptionDropdownListener
+ binding.mediaEncryption.setSelection(index)
+ }
+}
diff --git a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedFragment.kt b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedFragment.kt
index b3e38aa44..f1cc856a0 100644
--- a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedFragment.kt
+++ b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsAdvancedFragment.kt
@@ -40,15 +40,6 @@ class SettingsAdvancedFragment : GenericMainFragment() {
private lateinit var viewModel: SettingsViewModel
- private val mediaEncryptionDropdownListener = object : AdapterView.OnItemSelectedListener {
- override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
- viewModel.setMediaEncryption(position)
- }
-
- override fun onNothingSelected(parent: AdapterView<*>?) {
- }
- }
-
private val inputAudioDeviceDropdownListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
viewModel.setInputAudioDevice(position)
@@ -94,10 +85,6 @@ class SettingsAdvancedFragment : GenericMainFragment() {
(requireActivity() as GenericActivity).goToAndroidPermissionSettings()
}
- viewModel.mediaEncryptionIndex.observe(viewLifecycleOwner) {
- setupMediaEncryptionPicker()
- }
-
viewModel.inputAudioDeviceIndex.observe(viewLifecycleOwner) {
setupInputAudioDevicePicker()
}
@@ -122,19 +109,6 @@ class SettingsAdvancedFragment : GenericMainFragment() {
super.onPause()
}
- private fun setupMediaEncryptionPicker() {
- val index = viewModel.mediaEncryptionIndex.value ?: 0
- val adapter = ArrayAdapter(
- requireContext(),
- R.layout.drop_down_item,
- viewModel.mediaEncryptionLabels
- )
- adapter.setDropDownViewResource(R.layout.generic_dropdown_cell)
- binding.advancedCallsSettings.mediaEncryption.adapter = adapter
- binding.advancedCallsSettings.mediaEncryption.onItemSelectedListener = mediaEncryptionDropdownListener
- binding.advancedCallsSettings.mediaEncryption.setSelection(index)
- }
-
private fun setupInputAudioDevicePicker() {
val index = viewModel.inputAudioDeviceIndex.value ?: 0
val adapter = ArrayAdapter(
diff --git a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt
index b3c1afa9e..071adca75 100644
--- a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt
+++ b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt
@@ -148,6 +148,13 @@ class SettingsFragment : GenericMainFragment() {
goBack()
}
+ binding.setAdvancedCallSettingsClickListener {
+ if (findNavController().currentDestination?.id == R.id.settingsFragment) {
+ val action = SettingsFragmentDirections.actionSettingsFragmentToSettingsAdvancedCallFragment()
+ findNavController().navigate(action)
+ }
+ }
+
binding.setAdvancedSettingsClickListener {
if (findNavController().currentDestination?.id == R.id.settingsFragment) {
val action = SettingsFragmentDirections.actionSettingsFragmentToSettingsAdvancedFragment()
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 4586b2192..0fc439ecf 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
@@ -233,6 +233,9 @@ class SettingsViewModel
val expandVideoCodecs = MutableLiveData()
val videoCodecs = MutableLiveData>()
+ val expandEarlyMedia = MutableLiveData()
+ val expandAutoAnswer = MutableLiveData()
+
// Developer settings
val showDeveloperSettings = MutableLiveData()
@@ -286,6 +289,8 @@ class SettingsViewModel
expandAudioDevices.value = false
expandAudioCodecs.value = false
expandVideoCodecs.value = false
+ expandEarlyMedia.value = false
+ expandAutoAnswer.value = false
val vfsEnabled = VFS.isEnabled(coreContext.context)
isVfsEnabled.value = vfsEnabled
@@ -839,6 +844,11 @@ class SettingsViewModel
}
}
+ @UiThread
+ fun toggleEarlyMediaExpand() {
+ expandEarlyMedia.value = expandEarlyMedia.value == false
+ }
+
@UiThread
fun toggleAcceptEarlyMedia() {
val newValue = acceptEarlyMedia.value == false
@@ -869,6 +879,11 @@ class SettingsViewModel
}
}
+ @UiThread
+ fun toggleAutoAnswerExpand() {
+ expandAutoAnswer.value = expandAutoAnswer.value == false
+ }
+
@UiThread
fun toggleEnableAutoAnswerIncomingCalls() {
val newValue = autoAnswerIncomingCalls.value == false
diff --git a/app/src/main/res/layout/settings_advanced_calls.xml b/app/src/main/res/layout/settings_advanced_calls.xml
deleted file mode 100644
index 636e03283..000000000
--- a/app/src/main/res/layout/settings_advanced_calls.xml
+++ /dev/null
@@ -1,352 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_advanced_calls_auto_answer.xml b/app/src/main/res/layout/settings_advanced_calls_auto_answer.xml
new file mode 100644
index 000000000..f5b948fc3
--- /dev/null
+++ b/app/src/main/res/layout/settings_advanced_calls_auto_answer.xml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_advanced_calls_early_media.xml b/app/src/main/res/layout/settings_advanced_calls_early_media.xml
new file mode 100644
index 000000000..8f264bcd4
--- /dev/null
+++ b/app/src/main/res/layout/settings_advanced_calls_early_media.xml
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_advanced_calls_fragment.xml b/app/src/main/res/layout/settings_advanced_calls_fragment.xml
new file mode 100644
index 000000000..61bd69ae5
--- /dev/null
+++ b/app/src/main/res/layout/settings_advanced_calls_fragment.xml
@@ -0,0 +1,347 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_advanced_fragment.xml b/app/src/main/res/layout/settings_advanced_fragment.xml
index f9708e1b5..6000c756c 100644
--- a/app/src/main/res/layout/settings_advanced_fragment.xml
+++ b/app/src/main/res/layout/settings_advanced_fragment.xml
@@ -1,7 +1,6 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -232,35 +231,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/remote_provisioning"/>
-
-
-
-
+ app:layout_constraintTop_toBottomOf="@id/download_and_apply"/>
@@ -397,74 +367,6 @@
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/settings_calls.xml b/app/src/main/res/layout/settings_calls.xml
index 43fe0e779..1566fd8c4 100644
--- a/app/src/main/res/layout/settings_calls.xml
+++ b/app/src/main/res/layout/settings_calls.xml
@@ -5,6 +5,9 @@
+
@@ -225,6 +228,25 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/auto_record_switch"/>
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_fragment.xml b/app/src/main/res/layout/settings_fragment.xml
index c9515b759..30e17770f 100644
--- a/app/src/main/res/layout/settings_fragment.xml
+++ b/app/src/main/res/layout/settings_fragment.xml
@@ -11,6 +11,9 @@
+
@@ -124,6 +127,7 @@
android:layout_marginEnd="16dp"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintTop_toBottomOf="@id/calls"
+ bind:advancedCallSettingsClickListener="@{advancedCallSettingsClickListener}"
bind:viewModel="@{viewModel}"/>
+
+ tools:layout="@layout/settings_advanced_fragment">
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 318cad9a4..b6adebfef 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -270,14 +270,17 @@
Caractères alpha-numériques uniquement
URL du serveur de partage de fichier
URL du serveur de partage des logs
+ Paramètres d\'appels avancés
Enregistrer les appels vidéos utilisant H265/AV1
Utilisera un format de fichier propriétaire
Chiffrement du média
Rendre le chiffrement du média obligatoire
Créer en mode chiffré de bout en bout les réunions et les appels de groupe
+ Early media
Accepter l\'early media
Sonner pendant un appel entrant avec early-media
Autoriser l\'early media pour les appels sortants
+ Décrochage automatique
Décrocher automatiquement les appels entrants
Délai avant le décrochage automatique
Délai en millisecondes
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e4d24c061..464ab9020 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -310,14 +310,17 @@
Alpha-numerical characters only
File sharing server URL
Logs sharing server URL
+ Advanced calls settings
Record video calls using H265/AV1
Will use a proprietary file format
Media encryption
Media encryption mandatory
Create end-to-end encrypted meetings & group calls
+ Early-media
Accept early media
Ring during incoming early media call
Allow outgoing early media
+ Auto-answer
Auto answer incoming calls
Delay before auto answering call
Delay in milliseconds