# Print output for @column tags ?>
public
class
SubscriptionInfo
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.telephony.SubscriptionInfo |
A Parcelable class for Subscription Information.
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<SubscriptionInfo> |
CREATOR
|
Public methods | |
---|---|
Bitmap
|
createIconBitmap(Context context)
Creates and returns an icon |
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
int
|
getCardId()
Returns the card ID of the SIM card which contains the subscription (see
|
int
|
getCarrierId()
|
CharSequence
|
getCarrierName()
|
String
|
getCountryIso()
|
int
|
getDataRoaming()
|
CharSequence
|
getDisplayName()
|
ParcelUuid
|
getGroupUuid()
Used in scenarios where different subscriptions are bundled as a group. |
String
|
getIccId()
Returns the ICC ID. |
int
|
getIconTint()
A highlight color to use in displaying information about this |
int
|
getMcc()
This method is deprecated.
Use |
String
|
getMccString()
|
int
|
getMnc()
This method is deprecated.
Use |
String
|
getMncString()
|
String
|
getNumber()
Returns the number of this subscription. |
int
|
getSimSlotIndex()
|
int
|
getSubscriptionId()
|
int
|
getSubscriptionType()
This method returns the type of a subscription. |
int
|
hashCode()
Returns a hash code value for the object. |
boolean
|
isEmbedded()
|
boolean
|
isOpportunistic()
An opportunistic subscription connects to a network that is limited in functionality and / or coverage. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
public Bitmap createIconBitmap (Context context)
Creates and returns an icon Bitmap
to represent this SubscriptionInfo
in a
user interface.
Parameters | |
---|---|
context |
Context : A Context to get the DisplayMetrics s from. |
Returns | |
---|---|
Bitmap |
A bitmap icon for this SubscriptionInfo . |
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public boolean equals (Object obj)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
Parameters | |
---|---|
obj |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
public int getCardId ()
Returns the card ID of the SIM card which contains the subscription (see
UiccCardInfo#getCardId()
.
Returns | |
---|---|
int |
the cardId |
public int getCarrierId ()
Returns | |
---|---|
int |
the carrier id of this Subscription carrier. |
See also:
public CharSequence getCarrierName ()
Returns | |
---|---|
CharSequence |
the name displayed to the user that identifies Subscription provider name |
public int getDataRoaming ()
Returns | |
---|---|
int |
the data roaming state for this subscription, either
SubscriptionManager#DATA_ROAMING_ENABLE or SubscriptionManager#DATA_ROAMING_DISABLE . |
public CharSequence getDisplayName ()
Returns | |
---|---|
CharSequence |
the name displayed to the user that identifies this subscription |
public ParcelUuid getGroupUuid ()
Used in scenarios where different subscriptions are bundled as a group.
It's typically a primary and an opportunistic subscription. (see isOpportunistic()
)
Such that those subscriptions will have some affiliated behaviors such as opportunistic
subscription may be invisible to the user.
Returns | |
---|---|
ParcelUuid |
group UUID a String of group UUID if it belongs to a group. Otherwise it will return null. |
public String getIccId ()
Returns the ICC ID.
Starting with API level 29 Security Patch 2021-04-05, returns the ICC ID if the calling app
has been granted the READ_PRIVILEGED_PHONE_STATE permission, has carrier privileges (see
TelephonyManager#hasCarrierPrivileges
), or is a device owner or profile owner that
has been granted the READ_PHONE_STATE permission. The profile owner is an app that owns a
managed profile on the device; for more details see Work profiles. Profile
owner access is deprecated and will be removed in a future release.
Returns | |
---|---|
String |
the ICC ID, or an empty string if one of these requirements is not met |
public int getIconTint ()
A highlight color to use in displaying information about this PhoneAccount
.
Returns | |
---|---|
int |
A hexadecimal color value. |
public int getMcc ()
This method is deprecated.
Use getMccString()
instead.
Returns | |
---|---|
int |
the MCC. |
public String getMccString ()
Returns | |
---|---|
String |
The MCC, as a string.
This value may be null . |
public int getMnc ()
This method is deprecated.
Use getMncString()
instead.
Returns | |
---|---|
int |
the MNC. |
public String getMncString ()
Returns | |
---|---|
String |
The MNC, as a string.
This value may be null . |
public String getNumber ()
Returns the number of this subscription. Starting with API level 30, returns the number of this subscription if the calling app meets one of the following requirements:
TelephonyManager.hasCarrierPrivileges()
).
Returns | |
---|---|
String |
the number of this subscription, or an empty string if one of these requirements is not met |
public int getSimSlotIndex ()
Returns | |
---|---|
int |
the slot index of this Subscription's SIM card. |
public int getSubscriptionId ()
Returns | |
---|---|
int |
the subscription ID. |
public int getSubscriptionType ()
This method returns the type of a subscription. It can be
SubscriptionManager#SUBSCRIPTION_TYPE_LOCAL_SIM
or
SubscriptionManager#SUBSCRIPTION_TYPE_REMOTE_SIM
.
Returns | |
---|---|
int |
the type of subscription
Value is SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM , or SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM |
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |
public boolean isEmbedded ()
Returns | |
---|---|
boolean |
whether the subscription is an eUICC one. |
public boolean isOpportunistic ()
An opportunistic subscription connects to a network that is limited in functionality and / or coverage.
Returns | |
---|---|
boolean |
whether subscription is opportunistic. |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |