Pass correct cause codes for IMS Call ended during conference merge process
Jayachandran C [Thu, 11 May 2017 18:43:52 +0000 (11:43 -0700)]
Test: Following scenarios for VoLTE and CS call and
      verified the cause sent in PreciseCallState.

 1) Conference call merge
 2) Conference call, one remote party ends the call
 3) Conference call, all remote parties end the call
 4) Conference call, hangup locally
 5) Normal call and hangup locally
 6) Normal call and remote party ends the call

Bug: 38225047
Change-Id: Ia5a1b9d551395406f996a0602e57d49bbda29b53

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

index a6d0a0c..b6370de 100644 (file)
@@ -1795,13 +1795,16 @@ public class ImsCall implements ICall {
             setIsMerged(playDisconnectTone);
             mSessionEndDuringMerge = true;
             String reasonInfo;
+            int reasonCode = ImsReasonInfo.CODE_UNSPECIFIED;
             if (playDisconnectTone) {
+                reasonCode = ImsReasonInfo.CODE_USER_TERMINATED_BY_REMOTE;
                 reasonInfo = "Call ended by network";
             } else {
+                reasonCode = ImsReasonInfo.CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE;
                 reasonInfo = "Call ended during conference merge process.";
             }
             mSessionEndDuringMergeReasonInfo = new ImsReasonInfo(
-                    ImsReasonInfo.CODE_UNSPECIFIED, 0, reasonInfo);
+                    reasonCode, 0, reasonInfo);
         }
     }