java.lang.Object | |
↳ | android.telephony.SubscriptionManager |
SubscriptionManager is the application interface to SubscriptionController and provides information about the current Telephony Subscriptions. *
You do not instantiate this class directly; instead, you retrieve
a reference to an instance through from(Context)
.
All SDK public methods require android.Manifest.permission.READ_PHONE_STATE.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SubscriptionManager.OnSubscriptionsChangedListener |
A listener class for monitoring changes to SubscriptionInfo records.
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DATA_ROAMING_DISABLE | Indicates that data roaming is disabled for a subscription | |||||||||
int | DATA_ROAMING_ENABLE | Indicates that data roaming is enabled for a subscription |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Register for changes to the list of active
SubscriptionInfo records or to the
individual records themselves.
| |||||||||||
Get an instance of the SubscriptionManager from the Context.
| |||||||||||
Get the active SubscriptionInfo with the subId key
| |||||||||||
Get the active SubscriptionInfo associated with the slotIdx
| |||||||||||
Get the SubscriptionInfo(s) of the currently inserted SIM(s).
| |||||||||||
Returns true if the device is considered roaming on the current
network for a subscription.
| |||||||||||
Unregister the
SubscriptionManager.OnSubscriptionsChangedListener .
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Indicates that data roaming is disabled for a subscription
Indicates that data roaming is enabled for a subscription
Register for changes to the list of active SubscriptionInfo
records or to the
individual records themselves. When a change occurs the onSubscriptionsChanged method of
the listener will be invoked immediately if there has been a notification.
listener | an instance of SubscriptionManager.OnSubscriptionsChangedListener with
onSubscriptionsChanged overridden.
|
---|
Get an instance of the SubscriptionManager from the Context.
This invokes Context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)
.
context | to use. |
---|
Get the active SubscriptionInfo with the subId key
subId | The unique SubscriptionInfo key in database |
---|
getActiveSubscriptionInfoList()
.
getActiveSubscriptionInfoList()
and the value returned by
getActiveSubscriptionInfoCount()
.
Get the active SubscriptionInfo associated with the slotIdx
slotIdx | the slot which the subscription is inserted |
---|
Get the SubscriptionInfo(s) of the currently inserted SIM(s). The records will be sorted
by getSimSlotIndex()
then by getSubscriptionId()
.
SubscriptionInfo
records available on the device.
SubscriptionManager.OnSubscriptionsChangedListener
has been registered onSubscriptionsChanged()
will be
invoked in the future.
SubscriptionInfo
records currently available.
getSimSlotIndex()
then by getSubscriptionId()
.
Returns true if the device is considered roaming on the current network for a subscription.
Availability: Only when user registered to a network.
subId | The subscription ID |
---|
Unregister the SubscriptionManager.OnSubscriptionsChangedListener
. This is not strictly necessary
as the listener will automatically be unregistered if an attempt to invoke the listener
fails.
listener | that is to be unregistered. |
---|