RegistrationManager
interface RegistrationManager
android.telephony.ims.RegistrationManager |
Manages IMS Service registration state for associated ImsFeature
s.
Requires the PackageManager#FEATURE_TELEPHONY_IMS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Summary
Nested classes | |
---|---|
open |
Callback class for receiving IMS network Registration callback events. |
Constants | |
---|---|
static Int |
The IMS service is currently not registered to the carrier network. |
static Int |
The IMS service is currently registered to the carrier network. |
static Int |
The IMS service is currently in the process of registering to the carrier network. |
Public methods | |
---|---|
abstract Unit |
getRegistrationState(executor: Executor, stateCallback: Consumer<Int!>) Gets the registration state of the IMS service. |
abstract Unit |
getRegistrationTransportType(executor: Executor, transportTypeCallback: Consumer<Int!>) Gets the Transport Type associated with the current IMS registration. |
abstract Unit |
Registers a |
abstract Unit |
Removes an existing |
Constants
REGISTRATION_STATE_NOT_REGISTERED
static val REGISTRATION_STATE_NOT_REGISTERED: Int
The IMS service is currently not registered to the carrier network.
Value: 0
REGISTRATION_STATE_REGISTERED
static val REGISTRATION_STATE_REGISTERED: Int
The IMS service is currently registered to the carrier network.
Value: 2
REGISTRATION_STATE_REGISTERING
static val REGISTRATION_STATE_REGISTERING: Int
The IMS service is currently in the process of registering to the carrier network.
Value: 1
Public methods
getRegistrationState
abstract fun getRegistrationState(
executor: Executor,
stateCallback: Consumer<Int!>
): Unit
Gets the registration state of the IMS service.
Requires android.Manifest.permission.READ_PRIVILEGED_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: REGISTRATION_STATE_NOT_REGISTERED , REGISTRATION_STATE_REGISTERING , or 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 |
getRegistrationTransportType
abstract fun getRegistrationTransportType(
executor: Executor,
transportTypeCallback: Consumer<Int!>
): Unit
Gets the Transport Type associated with the current IMS registration.
Requires android.Manifest.permission.READ_PRIVILEGED_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 |
registerImsRegistrationCallback
abstract fun registerImsRegistrationCallback(
executor: Executor,
c: RegistrationManager.RegistrationCallback
): Unit
Registers a RegistrationCallback
with the system. Use
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Parameters | |
---|---|
executor |
Executor: The executor the callback events should be run on. |
c |
RegistrationManager.RegistrationCallback: The RegistrationCallback to be added. |
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. |
unregisterImsRegistrationCallback
abstract fun unregisterImsRegistrationCallback(c: RegistrationManager.RegistrationCallback): Unit
Removes an existing 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 android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Parameters | |
---|---|
c |
RegistrationManager.RegistrationCallback: The RegistrationCallback to be removed. This value cannot be null . |