IMS call merge call-back changes.
Tyler Gunn [Fri, 24 Oct 2014 17:02:19 +0000 (10:02 -0700)]
Renaming callSessionMerged to callSessionMergeStarted.
Adding callSessionMergeComplete callback for when merge successfully
completes.

Bug: 18056632
Change-Id: Id560965722f8651646e6ed5ec158747d1cb5e210

src/java/com/android/ims/ImsCall.java
src/java/com/android/ims/internal/ImsCallSession.java

index e5e0ed0..778679a 100644 (file)
@@ -1896,10 +1896,10 @@ public class ImsCall implements ICall {
         }
 
         @Override
-        public void callSessionMerged(ImsCallSession session,
+        public void callSessionMergeStarted(ImsCallSession session,
                 ImsCallSession newSession, ImsCallProfile profile) {
             if (DBG) {
-                log("callSessionMerged :: session=" + session
+                log("callSessionMergeStarted :: session=" + session
                         + ", newSession=" + newSession + ", profile=" + profile);
             }
 
@@ -1924,12 +1924,21 @@ public class ImsCall implements ICall {
                 try {
                     listener.onCallMerged(ImsCall.this, newCall);
                 } catch (Throwable t) {
-                    loge("callSessionMerged :: ", t);
+                    loge("callSessionMergeStarted :: ", t);
                 }
             }
         }
 
         @Override
+        public void callSessionMergeComplete(ImsCallSession session) {
+            if (DBG) {
+                log("callSessionMergeComplete :: session=" + session);
+            }
+
+            // TODO handle successful completion of call session merge.
+        }
+
+        @Override
         public void callSessionMergeFailed(ImsCallSession session,
                 ImsReasonInfo reasonInfo) {
             if (DBG) {
index 3e946d2..32cc377 100644 (file)
@@ -186,17 +186,27 @@ public class ImsCallSession {
         }
 
         /**
-         * Called when the session merge is done.
+         * Called when the session merge has been started.  At this point, the {@code newSession}
+         * represents the session which has been initiated to the IMS conference server for the
+         * new merged conference.
          *
          * @param session the session object that carries out the IMS session
          * @param newSession the session object that is merged with an active & hold session
          */
-        public void callSessionMerged(ImsCallSession session,
+        public void callSessionMergeStarted(ImsCallSession session,
                 ImsCallSession newSession, ImsCallProfile profile) {
         }
 
         /**
-         * Called when the session merge is failed.
+         * Called when the session merge is successful and the merged session is active.
+         *
+         * @param session the session object that carries out the IMS session
+         */
+        public void callSessionMergeComplete(ImsCallSession session) {
+        }
+
+        /**
+         * Called when the session merge has failed.
          *
          * @param session the session object that carries out the IMS session
          * @param reasonInfo detailed reason of the call merge failure
@@ -681,9 +691,9 @@ public class ImsCallSession {
 
     /**
      * Merges the active & hold call. When it succeeds,
-     * {@link Listener#callSessionMerged} is called.
+     * {@link Listener#callSessionMergeStarted} is called.
      *
-     * @see Listener#callSessionMerged, Listener#callSessionMergeFailed
+     * @see Listener#callSessionMergeStarted , Listener#callSessionMergeFailed
      */
     public void merge() {
         if (mClosed) {
@@ -913,17 +923,39 @@ public class ImsCallSession {
         }
 
         /**
-         * Notifiies the result of call merge operation.
+         * Notifies the start of a call merge operation.
+         *
+         * @param session The call session.
+         * @param newSession The merged call session.
+         * @param profile The call profile.
          */
         @Override
-        public void callSessionMerged(IImsCallSession session,
+        public void callSessionMergeStarted(IImsCallSession session,
                 IImsCallSession newSession, ImsCallProfile profile) {
             if (mListener != null) {
-                mListener.callSessionMerged(ImsCallSession.this,
+                mListener.callSessionMergeStarted(ImsCallSession.this,
                         new ImsCallSession(newSession), profile);
             }
         }
 
+        /**
+         * Notifies the successful completion of a call merge operation.
+         *
+         * @param session The call session.
+         */
+        @Override
+        public void callSessionMergeComplete(IImsCallSession session) {
+            if (mListener != null) {
+                mListener.callSessionMergeComplete(ImsCallSession.this);
+            }
+        }
+
+        /**
+         * Notifies of a failure to perform a call merge operation.
+         *
+         * @param session The call session.
+         * @param reasonInfo The merge failure reason.
+         */
         @Override
         public void callSessionMergeFailed(IImsCallSession session,
                 ImsReasonInfo reasonInfo) {