FileDocCategorySizeDatePackage
BluetoothHeadsetClientCall.javaAPI DocAndroid 5.1 API6586Thu Mar 12 22:22:10 GMT 2015android.bluetooth

BluetoothHeadsetClientCall

public final class BluetoothHeadsetClientCall extends Object implements android.os.Parcelable
This class represents a single call, its state and properties. It implements {@link Parcelable} for inter-process message passing.
hide

Fields Summary
public static final int
CALL_STATE_ACTIVE
Call is active.
public static final int
CALL_STATE_HELD
Call is in held state.
public static final int
CALL_STATE_DIALING
Outgoing call that is being dialed right now.
public static final int
CALL_STATE_ALERTING
Outgoing call that remote party has already been alerted about.
public static final int
CALL_STATE_INCOMING
Incoming call that can be accepted or rejected.
public static final int
CALL_STATE_WAITING
Waiting call state when there is already an active call.
public static final int
CALL_STATE_HELD_BY_RESPONSE_AND_HOLD
Call that has been held by response and hold (see Bluetooth specification for further references).
public static final int
CALL_STATE_TERMINATED
Call that has been already terminated and should not be referenced as a valid call.
private final int
mId
private int
mState
private String
mNumber
private boolean
mMultiParty
private final boolean
mOutgoing
public static final Parcelable.Creator
CREATOR
{@link Parcelable.Creator} interface implementation.
Constructors Summary
public BluetoothHeadsetClientCall(int id, int state, String number, boolean multiParty, boolean outgoing)
Creates BluetoothHeadsetClientCall instance.


            
            
              
        mId = id;
        mState = state;
        mNumber = number != null ? number : "";
        mMultiParty = multiParty;
        mOutgoing = outgoing;
    
Methods Summary
public intdescribeContents()

        return 0;
    
public intgetId()
Gets call's Id.

return
call id.

        return mId;
    
public java.lang.StringgetNumber()
Gets call's number.

return
string representing phone number.

        return mNumber;
    
public intgetState()
Gets call's current state.

return
state of this particular phone call.

        return mState;
    
public booleanisMultiParty()
Checks if call is an active call in a conference mode (aka multi party).

return
true if call is a multi party call, false otherwise.

        return mMultiParty;
    
public booleanisOutgoing()
Checks if this call is an outgoing call.

return
true if its outgoing call, false otherwise.

        return mOutgoing;
    
public voidsetMultiParty(boolean multiParty)
Sets this call as multi party call.

Note: This is an internal function and shouldn't be exposed

param
multiParty if true sets this call as a part of multi party conference.

        mMultiParty = multiParty;
    
public voidsetNumber(java.lang.String number)
Sets call's number.

Note: This is an internal function and shouldn't be exposed

param
number String representing phone number.

        mNumber = number;
    
public voidsetState(int state)
Sets call's state.

Note: This is an internal function and shouldn't be exposed

param
state new call state.

        mState = state;
    
public java.lang.StringtoString()

        StringBuilder builder = new StringBuilder("BluetoothHeadsetClientCall{mId: ");
        builder.append(mId);
        builder.append(", mState: ");
        switch (mState) {
            case CALL_STATE_ACTIVE: builder.append("ACTIVE"); break;
            case CALL_STATE_HELD: builder.append("HELD"); break;
            case CALL_STATE_DIALING: builder.append("DIALING"); break;
            case CALL_STATE_ALERTING: builder.append("ALERTING"); break;
            case CALL_STATE_INCOMING: builder.append("INCOMING"); break;
            case CALL_STATE_WAITING: builder.append("WAITING"); break;
            case CALL_STATE_HELD_BY_RESPONSE_AND_HOLD: builder.append("HELD_BY_RESPONSE_AND_HOLD"); break;
            case CALL_STATE_TERMINATED: builder.append("TERMINATED"); break;
            default: builder.append(mState); break;
        }
        builder.append(", mNumber: ");
        builder.append(mNumber);
        builder.append(", mMultiParty: ");
        builder.append(mMultiParty);
        builder.append(", mOutgoing: ");
        builder.append(mOutgoing);
        builder.append("}");
        return builder.toString();
    
public voidwriteToParcel(android.os.Parcel out, int flags)


    
          
        out.writeInt(mId);
        out.writeInt(mState);
        out.writeString(mNumber);
        out.writeInt(mMultiParty ? 1 : 0);
        out.writeInt(mOutgoing ? 1 : 0);