/** * Unregisters a capabilities listener * * @param listener Capabilities listener * @throws RcsServiceNotAvailableException * @throws RcsGenericException */ public void removeCapabilitiesListener(CapabilitiesListener listener) throws RcsServiceNotAvailableException, RcsGenericException { if (mApi == null) { throw new RcsServiceNotAvailableException(); } try { mApi.removeCapabilitiesListener(listener); } catch (Exception e) { RcsIllegalArgumentException.assertException(e); throw new RcsGenericException(e); } }
/** * 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. * * @param contact Contact Identifier * @throws RcsServiceNotRegisteredException * @throws RcsServiceNotAvailableException * @throws RcsGenericException */ public void requestContactCapabilities(ContactId contact) throws RcsServiceNotRegisteredException, RcsServiceNotAvailableException, RcsGenericException { if (mApi == null) { throw new RcsServiceNotAvailableException(); } try { mApi.requestContactCapabilities(contact); } catch (Exception e) { RcsIllegalArgumentException.assertException(e); RcsServiceNotRegisteredException.assertException(e); throw new RcsGenericException(e); } }
/** * 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. * * @param contact Contact Identifier * @return Capabilities * @throws RcsPersistentStorageException * @throws RcsServiceNotAvailableException * @throws RcsGenericException */ public Capabilities getContactCapabilities(ContactId contact) throws RcsPersistentStorageException, RcsServiceNotAvailableException, RcsGenericException { if (mApi == null) { throw new RcsServiceNotAvailableException(); } try { return mApi.getContactCapabilities(contact); } catch (Exception e) { RcsIllegalArgumentException.assertException(e); RcsPersistentStorageException.assertException(e); throw new RcsGenericException(e); } }
/** * Unregisters a capabilities listener on a list of contacts * * @param contacts Set of contact identifiers * @param listener Capabilities listener * @throws RcsServiceNotAvailableException * @throws RcsGenericException */ public void removeCapabilitiesListener(Set<ContactId> contacts, CapabilitiesListener listener) throws RcsServiceNotAvailableException, RcsGenericException { if (mApi == null) { throw new RcsServiceNotAvailableException(); } if (contacts == null || contacts.isEmpty()) { throw new RcsIllegalArgumentException("contacts must not be null or empty!"); } try { for (ContactId contact : contacts) { mApi.removeCapabilitiesListener2(contact, listener); } } catch (Exception e) { RcsIllegalArgumentException.assertException(e); throw new RcsGenericException(e); } }