FileDocCategorySizeDatePackage
ImsCallProfile.javaAPI DocAndroid 5.1 API13548Thu Mar 12 22:22:42 GMT 2015com.android.ims

ImsCallProfile

public class ImsCallProfile extends Object implements android.os.Parcelable
Parcelable object to handle IMS call profile. It is created from GSMA IR.92/IR.94, 3GPP TS 24.229/TS 26.114/TS26.111. It provides the service and call type, the additional information related to the call.
hide

Fields Summary
private static final String
TAG
public static final int
SERVICE_TYPE_NONE
It is for a special case. It helps that the application can make a call without IMS connection (not registered). In the moment of the call initiation, the device try to connect to the IMS network and initiates the call.
public static final int
SERVICE_TYPE_NORMAL
It is a default type and can be selected when the device is connected to the IMS network.
public static final int
SERVICE_TYPE_EMERGENCY
It is for an emergency call.
public static final int
CALL_TYPE_VOICE_N_VIDEO
IMSPhone to support IR.92 & IR.94 (voice + video upgrade/downgrade)
public static final int
CALL_TYPE_VOICE
IR.92 (Voice only)
public static final int
CALL_TYPE_VIDEO_N_VOICE
VT to support IR.92 & IR.94 (voice + video upgrade/downgrade)
public static final int
CALL_TYPE_VT
Video Telephony (audio / video two way)
public static final int
CALL_TYPE_VT_TX
Video Telephony (audio two way / video TX one way)
public static final int
CALL_TYPE_VT_RX
Video Telephony (audio two way / video RX one way)
public static final int
CALL_TYPE_VT_NODIR
Video Telephony (audio two way / video inactive)
public static final int
CALL_TYPE_VS
VideoShare (video two way)
public static final int
CALL_TYPE_VS_TX
VideoShare (video TX one way)
public static final int
CALL_TYPE_VS_RX
VideoShare (video RX one way)
public static final String
EXTRA_CONFERENCE
Boolean extra properties - "true" / "false" conference : Indicates if the session is for the conference call or not. e_call : Indicates if the session is for the emergency call or not. vms : Indicates if the session is connected to the voice mail system or not. call_mode_changeable : Indicates if the session is able to upgrade/downgrade the video during voice call. conference_avail : Indicates if the session can be extended to the conference.
public static final String
EXTRA_E_CALL
public static final String
EXTRA_VMS
public static final String
EXTRA_CALL_MODE_CHANGEABLE
public static final String
EXTRA_CONFERENCE_AVAIL
public static final String
EXTRA_OEM_EXTRAS
public static final String
EXTRA_OIR
Integer extra properties oir : Rule for originating identity (number) presentation, MO/MT. {@link ImsCallProfile#OIR_DEFAULT} {@link ImsCallProfile#OIR_PRESENTATION_RESTRICTED} {@link ImsCallProfile#OIR_PRESENTATION_NOT_RESTRICTED} cnap : Rule for calling name presentation {@link ImsCallProfile#OIR_DEFAULT} {@link ImsCallProfile#OIR_PRESENTATION_RESTRICTED} {@link ImsCallProfile#OIR_PRESENTATION_NOT_RESTRICTED} dialstring : To identify the Ims call type, MO {@link ImsCallProfile#DIALSTRING_NORMAL_CALL} {@link ImsCallProfile#DIALSTRING_SS_CONF} {@link ImsCallProfile#DIALSTRING_USSD}
public static final String
EXTRA_CNAP
public static final String
EXTRA_DIALSTRING
public static final int
OIR_DEFAULT
Values for EXTRA_OIR / EXTRA_CNAP
public static final int
OIR_PRESENTATION_RESTRICTED
public static final int
OIR_PRESENTATION_NOT_RESTRICTED
public static final int
DIALSTRING_NORMAL
Values for EXTRA_DIALSTRING
public static final int
DIALSTRING_SS_CONF
public static final int
DIALSTRING_USSD
public static final int
CALL_RESTRICT_CAUSE_NONE
Values for causes that restrict call types
public static final int
CALL_RESTRICT_CAUSE_RAT
public static final int
CALL_RESTRICT_CAUSE_DISABLED
public static final int
CALL_RESTRICT_CAUSE_HD
public static final String
EXTRA_OI
String extra properties oi : Originating identity (number), MT only cna : Calling name ussd : For network-initiated USSD, MT only remote_uri : Connected user identity (it can be used for the conference)
public static final String
EXTRA_CNA
public static final String
EXTRA_USSD
public static final String
EXTRA_REMOTE_URI
public int
mServiceType
public int
mCallType
public int
mRestrictCause
public android.os.Bundle
mCallExtras
public ImsStreamMediaProfile
mMediaProfile
public static final Creator
CREATOR
Constructors Summary
public ImsCallProfile(android.os.Parcel in)


       
        readFromParcel(in);
    
public ImsCallProfile()

        mServiceType = SERVICE_TYPE_NORMAL;
        mCallType = CALL_TYPE_VOICE_N_VIDEO;
        mCallExtras = new Bundle();
        mMediaProfile = new ImsStreamMediaProfile();
    
public ImsCallProfile(int serviceType, int callType)

        mServiceType = serviceType;
        mCallType = callType;
        mCallExtras = new Bundle();
        mMediaProfile = new ImsStreamMediaProfile();
    
Methods Summary
public static intOIRToPresentation(int oir)
Translate OIR value to presentation value

param
oir value
return
presentation value

        switch(oir) {
            case ImsCallProfile.OIR_PRESENTATION_RESTRICTED:
                return PhoneConstants.PRESENTATION_RESTRICTED;
            case ImsCallProfile.OIR_PRESENTATION_NOT_RESTRICTED:
                return PhoneConstants.PRESENTATION_ALLOWED;
            default:
                return PhoneConstants.PRESENTATION_UNKNOWN;
        }
    
public intdescribeContents()

        return 0;
    
public java.lang.StringgetCallExtra(java.lang.String name)

        return getCallExtra(name, "");
    
public java.lang.StringgetCallExtra(java.lang.String name, java.lang.String defaultValue)

        if (mCallExtras == null) {
            return defaultValue;
        }

        return mCallExtras.getString(name, defaultValue);
    
public booleangetCallExtraBoolean(java.lang.String name)

        return getCallExtraBoolean(name, false);
    
public booleangetCallExtraBoolean(java.lang.String name, boolean defaultValue)

        if (mCallExtras == null) {
            return defaultValue;
        }

        return mCallExtras.getBoolean(name, defaultValue);
    
public intgetCallExtraInt(java.lang.String name)

        return getCallExtraInt(name, -1);
    
public intgetCallExtraInt(java.lang.String name, int defaultValue)

        if (mCallExtras == null) {
            return defaultValue;
        }

        return mCallExtras.getInt(name, defaultValue);
    
public static intgetCallTypeFromVideoState(int videoState)
Converts from the video state values defined in {@link VideoProfile} to the call types defined in {@link ImsCallProfile}.

param
videoState The video state.
return
The call type.

        boolean videoTx = isVideoStateSet(videoState, VideoProfile.VideoState.TX_ENABLED);
        boolean videoRx = isVideoStateSet(videoState, VideoProfile.VideoState.RX_ENABLED);
        boolean isPaused = isVideoStateSet(videoState, VideoProfile.VideoState.PAUSED);
        if (isPaused) {
            return ImsCallProfile.CALL_TYPE_VT_NODIR;
        } else if (videoTx && !videoRx) {
            return ImsCallProfile.CALL_TYPE_VT_TX;
        } else if (!videoTx && videoRx) {
            return ImsCallProfile.CALL_TYPE_VT_RX;
        } else if (videoTx && videoRx) {
            return ImsCallProfile.CALL_TYPE_VT;
        }
        return ImsCallProfile.CALL_TYPE_VOICE;
    
public static intgetVideoStateFromCallType(int callType)
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.
return
The video state.


                                    
         
        switch (callType) {
            case CALL_TYPE_VT_NODIR:
                return VideoProfile.VideoState.PAUSED |
                        VideoProfile.VideoState.BIDIRECTIONAL;
            case CALL_TYPE_VT_TX:
                return VideoProfile.VideoState.TX_ENABLED;
            case CALL_TYPE_VT_RX:
                return VideoProfile.VideoState.RX_ENABLED;
            case CALL_TYPE_VT:
                return VideoProfile.VideoState.BIDIRECTIONAL;
            case CALL_TYPE_VOICE:
                return VideoProfile.VideoState.AUDIO_ONLY;
            default:
                return VideoProfile.VideoState.AUDIO_ONLY;
        }
    
private static booleanisVideoStateSet(int videoState, int videoStateToCheck)
Determines if a video state is set in a video state bit-mask.

param
videoState The video state bit mask.
param
videoStateToCheck The particular video state to check.
return
True if the video state is set in the bit-mask.

        return (videoState & videoStateToCheck) == videoStateToCheck;
    
public static intpresentationToOIR(int presentation)
Translate presentation value to OIR value

param
presentation
return
OIR valuse

        switch (presentation) {
            case PhoneConstants.PRESENTATION_RESTRICTED:
                return ImsCallProfile.OIR_PRESENTATION_RESTRICTED;
            case PhoneConstants.PRESENTATION_ALLOWED:
                return ImsCallProfile.OIR_PRESENTATION_NOT_RESTRICTED;
            default:
                return ImsCallProfile.OIR_DEFAULT;
        }
    
private voidreadFromParcel(android.os.Parcel in)

        mServiceType = in.readInt();
        mCallType = in.readInt();
        mCallExtras = in.readParcelable(null);
        mMediaProfile = in.readParcelable(null);
    
public voidsetCallExtra(java.lang.String name, java.lang.String value)

        if (mCallExtras != null) {
            mCallExtras.putString(name, value);
        }
    
public voidsetCallExtraBoolean(java.lang.String name, boolean value)

        if (mCallExtras != null) {
            mCallExtras.putBoolean(name, value);
        }
    
public voidsetCallExtraInt(java.lang.String name, int value)

        if (mCallExtras != null) {
            mCallExtras.putInt(name, value);
        }
    
public java.lang.StringtoString()

        return "{ serviceType=" + mServiceType +
                ", callType=" + mCallType +
                ", restrictCause=" + mRestrictCause +
                ", callExtras=" + mCallExtras.toString() +
                ", mediaProfile=" + mMediaProfile.toString() + " }";
    
public voidupdateCallExtras(com.android.ims.ImsCallProfile profile)

        mCallExtras.clear();
        mCallExtras = (Bundle) profile.mCallExtras.clone();
    
public voidupdateCallType(com.android.ims.ImsCallProfile profile)

        mCallType = profile.mCallType;
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        out.writeInt(mServiceType);
        out.writeInt(mCallType);
        out.writeParcelable(mCallExtras, 0);
        out.writeParcelable(mMediaProfile, 0);