RegistrationManager
public
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 | |
---|---|
class |
RegistrationManager.RegistrationCallback
Callback class for receiving IMS network Registration callback events. |
Constants | |
---|---|
int |
REGISTRATION_STATE_NOT_REGISTERED
The IMS service is currently not registered to the carrier network. |
int |
REGISTRATION_STATE_REGISTERED
The IMS service is currently registered to the carrier network. |
int |
REGISTRATION_STATE_REGISTERING
The IMS service is currently in the process of registering to the carrier network. |
Public methods | |
---|---|
abstract
void
|
getRegistrationState(Executor executor, Consumer<Integer> stateCallback)
Gets the registration state of the IMS service. |
abstract
void
|
getRegistrationTransportType(Executor executor, Consumer<Integer> transportTypeCallback)
Gets the Transport Type associated with the current IMS registration. |
abstract
void
|
registerImsRegistrationCallback(Executor executor, RegistrationManager.RegistrationCallback c)
Registers a |
abstract
void
|
unregisterImsRegistrationCallback(RegistrationManager.RegistrationCallback c)
Removes an existing |
Constants
REGISTRATION_STATE_NOT_REGISTERED
public static final int REGISTRATION_STATE_NOT_REGISTERED
The IMS service is currently not registered to the carrier network.
Constant Value: 0 (0x00000000)
REGISTRATION_STATE_REGISTERED
public static final int REGISTRATION_STATE_REGISTERED
The IMS service is currently registered to the carrier network.
Constant Value: 2 (0x00000002)
REGISTRATION_STATE_REGISTERING
public static final int REGISTRATION_STATE_REGISTERING
The IMS service is currently in the process of registering to the carrier network.
Constant Value: 1 (0x00000001)
Public methods
getRegistrationState
public abstract void getRegistrationState (Executor executor, Consumer<Integer> stateCallback)
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 : 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 REGISTRATION_STATE_NOT_REGISTERED , REGISTRATION_STATE_REGISTERING , or REGISTRATION_STATE_REGISTERED |
getRegistrationTransportType
public abstract void getRegistrationTransportType (Executor executor, Consumer<Integer> transportTypeCallback)
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 : The transport type associated with the current IMS registration,
which will be one of following:
,
, or
.
This value cannot be null .
Value is android.telephony.AccessNetworkConstants.TRANSPORT_TYPE_INVALID, AccessNetworkConstants.TRANSPORT_TYPE_WWAN , or AccessNetworkConstants.TRANSPORT_TYPE_WLAN |
registerImsRegistrationCallback
public abstract void registerImsRegistrationCallback (Executor executor, RegistrationManager.RegistrationCallback c)
Registers a RegistrationCallback
with the system. Use
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. |
c |
RegistrationManager.RegistrationCallback : A callback called on the supplied Executor that will contain the
registration state of the IMS service, which will be one of the
to listen to Subscription changed
events and call unregisterImsRegistrationCallback(android.telephony.ims.RegistrationManager.RegistrationCallback) to clean up.
When the callback is registered, it will initiate the callback c to be called with the
current registration state.
This value cannot be null . |
Throws | |
---|---|
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
public abstract void unregisterImsRegistrationCallback (RegistrationManager.RegistrationCallback c)
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 . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.