ImsRcsManager
open class ImsRcsManager
kotlin.Any | |
↳ | android.telephony.ims.ImsRcsManager |
Manager for interfacing with the framework RCS services, including the User Capability Exchange (UCE) service, as well as managing user settings. Use ImsManager#getImsRcsManager(int)
to create an instance of this manager.
Requires the PackageManager#FEATURE_TELEPHONY_IMS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Summary
Constants | |
---|---|
static String |
Activity Action: Show the opt-in dialog for enabling or disabling RCS contact discovery using User Capability Exchange (UCE), which enables a service that periodically shares the phone numbers of all of the contacts in the user's address book with the carrier to refresh the RCS capabilities associated with those contacts as the local cache becomes stale. |
static Int |
Undefined capability type for initialization |
static Int |
This carrier supports User Capability Exchange using SIP OPTIONS as defined by the framework. |
static Int |
This carrier supports User Capability Exchange using a presence server as defined by the framework. |
Public methods | |
---|---|
open Unit |
getRegistrationState(executor: Executor, stateCallback: Consumer<Int!>) Gets the registration state of the IMS service. |
open Unit |
getRegistrationTransportType(executor: Executor, transportTypeCallback: Consumer<Int!>) Gets the Transport Type associated with the current IMS registration. |
open RcsUceAdapter | |
open Unit |
Registers a |
open Unit |
registerImsStateCallback(executor: Executor, callback: ImsStateCallback) Register a new callback, which is used to notify the registrant of changes to the state of the underlying IMS service that is attached to telephony to implement IMS functionality. |
open Unit |
Removes an existing |
open Unit |
unregisterImsStateCallback(callback: ImsStateCallback) Unregisters a previously registered callback. |
Constants
ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN
static val ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN: String
Activity Action: Show the opt-in dialog for enabling or disabling RCS contact discovery using User Capability Exchange (UCE), which enables a service that periodically shares the phone numbers of all of the contacts in the user's address book with the carrier to refresh the RCS capabilities associated with those contacts as the local cache becomes stale.
An application that depends on RCS contact discovery being enabled must send this intent using Context#startActivity(Intent)
to ask the user to opt-in for contacts upload for capability exchange if it is currently disabled. Whether or not RCS contact discovery has been enabled by the user can be queried using RcsUceAdapter#isUceSettingEnabled()
.
This intent will always be handled by the system, however the application should only send this Intent if the carrier supports bulk RCS contact exchange, which will be true if either key android.telephony.CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL
or android.telephony.CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL
is set to true. Otherwise, the RCS contact discovery opt-in dialog will not be shown.
Input: A mandatory Settings#EXTRA_SUB_ID
extra containing the subscription that the setting will be be shown for.
Output: Nothing
Value: "android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN"
See Also
CAPABILITY_TYPE_NONE
static val CAPABILITY_TYPE_NONE: Int
Undefined capability type for initialization
Value: 0
CAPABILITY_TYPE_OPTIONS_UCE
static val CAPABILITY_TYPE_OPTIONS_UCE: Int
This carrier supports User Capability Exchange using SIP OPTIONS as defined by the framework. If set, the RcsFeature should support capability exchange using SIP OPTIONS. If not set, this RcsFeature should not service capability requests.
Value: 1
CAPABILITY_TYPE_PRESENCE_UCE
static val CAPABILITY_TYPE_PRESENCE_UCE: Int
This carrier supports User Capability Exchange using a presence server as defined by the framework. If set, the RcsFeature should support capability exchange using a presence server. If not set, this RcsFeature should not publish capabilities or service capability requests using presence.
Value: 2
Public methods
getRegistrationState
open fun getRegistrationState(
executor: Executor,
stateCallback: Consumer<Int!>
): Unit
Gets the registration state of the IMS service. Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see android.telephony.TelephonyManager#hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
Parameters | |
---|---|
executor |
Executor: The Executor that will be used to call the IMS registration state callback. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
stateCallback |
Consumer<Int!>: A callback called on the supplied Executor that will contain the registration state of the IMS service, which will be one of the following: RegistrationManager#REGISTRATION_STATE_NOT_REGISTERED , RegistrationManager#REGISTRATION_STATE_REGISTERING , or RegistrationManager#REGISTRATION_STATE_REGISTERED . This value cannot be null . Value is android.telephony.ims.RegistrationManager#REGISTRATION_STATE_NOT_REGISTERED , android.telephony.ims.RegistrationManager#REGISTRATION_STATE_REGISTERING , or android.telephony.ims.RegistrationManager#REGISTRATION_STATE_REGISTERED |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager#FEATURE_TELEPHONY_IMS . |
getRegistrationTransportType
open fun getRegistrationTransportType(
executor: Executor,
transportTypeCallback: Consumer<Int!>
): Unit
Gets the Transport Type associated with the current IMS registration. Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see android.telephony.TelephonyManager#hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
Parameters | |
---|---|
executor |
Executor: The Executor that will be used to call the transportTypeCallback. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
transportTypeCallback |
Consumer<Int!>: The transport type associated with the current IMS registration, which will be one of following: {@see AccessNetworkConstants#TRANSPORT_TYPE_WWAN}, {@see AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, or {@see AccessNetworkConstants#TRANSPORT_TYPE_INVALID}. This value cannot be null . Value is android.telephony.AccessNetworkConstants.TRANSPORT_TYPE_INVALID, android.telephony.AccessNetworkConstants#TRANSPORT_TYPE_WWAN , or android.telephony.AccessNetworkConstants#TRANSPORT_TYPE_WLAN |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager#FEATURE_TELEPHONY_IMS . |
getUceAdapter
open fun getUceAdapter(): RcsUceAdapter
Return | |
---|---|
RcsUceAdapter |
A RcsUceAdapter used for User Capability Exchange (UCE) operations for this subscription. This value cannot be null . |
registerImsRegistrationCallback
open fun registerImsRegistrationCallback(
executor: Executor,
c: RegistrationManager.RegistrationCallback
): Unit
Registers a RegistrationManager.RegistrationCallback
with the system. When the callback is registered, it will initiate the callback c to be called with the current registration state. Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see android.telephony.TelephonyManager#hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
Parameters | |
---|---|
executor |
Executor: The executor the callback events should be run on. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
c |
RegistrationManager.RegistrationCallback: The RegistrationManager.RegistrationCallback to be added. This value cannot be null . |
Exceptions | |
---|---|
android.telephony.ims.ImsException |
if the subscription associated with this callback is valid, but the ImsService associated with the subscription is not available. This can happen if the service crashed, for example. See ImsException#getCode() for a more detailed reason. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager#FEATURE_TELEPHONY_IMS . |
registerImsStateCallback
open fun registerImsStateCallback(
executor: Executor,
callback: ImsStateCallback
): Unit
Register a new callback, which is used to notify the registrant of changes to the state of the underlying IMS service that is attached to telephony to implement IMS functionality. If the manager is created for the android.telephony.SubscriptionManager#DEFAULT_SUBSCRIPTION_ID
, this throws an ImsException
.
Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see android.telephony.TelephonyManager#hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or android.Manifest.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE
Parameters | |
---|---|
executor |
Executor: the Executor that will be used to call the ImsStateCallback . This value cannot be null . |
callback |
ImsStateCallback: The callback instance being registered. This value cannot be null . |
Exceptions | |
---|---|
android.telephony.ims.ImsException |
in the case that the callback can not be registered. See ImsException#getCode for more information on when this is called. |
unregisterImsRegistrationCallback
open fun unregisterImsRegistrationCallback(c: RegistrationManager.RegistrationCallback): Unit
Removes an existing RegistrationManager.RegistrationCallback
. When the subscription associated with this callback is removed (SIM removed, ESIM swap, etc...), this callback will automatically be removed. If this method is called for an inactive subscription, it will result in a no-op. Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see android.telephony.TelephonyManager#hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
Parameters | |
---|---|
c |
RegistrationManager.RegistrationCallback: The RegistrationManager.RegistrationCallback to be removed. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager#FEATURE_TELEPHONY_IMS . |
unregisterImsStateCallback
open fun unregisterImsStateCallback(callback: ImsStateCallback): Unit
Unregisters a previously registered callback.
Parameters | |
---|---|
callback |
ImsStateCallback: The callback instance to be unregistered. This value cannot be null . |