FileDocCategorySizeDatePackage
GSMCall.javaAPI DocAndroid 1.5 API5577Wed May 06 22:42:02 BST 2009com.android.internal.telephony.gsm

GSMCall

public class GSMCall extends Call
{@hide}

Fields Summary
ArrayList
connections
Instance Variables
State
state
CallTracker
owner
Constructors Summary
GSMCall(CallTracker owner)
Constructors

        this.owner = owner;
    
Methods Summary
voidattach(GSMConnection conn, DriverCall dc)

        connections.add(conn);

        state = stateFromDCState (dc.state);
    
voidattachFake(GSMConnection conn, State state)

        connections.add(conn);

        this.state = state;
    
voidclearDisconnected()
Called when it's time to clean up disconnected Connection objects

        for (int i = connections.size() - 1 ; i >= 0 ; i--) {
            GSMConnection cn = (GSMConnection)connections.get(i);
            
            if (cn.getState() == State.DISCONNECTED) {
                connections.remove(i);
            }
        }    

        if (connections.size() == 0) {
            state = State.IDLE;
        }
    
voidconnectionDisconnected(GSMConnection conn)
Called by GSMConnection when it has disconnected

        if (state != State.DISCONNECTED) {
            /* If only disconnected connections remain, we are disconnected*/

            boolean hasOnlyDisconnectedConnections = true;
            
            for (int i = 0, s = connections.size()  ; i < s; i ++) {
                if (connections.get(i).getState() 
                    != State.DISCONNECTED
                ) {
                    hasOnlyDisconnectedConnections = false;
                    break;
                }            
            }

            if (hasOnlyDisconnectedConnections) {
                state = State.DISCONNECTED;            
            }
        }    
    
voiddetach(GSMConnection conn)

        connections.remove(conn);

        if (connections.size() == 0) {
            state = State.IDLE;
        }
    
public java.util.ListgetConnections()
Overridden from Call

        // FIXME should return Collections.unmodifiableList();
        return connections;
    
public PhonegetPhone()

        //TODO
        return null;
    
public StategetState()

        return state;
    
public voidhangup()
Please note: if this is the foreground call and a background call exists, the background call will be resumed because an AT+CHLD=1 will be sent

        owner.hangup(this);
    
booleanisFull()

return
true if there's no space in this call for additional connections to be added via "conference"

        return connections.size() == CallTracker.MAX_CONNECTIONS_PER_CALL;
    
public booleanisMultiparty()

        return connections.size() > 1;
    
voidonHangupLocal()
Called when this Call is being hung up locally (eg, user pressed "end") Note that at this point, the hangup request has been dispatched to the radio but no response has yet been received so update() has not yet been called

        for (int i = 0, s = connections.size()
                ; i < s; i++
        ) {
            GSMConnection cn = (GSMConnection)connections.get(i);

            cn.onHangupLocal();
        }
    
static StatestateFromDCState(DriverCall.State dcState)
Class Methods


       

     
      
    
        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);
        }
    
public java.lang.StringtoString()

        return state.toString();
    
booleanupdate(GSMConnection conn, DriverCall dc)

        State newState;
        boolean changed = false;
        
        newState = stateFromDCState(dc.state);
        
        if (newState != state) {
            state = newState;
            changed = true;
        }

        return changed;