FileDocCategorySizeDatePackage
SipConnectionBase.javaAPI DocAndroid 5.1 API6518Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony.sip

SipConnectionBase

public abstract class SipConnectionBase extends com.android.internal.telephony.Connection

Fields Summary
private static final String
LOG_TAG
private static final boolean
DBG
private static final boolean
VDBG
private String
mPostDialString
private int
mNextPostDialChar
private long
mCreateTime
private long
mConnectTime
private long
mDisconnectTime
private long
mConnectTimeReal
private long
mDuration
private long
mHoldingStartTime
private int
mCause
private PostDialState
mPostDialState
Constructors Summary
SipConnectionBase(String dialString)


      
        if (DBG) log("SipConnectionBase: ctor dialString=" + dialString);
        mPostDialString = PhoneNumberUtils.extractPostDialPortion(dialString);

        mCreateTime = System.currentTimeMillis();
    
Methods Summary
public voidcancelPostDial()

        if (DBG) log("cancelPostDial: ignore");
    
public longgetConnectTime()

        if (VDBG) log("getConnectTime: ret=" + mConnectTime);
        return mConnectTime;
    
public longgetConnectTimeReal()

        return mConnectTimeReal;
    
public longgetCreateTime()

        if (VDBG) log("getCreateTime: ret=" + mCreateTime);
        return mCreateTime;
    
public intgetDisconnectCause()

        if (VDBG) log("getDisconnectCause: ret=" + mCause);
        return mCause;
    
public longgetDisconnectTime()

        if (VDBG) log("getDisconnectTime: ret=" + mDisconnectTime);
        return mDisconnectTime;
    
public longgetDurationMillis()

        long dur;
        if (mConnectTimeReal == 0) {
            dur = 0;
        } else if (mDuration < 0) {
            dur = SystemClock.elapsedRealtime() - mConnectTimeReal;
        } else {
            dur = mDuration;
        }
        if (VDBG) log("getDurationMillis: ret=" + dur);
        return dur;
    
public longgetHoldDurationMillis()

        long dur;
        if (getState() != Call.State.HOLDING) {
            // If not holding, return 0
            dur = 0;
        } else {
            dur = SystemClock.elapsedRealtime() - mHoldingStartTime;
        }
        if (VDBG) log("getHoldDurationMillis: ret=" + dur);
        return dur;
    
public longgetHoldingStartTime()

        return mHoldingStartTime;
    
public intgetNumberPresentation()

        // TODO: add PRESENTATION_URL
        if (VDBG) log("getNumberPresentation: ret=PRESENTATION_ALLOWED");
        return PhoneConstants.PRESENTATION_ALLOWED;
    
public com.android.internal.telephony.ConnectiongetOrigConnection()

        return null;
    
protected abstract com.android.internal.telephony.PhonegetPhone()

public PostDialStategetPostDialState()

        if (VDBG) log("getPostDialState: ret=" + mPostDialState);
        return mPostDialState;
    
public intgetPreciseDisconnectCause()

        return 0;
    
public java.lang.StringgetRemainingPostDialString()

        if (mPostDialState == PostDialState.CANCELLED
            || mPostDialState == PostDialState.COMPLETE
            || mPostDialString == null
            || mPostDialString.length() <= mNextPostDialChar) {
            if (DBG) log("getRemaingPostDialString: ret empty string");
            return "";
        }

        return mPostDialString.substring(mNextPostDialChar);
    
public com.android.internal.telephony.UUSInfogetUUSInfo()

        // FIXME: what's this for SIP?
        if (VDBG) log("getUUSInfo: ? ret=null");
        return null;
    
public booleanisMultiparty()

        return false;
    
private voidlog(java.lang.String msg)

        Rlog.d(LOG_TAG, msg);
    
public voidproceedAfterWaitChar()

        if (DBG) log("proceedAfterWaitChar: ignore");
    
public voidproceedAfterWildChar(java.lang.String str)

        if (DBG) log("proceedAfterWildChar: ignore");
    
voidsetDisconnectCause(int cause)

        if (DBG) log("setDisconnectCause: prev=" + mCause + " new=" + cause);
        mCause = cause;
    
protected voidsetState(Call.State state)

        if (DBG) log("setState: state=" + state);
        switch (state) {
            case ACTIVE:
                if (mConnectTime == 0) {
                    mConnectTimeReal = SystemClock.elapsedRealtime();
                    mConnectTime = System.currentTimeMillis();
                }
                break;
            case DISCONNECTED:
                mDuration = getDurationMillis();
                mDisconnectTime = System.currentTimeMillis();
                break;
            case HOLDING:
                mHoldingStartTime = SystemClock.elapsedRealtime();
                break;
            default:
                // Ignore
                break;
        }