SubscriptionInfo
open class SubscriptionInfo : Parcelable
A Parcelable class for Subscription Information.
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods |
open Bitmap! |
Creates and returns an icon Bitmap to represent this SubscriptionInfo in a user interface.
|
open Int |
|
open Boolean |
|
open Int |
|
open Int |
|
open CharSequence! |
|
open String! |
|
open Int |
Whether user enables data roaming for this subscription or not.
|
open CharSequence! |
|
open ParcelUuid? |
Used in scenarios where different subscriptions are bundled as a group.
|
open String! |
Returns the ICC ID.
|
open Int |
A highlight color to use in displaying information about this PhoneAccount .
|
open Int |
|
open String? |
|
open Int |
|
open String? |
|
open String! |
Returns the number of this subscription.
|
open Int |
|
open Int |
|
open Int |
|
open Int |
This method returns the type of a subscription.
|
open Int |
Get the usage setting for this subscription.
|
open Int |
|
open Boolean |
|
open Boolean |
An opportunistic subscription connects to a network that is limited in functionality and / or coverage.
|
open String |
|
open Unit |
|
Public methods
createIconBitmap
open fun createIconBitmap(context: Context!): Bitmap!
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. |
Return |
Bitmap! |
A bitmap icon for this SubscriptionInfo . |
describeContents
open fun describeContents(): Int
equals
open fun equals(other: Any?): Boolean
Parameters |
obj |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getCardId
open fun getCardId(): Int
Return |
Int |
The card ID of the SIM card which contains the subscription. |
getCarrierId
open fun getCarrierId(): Int
Return |
Int |
The carrier id of this subscription carrier. |
getCarrierName
open fun getCarrierName(): CharSequence!
Return |
CharSequence! |
The name displayed to the user that identifies subscription provider name. This name is the SPN displayed in status bar and many other places. Can't be renamed by the user. |
getCountryIso
open fun getCountryIso(): String!
Return |
String! |
The ISO country code. Empty if not available. |
getDisplayName
open fun getDisplayName(): CharSequence!
Return |
CharSequence! |
The name displayed to the user that identifies this subscription. This name is used in Settings page and can be renamed by the user. |
getGroupUuid
open fun getGroupUuid(): ParcelUuid?
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.
Return |
ParcelUuid? |
Group UUID a String of group UUID if it belongs to a group. Otherwise null . |
getIccId
open fun getIccId(): String!
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.
Return |
String! |
the ICC ID, or an empty string if one of these requirements is not met |
getIconTint
open fun getIconTint(): Int
A highlight color to use in displaying information about this PhoneAccount
.
Return |
Int |
A hexadecimal color value. |
getMcc
open fun getMcc(): Int
Deprecated: Use getMccString()
instead.
Return |
Int |
The mobile country code. |
getMccString
open fun getMccString(): String?
Return |
String? |
The mobile country code. This value may be null . |
getMnc
open fun getMnc(): Int
Deprecated: Use getMncString()
instead.
Return |
Int |
The mobile network code. |
getMncString
open fun getMncString(): String?
Return |
String? |
The mobile network code. This value may be null . |
getNumber
open fun getNumber(): String!
Deprecated: use SubscriptionManager#getPhoneNumber(int)
instead, which takes a subscription ID
.
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:
- If the calling app's target SDK is API level 29 or lower and the app has been granted the READ_PHONE_STATE permission.
- If the calling app has been granted any of READ_PRIVILEGED_PHONE_STATE, READ_PHONE_NUMBERS, or READ_SMS.
- If the calling app has carrier privileges (see
android.telephony.TelephonyManager#hasCarrierPrivileges
).
- If the calling app is the default SMS role holder.
Return |
String! |
the number of this subscription, or an empty string if one of these requirements is not met |
getPortIndex
open fun getPortIndex(): Int
Return |
Int |
The port index of the SIM card which contains the subscription. |
getSimSlotIndex
open fun getSimSlotIndex(): Int
getSubscriptionId
open fun getSubscriptionId(): Int
Return |
Int |
The subscription ID. |
getUsageSetting
open fun getUsageSetting(): Int
Get the usage setting for this subscription.
hashCode
open fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
isEmbedded
open fun isEmbedded(): Boolean
Return |
Boolean |
true if the subscription is from eSIM. |
isOpportunistic
open fun isOpportunistic(): Boolean
An opportunistic subscription connects to a network that is limited in functionality and / or coverage.
Return |
Boolean |
Whether subscription is opportunistic. |
toString
open fun toString(): String
Return |
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Properties