Use the default phone account for a voice call when the call log item is for Duo.

Bug: 77535982
Test: ModulesTest + Manual
PiperOrigin-RevId: 191612821
Change-Id: I417b46ed3ec131bf409c427d82f5b2fa6b791054
diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java
index e316f66..e0a69ca 100644
--- a/java/com/android/dialer/calllog/ui/menu/Modules.java
+++ b/java/com/android/dialer/calllog/ui/menu/Modules.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.provider.CallLog.Calls;
+import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
 import android.text.TextUtils;
 import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo;
@@ -123,10 +124,21 @@
       return Collections.emptyList();
     }
 
-    List<HistoryItemActionModule> modules = new ArrayList<>();
+    boolean isDuoCall =
+        DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME
+            .flattenToString()
+            .equals(row.getPhoneAccountComponentName());
+
+    // Obtain a PhoneAccountHandle that will be used to start carrier voice/video calls.
+    // If the row is for a Duo call, we should use the default phone account as the one included in
+    // the row is for Duo only.
     PhoneAccountHandle phoneAccountHandle =
-        TelecomUtil.composePhoneAccountHandle(
-            row.getPhoneAccountComponentName(), row.getPhoneAccountId());
+        isDuoCall
+            ? TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL)
+            : TelecomUtil.composePhoneAccountHandle(
+                row.getPhoneAccountComponentName(), row.getPhoneAccountId());
+
+    List<HistoryItemActionModule> modules = new ArrayList<>();
 
     // Add an audio call item
     modules.add(
@@ -136,10 +148,6 @@
     // Add a video item if (1) the call log entry is for a video call, and (2) the call is not spam.
     if ((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO
         && !row.getNumberAttributes().getIsSpam()) {
-      boolean isDuoCall =
-          DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME
-              .flattenToString()
-              .equals(row.getPhoneAccountComponentName());
       modules.add(
           isDuoCall
               ? new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG)