ServiceConnector

public abstract class ServiceConnector<S extends IInterface> implements ServiceConnection

Base class for implementing service connectors. A service connector is a class that encapsulates a bound AIDL service. Subclasses of this class implement methods that are specific to the service that they're interacting with.

Connection with the service happens implicitly. However, the user of a ServiceConnectormust call disconnect when he or she is done with the instance. For example, when using a ServiceConnector in an Activity, call disconnect from onPause() or onDestroy().

Parameters

<S>

The service interface that is being encapsulated.

Inheritors

Constructors

Link copied to clipboard
Constructs a new ServiceConnector object.

Types

Link copied to clipboard
public interface Callback<T>
Responds to the results of a call to a ServiceConnector method.
Link copied to clipboard

Functions

Link copied to clipboard
public boolean connect()
Link copied to clipboard
public void disconnect()
Link copied to clipboard
public synchronized S getService()
Returns the order service interface
Link copied to clipboard
public synchronized boolean isConnected()
Returns whether we are connected to the order service
Link copied to clipboard
public boolean isInstalled()
Link copied to clipboard
public void onBindingDied(ComponentName name)
Link copied to clipboard
public void onNullBinding(ComponentName name)
Link copied to clipboard
public final void onServiceConnected(ComponentName componentName, IBinder iBinder)
Part of the ServiceConnection interface.
Link copied to clipboard
public final void onServiceDisconnected(ComponentName componentName)
Part of the ServiceConnection interface.