FileDocCategorySizeDatePackage
RemoteConference.javaAPI DocAndroid 5.1 API7972Thu Mar 12 22:22:42 GMT 2015android.telecom

RemoteConference

public final class RemoteConference extends Object
Represents a conference call which can contain any number of {@link Connection} objects.
hide

Fields Summary
private final String
mId
private final com.android.internal.telecom.IConnectionService
mConnectionService
private final Set
mCallbacks
private final List
mChildConnections
private final List
mUnmodifiableChildConnections
private final List
mConferenceableConnections
private final List
mUnmodifiableConferenceableConnections
private int
mState
private DisconnectCause
mDisconnectCause
private int
mConnectionCapabilities
Constructors Summary
RemoteConference(String id, com.android.internal.telecom.IConnectionService connectionService)
{@hide}


      
        
        mId = id;
        mConnectionService = connectionService;
    
Methods Summary
voidaddConnection(RemoteConnection connection)
{@hide}

        if (!mChildConnections.contains(connection)) {
            mChildConnections.add(connection);
            connection.setConference(this);
            for (Callback c : mCallbacks) {
                c.onConnectionAdded(this, connection);
            }
        }
    
public voiddisconnect()

        try {
            mConnectionService.disconnect(mId);
        } catch (RemoteException e) {
        }
    
public final intgetCallCapabilities()

hide

        return getConnectionCapabilities();
    
public java.util.ListgetConferenceableConnections()

        return mUnmodifiableConferenceableConnections;
    
public final intgetConnectionCapabilities()

        return mConnectionCapabilities;
    
public final java.util.ListgetConnections()

        return mUnmodifiableChildConnections;
    
public DisconnectCausegetDisconnectCause()

        return mDisconnectCause;
    
java.lang.StringgetId()
{@hide}

        return mId;
    
public final intgetState()

        return mState;
    
public voidhold()

        try {
            mConnectionService.hold(mId);
        } catch (RemoteException e) {
        }
    
public voidmerge()

        try {
            mConnectionService.mergeConference(mId);
        } catch (RemoteException e) {
        }
    
public voidplayDtmfTone(char digit)

        try {
            mConnectionService.playDtmfTone(mId, digit);
        } catch (RemoteException e) {
        }
    
public final voidregisterCallback(android.telecom.RemoteConference$Callback callback)

        mCallbacks.add(callback);
    
voidremoveConnection(RemoteConnection connection)
{@hide}

        if (mChildConnections.contains(connection)) {
            mChildConnections.remove(connection);
            connection.setConference(null);
            for (Callback c : mCallbacks) {
                c.onConnectionRemoved(this, connection);
            }
        }
    
public voidseparate(RemoteConnection connection)

        if (mChildConnections.contains(connection)) {
            try {
                mConnectionService.splitFromConference(connection.getId());
            } catch (RemoteException e) {
            }
        }
    
public voidsetAudioState(AudioState state)

        try {
            mConnectionService.onAudioStateChanged(mId, state);
        } catch (RemoteException e) {
        }
    
voidsetConferenceableConnections(java.util.List conferenceableConnections)

hide

        mConferenceableConnections.clear();
        mConferenceableConnections.addAll(conferenceableConnections);
        for (Callback c : mCallbacks) {
            c.onConferenceableConnectionsChanged(this, mUnmodifiableConferenceableConnections);
        }
    
voidsetConnectionCapabilities(int connectionCapabilities)
{@hide}

        if (mConnectionCapabilities != connectionCapabilities) {
            mConnectionCapabilities = connectionCapabilities;
            for (Callback c : mCallbacks) {
                c.onConnectionCapabilitiesChanged(this, mConnectionCapabilities);
            }
        }
    
voidsetDestroyed()
{@hide}

        for (RemoteConnection connection : mChildConnections) {
            connection.setConference(null);
        }
        for (Callback c : mCallbacks) {
            c.onDestroyed(this);
        }
    
voidsetDisconnected(DisconnectCause disconnectCause)
{@hide}

        if (mState != Connection.STATE_DISCONNECTED) {
            mDisconnectCause = disconnectCause;
            setState(Connection.STATE_DISCONNECTED);
            for (Callback c : mCallbacks) {
                c.onDisconnected(this, disconnectCause);
            }
        }
    
voidsetState(int newState)
{@hide}

        if (newState != Connection.STATE_ACTIVE &&
                newState != Connection.STATE_HOLDING &&
                newState != Connection.STATE_DISCONNECTED) {
            Log.w(this, "Unsupported state transition for Conference call.",
                    Connection.stateToString(newState));
            return;
        }

        if (mState != newState) {
            int oldState = mState;
            mState = newState;
            for (Callback c : mCallbacks) {
                c.onStateChanged(this, oldState, newState);
            }
        }
    
public voidstopDtmfTone()

        try {
            mConnectionService.stopDtmfTone(mId);
        } catch (RemoteException e) {
        }
    
public voidswap()

        try {
            mConnectionService.swapConference(mId);
        } catch (RemoteException e) {
        }
    
public voidunhold()

        try {
            mConnectionService.unhold(mId);
        } catch (RemoteException e) {
        }
    
public final voidunregisterCallback(android.telecom.RemoteConference$Callback callback)

        mCallbacks.remove(callback);