public final class

CapabilityService

extends RcsService
java.lang.Object
   ↳ com.gsma.services.rcs.RcsService
     ↳ com.gsma.services.rcs.capability.CapabilityService

Class Overview

Capability service offers the main entry point to read capabilities of remote contacts, to initiate capability discovery and to receive capabilities updates. Several applications may connect/disconnect to the API. The parameter contact in the API supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI.

Summary

Constants
String EXTENSION_MIME_TYPE Extension MIME type
String INTENT_EXTENSIONS Intent broadcasted to discover extensions
[Expand]
Inherited Constants
From class com.gsma.services.rcs.RcsService
Public Constructors
CapabilityService(Context ctx, RcsServiceListener listener)
Constructor
Public Methods
void addCapabilitiesListener(Set<ContactId> contacts, CapabilitiesListener listener)
Registers a capabilities listener on a list of contacts
void addCapabilitiesListener(CapabilitiesListener listener)
Registers a capabilities listener on any contact
final void connect()
Connects to the API
void disconnect()
Disconnects from the API
Capabilities getContactCapabilities(ContactId contact)
Returns the capabilities of a given contact from the local database.
Capabilities getMyCapabilities()
Returns the capabilities supported by the local end user.
void removeCapabilitiesListener(CapabilitiesListener listener)
Unregisters a capabilities listener
void removeCapabilitiesListener(Set<ContactId> contacts, CapabilitiesListener listener)
Unregisters a capabilities listener on a list of contacts
void requestAllContactsCapabilities()
Requests capabilities for all contacts existing in the local address book.
void requestContactCapabilities(Set<ContactId> contacts)
Requests capabilities for a group of remote contacts.
void requestContactCapabilities(ContactId contact)
This method is deprecated. Use requestContactCapabilities(Set) instead.
[Expand]
Inherited Methods
From class com.gsma.services.rcs.RcsService
From class java.lang.Object

Constants

public static final String EXTENSION_MIME_TYPE

Since: API Level 1.5

Extension MIME type

Constant Value: "com.gsma.services.rcs"

public static final String INTENT_EXTENSIONS

Since: API Level 1.5

Intent broadcasted to discover extensions

Constant Value: "com.gsma.services.rcs.capability.EXTENSION"

Public Constructors

public CapabilityService (Context ctx, RcsServiceListener listener)

Since: API Level 1.5

Constructor

Parameters
ctx Application context
listener Service listener

Public Methods

public void addCapabilitiesListener (Set<ContactId> contacts, CapabilitiesListener listener)

Since: API Level 1.5

Registers a capabilities listener on a list of contacts

Parameters
contacts Set of contact Identifiers
listener Capabilities listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void addCapabilitiesListener (CapabilitiesListener listener)

Since: API Level 1.5

Registers a capabilities listener on any contact

Parameters
listener Capabilities listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public final void connect ()

Since: API Level 1.5

Connects to the API

public void disconnect ()

Since: API Level 1.5

Disconnects from the API

public Capabilities getContactCapabilities (ContactId contact)

Since: API Level 1.5

Returns the capabilities of a given contact from the local database. This method doesn't request any network update to the remote contact. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
contact Contact Identifier
Returns
  • Capabilities
Throws
RcsPersistentStorageException
RcsServiceNotAvailableException
RcsGenericException
RcsPersistentStorageException
RcsServiceNotAvailableException

public Capabilities getMyCapabilities ()

Since: API Level 1.5

Returns the capabilities supported by the local end user. The supported capabilities are fixed by the MNO and read during the provisioning.

Returns
  • Capabilities
Throws
RcsPersistentStorageException
RcsServiceNotAvailableException
RcsGenericException
RcsPersistentStorageException
RcsServiceNotAvailableException

public void removeCapabilitiesListener (CapabilitiesListener listener)

Since: API Level 1.5

Unregisters a capabilities listener

Parameters
listener Capabilities listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void removeCapabilitiesListener (Set<ContactId> contacts, CapabilitiesListener listener)

Since: API Level 1.5

Unregisters a capabilities listener on a list of contacts

Parameters
contacts Set of contact identifiers
listener Capabilities listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void requestAllContactsCapabilities ()

Since: API Level 1.5

Requests capabilities for all contacts existing in the local address book. This method initiates in background new capability requests for each contact of the address book by sending SIP OPTIONS. The result of a capability request is sent asynchronously via callback method of the capabilities listener. The result of the capability refresh request is provided to all the clients that have registered the listener for this event.

Throws
RcsServiceNotRegisteredException
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException

public void requestContactCapabilities (Set<ContactId> contacts)

Since: API Level 1.5

Requests capabilities for a group of remote contacts. This method initiates in background new capability requests to the remote contact by sending a SIP OPTIONS. The result of the capability request is sent asynchronously via callback method of the capabilities listener. The parameter contacts supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown. The result of the capability refresh request is provided to all the clients that have registered the listener for this event.

Parameters
contacts Set of contact identifiers
Throws
RcsServiceNotRegisteredException
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException

public void requestContactCapabilities (ContactId contact)

Since: API Level 1.5

This method is deprecated.
Use requestContactCapabilities(Set) instead.

Requests capabilities to a remote contact. This method initiates in background a new capability request to the remote contact by sending a SIP OPTIONS. The result of the capability request is sent asynchronously via callback method of the capabilities listener. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown. The result of the capability refresh request is provided to all the clients that have registered the listener for this event.

Parameters
contact Contact Identifier
Throws
RcsServiceNotRegisteredException
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException