Map CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE to NORMAL disconnect cause
Jayachandran C [Thu, 11 May 2017 18:40:28 +0000 (11:40 -0700)]
This change also optimizes imports

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: I7ea843683eebfa2e60683ddffd11995b426f0a12

src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java

index 3f171fa..bc0c79c 100644 (file)
@@ -40,8 +40,8 @@ import android.telecom.ConferenceParticipant;
 import android.telecom.VideoProfile;
 import android.telephony.CarrierConfigManager;
 import android.telephony.DisconnectCause;
-import android.telephony.PreciseDisconnectCause;
 import android.telephony.PhoneNumberUtils;
+import android.telephony.PreciseDisconnectCause;
 import android.telephony.Rlog;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
@@ -49,10 +49,10 @@ import android.telephony.TelephonyManager;
 import android.telephony.ims.ImsServiceProxy;
 import android.telephony.ims.feature.ImsFeature;
 import android.text.TextUtils;
-import android.util.SparseIntArray;
 import android.util.ArrayMap;
 import android.util.Log;
 import android.util.Pair;
+import android.util.SparseIntArray;
 
 import com.android.ims.ImsCall;
 import com.android.ims.ImsCallProfile;
@@ -335,6 +335,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                 PreciseDisconnectCause.LOCAL_IMS_SERVICE_DOWN);
         PRECISE_CAUSE_MAP.append(ImsReasonInfo.CODE_LOCAL_NO_PENDING_CALL,
                 PreciseDisconnectCause.LOCAL_NO_PENDING_CALL);
+        PRECISE_CAUSE_MAP.append(ImsReasonInfo.CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE,
+                PreciseDisconnectCause.NORMAL);
         PRECISE_CAUSE_MAP.append(ImsReasonInfo.CODE_LOCAL_POWER_OFF,
                 PreciseDisconnectCause.LOCAL_POWER_OFF);
         PRECISE_CAUSE_MAP.append(ImsReasonInfo.CODE_LOCAL_LOW_BATTERY,
@@ -1718,6 +1720,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                 return DisconnectCause.BUSY;
 
             case ImsReasonInfo.CODE_USER_TERMINATED:
+            case ImsReasonInfo.CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE:
                 return DisconnectCause.LOCAL;
 
             case ImsReasonInfo.CODE_LOCAL_CALL_DECLINE: