From 6ba8760be7c1b2e0716481b4064323e381b5897a Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 15 Apr 2025 11:41:11 +0200 Subject: [PATCH] Improved called account display --- .../ui/call/viewmodel/CurrentCallViewModel.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt index 502a1d28a..3e46cc2be 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt @@ -1115,7 +1115,19 @@ class CurrentCallViewModel if (call.dir == Call.Dir.Incoming) { val isVideo = call.remoteParams?.isVideoEnabled == true && call.remoteParams?.videoDirection != MediaDirection.Inactive if (call.core.accountList.size > 1) { - val displayName = LinphoneUtils.getDisplayName(call.toAddress) + val localAddress = call.callLog.toAddress + Log.i("$TAG Local address for incoming call is [${localAddress.asStringUriOnly()}]") + val localAccount = coreContext.core.accountList.find { + it.params.identityAddress?.weakEqual(localAddress) == true + } + val displayName = if (localAccount != null) { + LinphoneUtils.getDisplayName(localAccount.params.identityAddress) + } else { + Log.w("$TAG Matching local account was not found, using TO address display name or username") + LinphoneUtils.getDisplayName(localAddress) + } + Log.i("$TAG Showing account being called as [$displayName]") + if (isVideo) { incomingCallTitle.postValue( AppUtils.getFormattedString(