public abstract class ServiceRecommendationPlugin extends Object implements PrintServicePlugin, ServiceListener.Observer
PrintServicePlugin.PrinterDiscoveryCallback
Modifier and Type | Field and Description |
---|---|
protected PrintServicePlugin.PrinterDiscoveryCallback |
mCallback |
protected ServiceListener |
mListener |
protected Object |
mLock |
protected NsdManager |
mNSDManager |
protected VendorInfo |
mVendorInfo |
protected static String |
PDL_ATTRIBUTE |
Modifier | Constructor and Description |
---|---|
protected |
ServiceRecommendationPlugin(Context context,
int vendorStringID,
VendorInfo vendorInfo,
String[] services) |
Modifier and Type | Method and Description |
---|---|
void |
dataSetChanged() |
int |
getCount() |
int |
getName()
Get the name (a string reference) of the
print
service with the specified package name . |
CharSequence |
getPackageName()
The package name of the full print service.
|
boolean |
matchesCriteria(String vendor,
NsdServiceInfo nsdServiceInfo) |
void |
start(PrintServicePlugin.PrinterDiscoveryCallback callback)
Start the discovery plugin.
|
void |
stop()
Stop the plugin.
|
protected static final String PDL_ATTRIBUTE
protected final Object mLock
protected PrintServicePlugin.PrinterDiscoveryCallback mCallback
protected final ServiceListener mListener
protected final NsdManager mNSDManager
protected final VendorInfo mVendorInfo
protected ServiceRecommendationPlugin(Context context, int vendorStringID, VendorInfo vendorInfo, String[] services)
public int getName()
PrintServicePlugin
print
service
with the specified package name
. This is read once, hence
returning different data at different times is not allowed.getName
in interface PrintServicePlugin
public CharSequence getPackageName()
PrintServicePlugin
getPackageName
in interface PrintServicePlugin
public void start(PrintServicePlugin.PrinterDiscoveryCallback callback) throws Exception
PrintServicePlugin
start
in interface PrintServicePlugin
callback
- Callbacks used by this plugin.Exception
- If anything went wrong when starting the pluginpublic void stop() throws Exception
PrintServicePlugin
stop
in interface PrintServicePlugin
Exception
- If anything went wrong while stopping pluginpublic void dataSetChanged()
dataSetChanged
in interface ServiceListener.Observer
public boolean matchesCriteria(String vendor, NsdServiceInfo nsdServiceInfo)
matchesCriteria
in interface ServiceListener.Observer
public int getCount()