SatelliteManager
public
final
class
SatelliteManager
extends Object
java.lang.Object | |
↳ | android.telephony.satellite.SatelliteManager |
Manages satellite states such as monitoring enabled state and operations such as provisioning, pointing, messaging, location sharing, etc.
To get the object, call Context.getSystemService(String)
with
Context.SATELLITE_SERVICE
.
SatelliteManager is intended for use on devices with feature
ERROR(PackageManager.FEATURE_TELEPHONY_SATELLITE/android.content.pm.PackageManager#FEATURE_TELEPHONY_SATELLITE PackageManager.FEATURE_TELEPHONY_SATELLITE)
. On devices without the feature, the behavior
is not reliable.
Requires the PackageManager#FEATURE_TELEPHONY_SATELLITE feature which can be detected using PackageManager.hasSystemFeature(String)
.
Summary
Public methods | |
---|---|
void
|
registerStateChangeListener(Executor executor, SatelliteStateChangeListener listener)
Registers a |
void
|
unregisterStateChangeListener(SatelliteStateChangeListener listener)
Unregisters the |
Inherited methods | |
---|---|
Public methods
registerStateChangeListener
public void registerStateChangeListener (Executor executor, SatelliteStateChangeListener listener)
Registers a SatelliteStateChangeListener
to receive callbacks when the satellite
state may have changed.
The callback method is immediately triggered with latest state on invoking this method if
the state change has been notified before.
Requires Manifest.permission.READ_BASIC_PHONE_STATE
or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or Manifest.permission.READ_PHONE_STATE
or carrier privileges
Parameters | |
---|---|
executor |
Executor : The Executor where the listener will be invoked
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. |
listener |
SatelliteStateChangeListener : The listener to monitor the satellite state change
This value cannot be null . |
unregisterStateChangeListener
public void unregisterStateChangeListener (SatelliteStateChangeListener listener)
Unregisters the SatelliteStateChangeListener
previously registered with
registerStateChangeListener(java.util.concurrent.Executor, android.telephony.satellite.SatelliteStateChangeListener)
.
It will be a no-op if the listener
is not currently registered.
Requires Manifest.permission.READ_BASIC_PHONE_STATE
or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or Manifest.permission.READ_PHONE_STATE
or carrier privileges
Parameters | |
---|---|
listener |
SatelliteStateChangeListener : The listener to unregister
This value cannot be null . |