From 9eb78515dc7c3b7d52170d240a66cda8a7bbeb88 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 12 Apr 2016 16:13:44 -0700 Subject: [PATCH] Adding some new multi-endpoint stuff. Adding getVideoStateFromCallType method to ImsCallProfile, which basically just breaks out some of the existing logic in getVideoStateFromImsCallProfile. This is used to translate the CALL_TYPE_* from an external call to a video state (used when pulling the call). Added a new ImsReasonInfo code for when multi-endpoint fails to configure because the modem does not support it. Bug: 27458894 Change-Id: I226e79005dccf3e8cae30e4d448543adbe59f922 --- .../java/com/android/ims/ImsCallProfile.java | 24 +++++++++++++------ .../java/com/android/ims/ImsReasonInfo.java | 5 ++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 303746c7e54b0..92b70e86cb067 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -336,12 +336,27 @@ public class ImsCallProfile implements Parcelable { * Converts from the call types defined in {@link com.android.ims.ImsCallProfile} to the * video state values defined in {@link VideoProfile}. * - * @param callType The call type. + * @param callProfile The call profile. * @return The video state. */ public static int getVideoStateFromImsCallProfile(ImsCallProfile callProfile) { + int videostate = getVideoStateFromCallType(callProfile.mCallType); + if (callProfile.isVideoPaused() && !VideoProfile.isAudioOnly(videostate)) { + videostate |= VideoProfile.STATE_PAUSED; + } else { + videostate &= ~VideoProfile.STATE_PAUSED; + } + return videostate; + } + + /** + * Translates a {@link ImsCallProfile} {@code CALL_TYPE_*} constant into a video state. + * @param callType The call type. + * @return The video state. + */ + public static int getVideoStateFromCallType(int callType) { int videostate = VideoProfile.STATE_AUDIO_ONLY; - switch (callProfile.mCallType) { + switch (callType) { case CALL_TYPE_VT_TX: videostate = VideoProfile.STATE_TX_ENABLED; break; @@ -358,11 +373,6 @@ public class ImsCallProfile implements Parcelable { videostate = VideoProfile.STATE_AUDIO_ONLY; break; } - if (callProfile.isVideoPaused() && !VideoProfile.isAudioOnly(videostate)) { - videostate |= VideoProfile.STATE_PAUSED; - } else { - videostate &= ~VideoProfile.STATE_PAUSED; - } return videostate; } diff --git a/telephony/java/com/android/ims/ImsReasonInfo.java b/telephony/java/com/android/ims/ImsReasonInfo.java index f06d15456ac00..9369b20255a72 100644 --- a/telephony/java/com/android/ims/ImsReasonInfo.java +++ b/telephony/java/com/android/ims/ImsReasonInfo.java @@ -216,6 +216,11 @@ public class ImsReasonInfo implements Parcelable { */ public static final int CODE_ECBM_NOT_SUPPORTED = 901; + /** + * Fail code used to indicate that Multi-endpoint is not supported by the Ims framework. + */ + public static final int CODE_MULTIENDPOINT_NOT_SUPPORTED = 902; + /** * Ims Registration error code */