Prevent SIM selection and change SIM from showing when there are active calls

Most devices are DSDS (dual SIM dual standby) which only one SIM can have active calls at a time. Telecom will ignore the phone account handle and use the current active SIM. The SIM selection dialog has no effect, and the change SIM button will just redial with the same SIM.

Bug: 69417430
Test: CallingAccountSelectorTest, CallButtonPresenterTest
PiperOrigin-RevId: 176718021
Change-Id: I231cfeaa5ff77c29cdaf8e0865d096c85cfb7fc4
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java
index 6b7eb9b..bd3ba6d 100644
--- a/java/com/android/incallui/CallButtonPresenter.java
+++ b/java/com/android/incallui/CallButtonPresenter.java
@@ -464,7 +464,11 @@
             && call.getState() != DialerCall.State.CONNECTING;
 
     mOtherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle());
-    boolean showSwapSim = mOtherAccount != null && DialerCall.State.isDialing(call.getState());
+    boolean showSwapSim =
+        mOtherAccount != null
+            && DialerCall.State.isDialing(call.getState())
+            // Most devices cannot make calls on 2 SIMs at the same time.
+            && InCallPresenter.getInstance().getCallList().getAllCalls().size() == 1;
 
     mInCallButtonUi.showButton(InCallButtonIds.BUTTON_AUDIO, true);
     mInCallButtonUi.showButton(InCallButtonIds.BUTTON_SWAP, showSwap);