public class PrinterConnector extends ServiceConnector<IPrinterService>
IPrinterService
.
This class automatically binds and provides both synchronous and asynchronous service
method invocation.
Clients of this class may optionally call ServiceConnector.connect()
to force
pre-binding to the underlying service, and must call ServiceConnector.disconnect()
when finished interacting with the underlying service.
The preferred methods in this class are synchronous methods which do not use callbacks and
should be invoked on a non-main thread.Modifier and Type | Class and Description |
---|---|
static class |
PrinterConnector.PrinterCallback<T>
Deprecated.
|
ServiceConnector.Callback<T>, ServiceConnector.OnServiceConnectedListener, ServiceConnector.ServiceCallable<S,T>, ServiceConnector.ServiceRunnable<S>
mAccount, mClient, mConnected, mContext, mHandler, mService
Constructor and Description |
---|
PrinterConnector(Context context,
Account account,
ServiceConnector.OnServiceConnectedListener client)
Construct a new printer connector.
|
connect, disconnect, execute, execute, execute, execute, getService, getStartIntent, isConnected, isInstalled, notifyServiceConnected, notifyServiceDisconnected, onServiceConnected, onServiceDisconnected, postResults, throwOnFailure, waitForConnection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onBindingDied, onNullBinding
public PrinterConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
context
- The Context in which this connector will bind to the underlying service.account
- The Clover account which is used when binding to the underlying service.client
- A listener, or null to receive no notifications.protected String getServiceIntentAction()
getServiceIntentAction
in class ServiceConnector<IPrinterService>
protected String getServiceIntentPackage()
ServiceConnector
getServiceIntentPackage
in class ServiceConnector<IPrinterService>
protected int getServiceIntentVersion()
ServiceConnector
ServiceConnector.getServiceIntentAction()
instead of using this mechanism.getServiceIntentVersion
in class ServiceConnector<IPrinterService>
protected IPrinterService getServiceInterface(IBinder iBinder)
getServiceInterface
in class ServiceConnector<IPrinterService>
@Deprecated public void getPrinters(ServiceConnector.Callback<List<Printer>> callback)
getPrinters()
instead on a non-main thread.public List<Printer> getPrinters() throws RemoteException, ClientException, ServiceException, BindingException
@Deprecated public void getPrinters(Category category, ServiceConnector.Callback<List<Printer>> callback)
getPrinters(Category)
instead on a non-main thread.public List<Printer> getPrinters(Category category) throws RemoteException, ClientException, ServiceException, BindingException
@Deprecated public void isPrinterSet(Category category, ServiceConnector.Callback<Boolean> callback)
isPrinterSet(Category)
instead on a non-main thread.public boolean isPrinterSet(Category category) throws RemoteException, ClientException, ServiceException, BindingException
@Deprecated public void getPrinter(String id, ServiceConnector.Callback<Printer> callback)
getPrinter(String)
instead on a non-main thread.public Printer getPrinter(String id) throws RemoteException, ClientException, ServiceException, BindingException
@Deprecated public void setPrinter(Printer printer, ServiceConnector.Callback<Printer> callback)
setPrinter(Printer)
instead on a non-main thread.public Printer setPrinter(Printer printer) throws RemoteException, ClientException, ServiceException, BindingException
@Deprecated public void removePrinter(Printer printer, ServiceConnector.Callback<Void> callback)
removePrinter(Printer)
instead on a non-main thread.public void removePrinter(Printer printer) throws RemoteException, ClientException, ServiceException, BindingException
public TypeDetails getPrinterTypeDetails(Printer printer) throws RemoteException, ClientException, ServiceException, BindingException