FileDocCategorySizeDatePackage
InCallService.javaAPI DocAndroid 5.1 API15127Thu Mar 12 22:22:42 GMT 2015android.telecom

InCallService

public abstract class InCallService extends android.app.Service
This service is implemented by any app that wishes to provide the user-interface for managing phone calls. Telecom binds to this service while there exists a live (active or incoming) call, and uses it to notify the in-call app of any live and and recently disconnected calls. {@hide}

Fields Summary
public static final String
SERVICE_INTERFACE
The {@link Intent} that must be declared as handled by the service.
private static final int
MSG_SET_IN_CALL_ADAPTER
private static final int
MSG_ADD_CALL
private static final int
MSG_UPDATE_CALL
private static final int
MSG_SET_POST_DIAL_WAIT
private static final int
MSG_ON_AUDIO_STATE_CHANGED
private static final int
MSG_BRING_TO_FOREGROUND
private static final int
MSG_ON_CAN_ADD_CALL_CHANGED
private final android.os.Handler
mHandler
Default Handler used to consolidate binder method calls onto a single thread.
private Phone
mPhone
Constructors Summary
public InCallService()

    
Methods Summary
public PhonegetPhone()
Obtain the {@code Phone} associated with this {@code InCallService}.

return
The {@code Phone} object associated with this {@code InCallService}, or {@code null} if the {@code InCallService} is not in a state where it has an associated {@code Phone}.

        return mPhone;
    
public android.os.IBinderonBind(android.content.Intent intent)

        return new InCallServiceBinder();
    
public voidonPhoneCreated(Phone phone)
Invoked when the {@code Phone} has been created. This is a signal to the in-call experience to start displaying in-call information to the user. Each instance of {@code InCallService} will have only one {@code Phone}, and this method will be called exactly once in the lifetime of the {@code InCallService}.

param
phone The {@code Phone} object associated with this {@code InCallService}.

    
public voidonPhoneDestroyed(Phone phone)
Invoked when a {@code Phone} has been destroyed. This is a signal to the in-call experience to stop displaying in-call information to the user. This method will be called exactly once in the lifetime of the {@code InCallService}, and it will always be called after a previous call to {@link #onPhoneCreated(Phone)}.

param
phone The {@code Phone} object associated with this {@code InCallService}.

    
public booleanonUnbind(android.content.Intent intent)

        if (mPhone != null) {
            Phone oldPhone = mPhone;
            mPhone = null;

            oldPhone.destroy();
            onPhoneDestroyed(oldPhone);
        }
        return false;