Disallow new call addition for live CDMA calls.

Disallow call addition when the foreground call does not support HOLD.
This is for CDMA calls which do not support HOLD capability and hence we
cannot place a simultaneous call.

BUG: 22850789
Change-Id: I2e4b396f5665b5517275766daa722866cf92d68c
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 22e747e..4761fd8 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -1070,6 +1070,14 @@
             if (call.isEmergencyCall()) {
                 // We never support add call if one of the calls is an emergency call.
                 return false;
+            } else  if (!call.getChildCalls().isEmpty() && !call.can(Connection.CAPABILITY_HOLD)) {
+                // This is to deal with CDMA conference calls. CDMA conference calls do not
+                // allow the addition of another call when it is already in a 3 way conference.
+                // So, we detect that it is a CDMA conference call by checking if the call has
+                // some children and it does not support the CAPABILILTY_HOLD
+                // TODO: This maybe cleaner if the lower layers can explicitly signal to telecom
+                // about this limitation (b/22880180).
+                return false;
             } else if (call.getParentCall() == null) {
                 count++;
             }