FileDocCategorySizeDatePackage
Call.javaAPI DocAndroid 5.1 API6741Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony

Call

public abstract class Call extends Object
{@hide}

Fields Summary
protected final String
LOG_TAG
public State
mState
public ArrayList
mConnections
protected boolean
mIsGeneric
Constructors Summary
Methods Summary
public abstract java.util.ListgetConnections()
Do not modify the List result!!! This list is not yours to keep It will change across event loop iterations top

public longgetEarliestConnectTime()

        long time = Long.MAX_VALUE;
        List<Connection> l = getConnections();

        if (l.size() == 0) {
            return 0;
        }

        for (int i = 0, s = l.size() ; i < s ; i++) {
            Connection c = l.get(i);
            long t;

            t = c.getConnectTime();

            time = t < time ? t : time;
        }

        return time;
    
public ConnectiongetEarliestConnection()
Returns the Connection associated with this Call that was created first, or null if there are no Connections in this Call

        List<Connection> l;
        long time = Long.MAX_VALUE;
        Connection c;
        Connection earliest = null;

        l = getConnections();

        if (l.size() == 0) {
            return null;
        }

        for (int i = 0, s = l.size() ; i < s ; i++) {
            c = l.get(i);
            long t;

            t = c.getCreateTime();

            if (t < time) {
                earliest = c;
                time = t;
            }
        }

        return earliest;
    
public longgetEarliestCreateTime()

        List<Connection> l;
        long time = Long.MAX_VALUE;

        l = getConnections();

        if (l.size() == 0) {
            return 0;
        }

        for (int i = 0, s = l.size() ; i < s ; i++) {
            Connection c = l.get(i);
            long t;

            t = c.getCreateTime();

            time = t < time ? t : time;
        }

        return time;
    
public ConnectiongetLatestConnection()
Returns the Connection associated with this Call that was created last, or null if there are no Connections in this Call

        List<Connection> l = getConnections();
        if (l.size() == 0) {
            return null;
        }

        long time = 0;
        Connection latest = null;
        for (int i = 0, s = l.size() ; i < s ; i++) {
            Connection c = l.get(i);
            long t = c.getCreateTime();

            if (t > time) {
                latest = c;
                time = t;
            }
        }

        return latest;
    
public abstract PhonegetPhone()

public com.android.internal.telephony.Call$StategetState()
getState

return
state of class call

        return mState;
    
public abstract voidhangup()

public voidhangupIfAlive()
Hangup call if it is alive

        if (getState().isAlive()) {
            try {
                hangup();
            } catch (CallStateException ex) {
                Rlog.w(LOG_TAG, " hangupIfActive: caught " + ex);
            }
        }
    
public booleanhasConnection(Connection c)
hasConnection

param
c a Connection object
return
true if the call contains the connection object passed in


    /* Instance Methods */

                                          

       
       
       
         


                          
        
        return c.getCall() == this;
    
public booleanhasConnections()
hasConnections

return
true if the call contains one or more connections

        List<Connection> connections = getConnections();

        if (connections == null) {
            return false;
        }

        return connections.size() > 0;
    
public booleanisDialingOrAlerting()

        return getState().isDialing();
    
public booleanisGeneric()
To indicate if the connection information is accurate or not. false means accurate. Only used for CDMA.

        return mIsGeneric;
    
public booleanisIdle()
isIdle FIXME rename

return
true if the call contains only disconnected connections (if any)

        return !getState().isAlive();
    
public abstract booleanisMultiparty()

public booleanisRinging()

        return getState().isRinging();
    
public voidsetGeneric(boolean generic)
Set the generic instance variable

        mIsGeneric = generic;
    
public static com.android.internal.telephony.Call$StatestateFromDCState(DriverCall.State dcState)

        switch (dcState) {
            case ACTIVE:        return State.ACTIVE;
            case HOLDING:       return State.HOLDING;
            case DIALING:       return State.DIALING;
            case ALERTING:      return State.ALERTING;
            case INCOMING:      return State.INCOMING;
            case WAITING:       return State.WAITING;
            default:            throw new RuntimeException ("illegal call state:" + dcState);
        }