Adds separate conference call function.

- Also fixes bug on update conference call.

Bug: 10334739
Change-Id: I4f59c3cf12911b175173e76a1551eb0e3999ba3f
diff --git a/src/com/android/phone/CallCommandService.java b/src/com/android/phone/CallCommandService.java
index 72273ee..371ca7b 100644
--- a/src/com/android/phone/CallCommandService.java
+++ b/src/com/android/phone/CallCommandService.java
@@ -105,9 +105,10 @@
                 int state = result.getCall().getState();
                 if (Call.State.ACTIVE == state ||
                         Call.State.ONHOLD == state ||
-                        Call.State.DIALING == state ||
-                        Call.State.CONFERENCED == state) {
+                        Call.State.DIALING == state) {
                     result.getConnection().getCall().hangup();
+                } else if (Call.State.CONFERENCED == state) {
+                    result.getConnection().hangup();
                 }
             }
         } catch (Exception e) {
@@ -116,6 +117,23 @@
     }
 
     @Override
+    public void separateCall(int callId) {
+        try {
+            CallResult result = mCallModeler.getCallWithId(callId);
+            if (DBG) Log.d(TAG, "disconnectCall " + result.getCall());
+
+            if (result != null) {
+                int state = result.getCall().getState();
+                if (Call.State.CONFERENCED == state) {
+                    result.getConnection().separate();
+                }
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "Error trying to separate call.", e);
+        }
+    }
+
+    @Override
     public void hold(int callId, boolean hold) {
         try {
             CallResult result = mCallModeler.getCallWithId(callId);