public class ContactConnectorManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ContactConnectorManager.ConnectorFeature
Optional features supported by ContactConnectorHandler implementations
Profile provided as ActionBroadcastData, e.g.
|
static class |
ContactConnectorManager.ContactConnectorHandler
Handler to filter and process connectors
|
Constructor and Description |
---|
ContactConnectorManager(android.content.Context context,
android.content.SharedPreferences preferences) |
Modifier and Type | Method and Description |
---|---|
void |
addContactHandler(ContactConnectorManager.ContactConnectorHandler handler) |
java.util.Collection<Connector> |
getConnectors(IndividualContact contact,
ContactConnectorManager.ConnectorFeature feature)
Get list of connectors which have at least one handler which supports the specified feature,
for the given contact
e.g.
|
static java.lang.String |
getDefaultConnectorType(android.content.SharedPreferences prefs,
java.lang.String contactUID) |
java.lang.Object |
getFeature(IndividualContact contact,
Connector connector,
ContactConnectorManager.ConnectorFeature feature)
Get feature for the specified contact's connector
|
java.util.List<java.lang.Object> |
getFeatures(IndividualContact contact,
ContactConnectorManager.ConnectorFeature feature,
int max)
Get features for the specified contact
|
ContactConnectorManager.ContactConnectorHandler |
getHandler(java.lang.String connectorType)
Find a handler for the specified connector type
First searches for registered components that support the specified type
Then falls back on default implementation if none is found or none is successful in
initiating contact
|
ContactConnectorManager.ContactConnectorHandler |
getHandlerByName(java.lang.String connectorName)
Find a handler by its name or title
|
java.util.List<ContactConnectorManager.ContactConnectorHandler> |
getHandlers()
Return all registered connector handlers
Handlers are uniquely keyed by name, where registered
handlers take priority over the defaults
|
static long |
getLastUsed(android.content.SharedPreferences prefs,
java.lang.String contactUID,
java.lang.String connectorType) |
boolean |
initiateContact(IndividualContact contact,
Connector connector)
Attempt to initiate contact with the specified address
First searches for registered components that support the specified type
Then falls back on default implementation if none is found or none is successful in
initiating contact
|
boolean |
initiateContact(java.lang.String connectorType,
java.lang.String contactUID,
java.lang.String connectorAddress)
Attempt to initiate contact with the specified address
First searches for registered components that support the specified type
Then falls back on default implementation if none is found or none is successful in
initiating contact
|
void |
removeContactHandler(ContactConnectorManager.ContactConnectorHandler handler)
Remove a contact handler that has been registered with the ContactConnectorManager.
|
public ContactConnectorManager(android.content.Context context, android.content.SharedPreferences preferences)
public void addContactHandler(ContactConnectorManager.ContactConnectorHandler handler)
public void removeContactHandler(ContactConnectorManager.ContactConnectorHandler handler)
handler
- the registered contact handler.public boolean initiateContact(IndividualContact contact, Connector connector)
contact
- the contact to initate contact withconnector
- the connector to usepublic boolean initiateContact(java.lang.String connectorType, java.lang.String contactUID, java.lang.String connectorAddress)
connectorType
- requiredcontactUID
- UID or address is requiredconnectorAddress
- UID or address is requiredpublic ContactConnectorManager.ContactConnectorHandler getHandler(java.lang.String connectorType)
connectorType
- requiredpublic ContactConnectorManager.ContactConnectorHandler getHandlerByName(java.lang.String connectorName)
connectorName
- Connector namepublic java.util.List<ContactConnectorManager.ContactConnectorHandler> getHandlers()
public java.util.Collection<Connector> getConnectors(IndividualContact contact, ContactConnectorManager.ConnectorFeature feature)
contact
- feature
- public java.util.List<java.lang.Object> getFeatures(IndividualContact contact, ContactConnectorManager.ConnectorFeature feature, int max)
contact
- feature
- max
- limit number of featurespublic java.lang.Object getFeature(IndividualContact contact, Connector connector, ContactConnectorManager.ConnectorFeature feature)
contact
- the contact to be usedconnector
- the connectorfeature
- the feature desiredpublic static long getLastUsed(android.content.SharedPreferences prefs, java.lang.String contactUID, java.lang.String connectorType)
public static java.lang.String getDefaultConnectorType(android.content.SharedPreferences prefs, java.lang.String contactUID)