From 7d1f9b6d5a539497416afd9311111cff97c71714 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 21 May 2021 10:40:17 +0200 Subject: [PATCH] Added setting to disable automatic call pausing when audio focus is lost + added missing primary account settings in landscape layouts + removed empty strings --- .../viewmodels/CallSettingsViewModel.kt | 9 + .../java/org/linphone/core/CorePreferences.kt | 7 + .../layout-sw533dp-land/settings_fragment.xml | 25 + .../res/layout-sw533dp/settings_fragment.xml | 25 + .../res/layout/settings_account_fragment.xml | 11 - .../res/layout/settings_advanced_fragment.xml | 7 - .../res/layout/settings_audio_fragment.xml | 2 - .../res/layout/settings_call_fragment.xml | 18 +- .../res/layout/settings_chat_fragment.xml | 2 - .../res/layout/settings_contacts_fragment.xml | 2 - app/src/main/res/layout/settings_fragment.xml | 2 - .../res/layout/settings_network_fragment.xml | 5 - .../res/layout/settings_tunnel_fragment.xml | 3 - .../res/layout/settings_video_fragment.xml | 6 - app/src/main/res/values-es/strings.xml | 4 - app/src/main/res/values-fr/strings.xml | 6 +- app/src/main/res/values-nl/strings.xml | 527 ------------------ app/src/main/res/values-zh-rCN/strings.xml | 4 - app/src/main/res/values-zh-rTW/strings.xml | 4 - app/src/main/res/values/strings.xml | 53 +- 20 files changed, 74 insertions(+), 648 deletions(-) diff --git a/app/src/main/java/org/linphone/activities/main/settings/viewmodels/CallSettingsViewModel.kt b/app/src/main/java/org/linphone/activities/main/settings/viewmodels/CallSettingsViewModel.kt index 4290a4774..f69ba3dfd 100644 --- a/app/src/main/java/org/linphone/activities/main/settings/viewmodels/CallSettingsViewModel.kt +++ b/app/src/main/java/org/linphone/activities/main/settings/viewmodels/CallSettingsViewModel.kt @@ -161,6 +161,14 @@ class CallSettingsViewModel : GenericSettingsViewModel() { } val ringDuringEarlyMedia = MutableLiveData() + val pauseCallsWhenAudioFocusIsLostListener = object : SettingListenerStub() { + override fun onBoolValueChanged(newValue: Boolean) { + prefs.pauseCallsWhenAudioFocusIsLost = newValue + } + } + + val pauseCallsWhenAudioFocusIsLost = MutableLiveData() + val goToAndroidNotificationSettingsListener = object : SettingListenerStub() { override fun onClicked() { goToAndroidNotificationSettingsEvent.value = Event(true) @@ -188,6 +196,7 @@ class CallSettingsViewModel : GenericSettingsViewModel() { redirectToVoiceMailIncomingDeclinedCalls.value = prefs.redirectDeclinedCallToVoiceMail acceptEarlyMedia.value = prefs.acceptEarlyMedia ringDuringEarlyMedia.value = core.ringDuringIncomingEarlyMedia + pauseCallsWhenAudioFocusIsLost.value = prefs.pauseCallsWhenAudioFocusIsLost } private fun initEncryptionList() { diff --git a/app/src/main/java/org/linphone/core/CorePreferences.kt b/app/src/main/java/org/linphone/core/CorePreferences.kt index b2063b090..f31509cbb 100644 --- a/app/src/main/java/org/linphone/core/CorePreferences.kt +++ b/app/src/main/java/org/linphone/core/CorePreferences.kt @@ -270,6 +270,13 @@ class CorePreferences constructor(private val context: Context) { config.setBool("app", "route_audio_to_speaker_when_video_enabled", value) } + // Automatically handled by SDK + var pauseCallsWhenAudioFocusIsLost: Boolean + get() = config.getBool("audio", "android_pause_calls_when_audio_focus_lost", true) + set(value) { + config.setBool("audio", "android_pause_calls_when_audio_focus_lost", value) + } + /* Assistant */ var firstStart: Boolean diff --git a/app/src/main/res/layout-sw533dp-land/settings_fragment.xml b/app/src/main/res/layout-sw533dp-land/settings_fragment.xml index 48de5e1e0..f547c8936 100644 --- a/app/src/main/res/layout-sw533dp-land/settings_fragment.xml +++ b/app/src/main/res/layout-sw533dp-land/settings_fragment.xml @@ -72,6 +72,31 @@ android:paddingBottom="5dp" android:orientation="vertical"> + + + + + + + + + + + + @@ -118,14 +117,12 @@ @@ -133,13 +130,11 @@ @@ -170,7 +164,6 @@ @@ -185,7 +178,6 @@ @@ -193,7 +185,6 @@ @@ -201,7 +192,6 @@ @@ -241,7 +231,6 @@ diff --git a/app/src/main/res/layout/settings_advanced_fragment.xml b/app/src/main/res/layout/settings_advanced_fragment.xml index 9dbaa13e9..f650443fe 100644 --- a/app/src/main/res/layout/settings_advanced_fragment.xml +++ b/app/src/main/res/layout/settings_advanced_fragment.xml @@ -77,7 +77,6 @@ @@ -93,14 +92,12 @@ @@ -124,14 +121,12 @@ @@ -139,7 +134,6 @@ @@ -153,7 +147,6 @@ diff --git a/app/src/main/res/layout/settings_audio_fragment.xml b/app/src/main/res/layout/settings_audio_fragment.xml index d9b0d4acf..e425d461b 100644 --- a/app/src/main/res/layout/settings_audio_fragment.xml +++ b/app/src/main/res/layout/settings_audio_fragment.xml @@ -87,7 +87,6 @@ @@ -110,7 +109,6 @@ diff --git a/app/src/main/res/layout/settings_call_fragment.xml b/app/src/main/res/layout/settings_call_fragment.xml index 423a18c95..d316ea818 100644 --- a/app/src/main/res/layout/settings_call_fragment.xml +++ b/app/src/main/res/layout/settings_call_fragment.xml @@ -68,21 +68,18 @@ @@ -90,7 +87,6 @@ @@ -120,14 +115,12 @@ @@ -141,7 +134,6 @@ @@ -166,7 +158,6 @@ @@ -174,7 +165,6 @@ @@ -182,18 +172,22 @@ + + @@ -124,7 +123,6 @@ diff --git a/app/src/main/res/layout/settings_contacts_fragment.xml b/app/src/main/res/layout/settings_contacts_fragment.xml index 7eee59da9..a401618d7 100644 --- a/app/src/main/res/layout/settings_contacts_fragment.xml +++ b/app/src/main/res/layout/settings_contacts_fragment.xml @@ -67,7 +67,6 @@ @@ -91,7 +90,6 @@ diff --git a/app/src/main/res/layout/settings_fragment.xml b/app/src/main/res/layout/settings_fragment.xml index e02d30d06..2f4f62199 100644 --- a/app/src/main/res/layout/settings_fragment.xml +++ b/app/src/main/res/layout/settings_fragment.xml @@ -79,7 +79,6 @@ @@ -90,14 +87,12 @@ @@ -76,7 +75,6 @@ @@ -111,7 +109,6 @@ diff --git a/app/src/main/res/layout/settings_video_fragment.xml b/app/src/main/res/layout/settings_video_fragment.xml index 747cd55e1..511929d7c 100644 --- a/app/src/main/res/layout/settings_video_fragment.xml +++ b/app/src/main/res/layout/settings_video_fragment.xml @@ -68,14 +68,12 @@ No se puede abrir el archivo, no hay una apliación disponible para este formato. Los mensajes instantáneos se cifran de extremo a extremo en conversaciones seguras. Es posible mejorar el nivel de seguridad de una conversación autenticando a los participantes. Para ello, llame al contacto y siga el proceso de autenticación. Enviar registros - Restablecer registros - Nombre de la pantalla - Nombre de usuario - \ 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 0ecd5ffee..5fd9d4798 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -571,16 +571,13 @@ Ouvrir les fichiers dans l\'application Vous pourrez toujours les exporter dans une appli tierce Sonner durant un appel entrant avec early-media - Voir le fichier de config Il semblerait que l\'on ne puisse pas afficher ce fichier. Voulez-vous essayer de l\'ouvrir comme texte ou de l\'exporter (en clair) vers une appli tierce si disponible ? Exporter Ouvrir comme texte Envoyer les traces - Vider les traces - Paramètres de deboggage Autres paramètres Afficher la notification flottante en dehors de l\'app @@ -591,13 +588,12 @@ Applique le préfixe pour les appels sortant et les messages Compte principal Nom d\'affichage - Nom d\'utilisateur - Erreur pendant l\'envoi des journaux ! Les journaux ont été néttoyés Rediriger les appels déclinés vers la boîte vocale Délai d\'attente serveur expiré Temporairement indisponible Erreur : %s + Mettre en pause les appels quand le focus audio est perdu \ No newline at end of file diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index ab950e925..4c03ddbf1 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -5,21 +5,11 @@ ]> - - - &appName; is automatisch gestart Dit is vereist om oproepen te ontvangen in de achtergrond &appName; contacten - - - - - Bekijk onze privacyverklaring - Logs URL gekopieerd naar klembord - Fout Telefoonnummer Telefoonnummers @@ -29,10 +19,8 @@ Landscode of prefix Gebruikersnaam Wachtwoord - Domein SIP adres - Annuleer %d dag @@ -43,11 +31,6 @@ Vandaag Gisteren Transport - - - - - de vrije SIP client Verbonden Niet verbonden @@ -64,16 +47,10 @@ Geen gemiste oproep in uw geschiedenis Weet u zeker dat u dit record wil verwijderen\? Weet u zeker dat u deze records wil verwijderen\? - - - - Uitnodigen Geen contacten in uw adresboek Geen SIP contact in uw adresboek Zoek een contact - - Achternaam Voornaam Organisatie @@ -83,10 +60,6 @@ \nDeze wordt ook verwijderd uit het adresboek van uw toestel Weet u zeker dat u deze contactpersonen wil verwijderen\? \nDeze worden ook verwijderd uit het adresboek van uw toestel - - - - Selecteer waar de contactpersoon moet worden opgeslagen Lokaal opslaan Vul een nummer of adres in @@ -106,19 +79,10 @@ nieuw onderwerp: %s %s is beheerder %s is niet langer beheerder - - - Maximaal aantal deelnemers overschreden met %s - - - - Selecteer bron - Info Deelnemers - Beheerder Groep verlaten Verlaten @@ -133,23 +97,11 @@ Doorgestuurd Opnieuw versturen Kopieer tekst - - - Toevoegen aan contacten Wil u het bericht in deze chatroom doorsturen\? - Selecteer een conversatie of begin een nieuwe Kan bestand niet openen, geen applicatie beschikbaar voor dit formaat. Bestand niet gevonden - - - - - - - - 1 minuut 1 uur 1 dag @@ -159,22 +111,6 @@ %s is aan het schrijven… %s zijn aan het schrijven… - - - - - - - - - - - - - - - - Inkomende oproep Uitgaande oproep Gesprek werd gepauzeerd door tegenpartij @@ -191,473 +127,10 @@ Tegenpartij wenst dat u video inschakelt Audio Video - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gespreksgeschiedenis - - - - - - Toon alle oproepen - Gemiste oproep Inkomende oproep Uitgaande oproep - - - - Versleuteld - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c9a8df45a..1b9706c10 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -563,11 +563,7 @@ 撤消通知后标记为已读 发送日志 - 重启日志 - 显示名 - 用户名 - \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 44c2c497c..16d50f536 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -383,9 +383,7 @@ 電源管理設置 安卓應用設置 發送日誌 - 重啓日誌 - 主機名 端口 啟用雙模式 @@ -556,7 +554,5 @@ 顯示後隱藏通話統計 視頻附件 顯示名 - 用戶名 - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f62e54fd3..6452ac097 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -340,9 +340,7 @@ Advanced Primary Account Display Name - Username - Echo cancellation @@ -358,13 +356,11 @@ Echo tester is stopped Echo tester is running Adaptive rate control - Default input audio device Changes will take effect starting next call Default output audio device Changes will take effect starting next call Codec bitrate limit - Microphone gain (in decibels) Playback gain @@ -373,69 +369,51 @@ Enable video - Display camera preview on dialer - Initiate video calls Always send video requests Accept incoming video requests Always accept video requests Camera - Preferred video size - Video preset - Preferred FPS - Bandwidth limit in kbits/s Codecs Use device ringtone - Vibrate while incoming call is ringing - Media encryption - None SRTP ZRTP DTLS Media encryption mandatory - Full screen app while in call Hides status and navigation bars Overlay call notification - Show overlay outside of app You will be asked to grant overlay permission Send out-band DTMFs (SIP INFO) - Send in-band DTMFs (RFC 2833) - Start call immediately The call will start automatically if started from another application Auto answer incoming calls - Auto answer time in milliseconds Incoming call timeout in seconds Voice mail URI - Redirect declined calls to voice mail URI - Accept early media - Ring during incoming early media - + Pause calls when audio focus is lost Android notification settings Mark as read upon notification dismissal - Sharing server URL Do not edit unless you know what you are doing! Auto download incoming files policy @@ -452,7 +430,6 @@ Create shortcuts to chat rooms in launcher Will be replaced by contacts shortcuts if enabled Hide empty chat rooms - Hide chat rooms from removed proxy configs If you are missing chat rooms, try to uncheck this setting Android notification settings @@ -461,25 +438,18 @@ Use WiFi only - Allow IPv6 - Enable push notifications - Use legacy push notification params Required when using Flexisip < 2.0 Use random ports - SIP port to use - Friendlist subscribe - Presence information in native contact Inserting information shortcuts from the &appName; contact into native Android contacts Display contact organization - Create shortcuts to contacts in launcher Will replace chat room shortcuts if any Always ask in which account save newly created contact @@ -487,22 +457,17 @@ Debug logs - Background mode Shows a notification to keep the app alive Start at boot time - Dark theme - Auto No Yes Animations - Device name Changes will be applied at next start up Remote provisioning URL - Logs upload server URL Do not edit unless you know what you are doing! Android @@ -512,17 +477,13 @@ Encrypt everything Once enabled it can\'t be disabled! Send logs - Reset logs - Debug settings Other settings Hostname - Port - Dual mode enabled Will use one server for upload and another one for download Second server hostname @@ -530,7 +491,6 @@ Second server port Required in dual mode Mode - Disabled Always Auto @@ -545,35 +505,25 @@ Domain Example: sip.example.org if your account is john@sip.example.org Display name - Manage Disable - Used as default - Link your account - Delete - Advanced Allow push notification Proxy config won\'t unregister Transport - UDP TCP TLS DTLS SIP proxy - Outbound proxy Route all calls through above SIP proxy STUN/TURN server - Enable ICE - AVPF - AVPF regular RTCP interval in seconds (between 1 and 5) Expire @@ -583,7 +533,6 @@ Apply prefix for outgoing calls and chat If a number is entered, apply prefix to number Replace + by 00 - linphone_notification_service_id