Modify call cleanup when emergency call dialed.

Modifying the emergency dial code to drop only self-managed calls when
an emergency call is placed.  The previous code would drop anything from
a phone account other than the one being dialed.  At the point this code
ran, however, there was no phone account selected and no binding, so the
disconnect code was not working.

Realistically we only need to drop self-managed calls.

Bug: 76442553
Test: Manually reproduced issue to observe double disconnect signal.
Change-Id: Ia92dcd95cbcce27381fb22606a668ee3e8b9426b
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 90ee652..25f6f34 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -1423,11 +1423,8 @@
                 notifyCreateConnectionFailed(call.getTargetPhoneAccount(), call);
             } else {
                 if (call.isEmergencyCall()) {
-                    // Disconnect calls from other ConnectionServices other than the one the
-                    // emergency call targets.
-                    // Except, do not disconnect calls from the Connection Manager's
-                    // ConnectionService.
-                    disconnectCallsHaveDifferentConnectionService(call);
+                    // Drop any ongoing self-managed calls to make way for an emergency call.
+                    disconnectSelfManagedCalls("place emerg call" /* reason */);
                 }
 
                 call.startCreateConnection(mPhoneAccountRegistrar);
@@ -3274,16 +3271,6 @@
         mCallAudioManager.switchBaseline();
     }
 
-    private void disconnectCallsHaveDifferentConnectionService(Call exceptCall) {
-        String csPackage = exceptCall.getConnectionService() != null ?
-                exceptCall.getConnectionService().getComponentName().toShortString() : "null";
-        mCalls.stream().filter(c ->
-                c.getConnectionService() != exceptCall.getConnectionService()
-                        && c.getConnectionManagerPhoneAccount()
-                        != exceptCall.getConnectionManagerPhoneAccount())
-                .forEach(c -> c.disconnect("CS not " + csPackage));
-    }
-
     /**
      * Dumps the state of the {@link CallsManager}.
      *