SubscriptionPlan
class SubscriptionPlan : Parcelable
kotlin.Any | |
↳ | android.telephony.SubscriptionPlan |
Description of a billing relationship plan between a carrier and a specific subscriber. This information is used to present more useful UI to users, such as explaining how much mobile data they have remaining, and what will happen when they run out. If specifying network types, the developer must supply at least one plan that applies to all network types (default), and all additional plans may not include a particular network type more than once. This is enforced by SubscriptionManager
when setting the plans. Plan selection will prefer plans that have specific network types defined over plans that apply to all network types.
Summary
Nested classes | |
---|---|
Builder for a |
Constants | |
---|---|
static Long |
Value indicating a number of bytes is unknown. |
static Long |
Value indicating a number of bytes is unlimited. |
static Int |
When a resource limit is hit, the user is billed automatically. |
static Int |
When a resource limit is hit, access is disabled. |
static Int |
When a resource limit is hit, access is throttled to a slower rate. |
static Int |
When a resource limit is hit, the behavior is unknown. |
static Int |
Subscription is active. |
static Int |
Subscription is inactive. |
static Int |
Subscription is suspended. |
static Int |
Subscription is in a trial period. |
static Int |
Subscription status is unknown. |
static Long |
Value indicating a timestamp is unknown. |
Inherited constants | |
---|---|
Public methods | |
---|---|
MutableIterator<Range<ZonedDateTime!>!>! |
Return an iterator that will return all valid data usage cycles based on any recurrence rules. |
Int | |
Boolean |
Indicates whether some other object is "equal to" this one. |
Int |
Return the behavior of data access when usage reaches |
Long |
Return the usage threshold at which data access changes according to |
Long |
Return a snapshot of currently known mobile data usage at |
Long |
Return the time at which |
IntArray |
Return an array containing all network types this SubscriptionPlan applies to. |
ZonedDateTime? |
Return the end date of this plan, or null if no end date exists. |
Int |
Returns the status of the subscription plan. |
CharSequence? |
Return the short summary of this plan. |
CharSequence? |
getTitle() Return the short title of this plan. |
Int |
hashCode() |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<SubscriptionPlan!> |
Constants
BYTES_UNKNOWN
static val BYTES_UNKNOWN: Long
Value indicating a number of bytes is unknown.
Value: -1L
BYTES_UNLIMITED
static val BYTES_UNLIMITED: Long
Value indicating a number of bytes is unlimited.
Value: 9223372036854775807L
LIMIT_BEHAVIOR_BILLED
static val LIMIT_BEHAVIOR_BILLED: Int
When a resource limit is hit, the user is billed automatically.
Value: 1
LIMIT_BEHAVIOR_DISABLED
static val LIMIT_BEHAVIOR_DISABLED: Int
When a resource limit is hit, access is disabled.
Value: 0
LIMIT_BEHAVIOR_THROTTLED
static val LIMIT_BEHAVIOR_THROTTLED: Int
When a resource limit is hit, access is throttled to a slower rate.
Value: 2
LIMIT_BEHAVIOR_UNKNOWN
static val LIMIT_BEHAVIOR_UNKNOWN: Int
When a resource limit is hit, the behavior is unknown.
Value: -1
SUBSCRIPTION_STATUS_ACTIVE
static val SUBSCRIPTION_STATUS_ACTIVE: Int
Subscription is active.
Value: 1
SUBSCRIPTION_STATUS_INACTIVE
static val SUBSCRIPTION_STATUS_INACTIVE: Int
Subscription is inactive.
Value: 2
SUBSCRIPTION_STATUS_SUSPENDED
static val SUBSCRIPTION_STATUS_SUSPENDED: Int
Subscription is suspended.
Value: 4
SUBSCRIPTION_STATUS_TRIAL
static val SUBSCRIPTION_STATUS_TRIAL: Int
Subscription is in a trial period.
Value: 3
SUBSCRIPTION_STATUS_UNKNOWN
static val SUBSCRIPTION_STATUS_UNKNOWN: Int
Subscription status is unknown.
Value: 0
TIME_UNKNOWN
static val TIME_UNKNOWN: Long
Value indicating a timestamp is unknown.
Value: -1L
Public methods
cycleIterator
fun cycleIterator(): MutableIterator<Range<ZonedDateTime!>!>!
Return an iterator that will return all valid data usage cycles based on any recurrence rules. The iterator starts from the currently active cycle and walks backwards through time.
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
obj |
This value may be null . |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getDataLimitBehavior
fun getDataLimitBehavior(): Int
Return the behavior of data access when usage reaches getDataLimitBytes()
.
getDataLimitBytes
fun getDataLimitBytes(): Long
Return the usage threshold at which data access changes according to getDataLimitBehavior()
.
Value is a non-negative number of bytes.
Return | |
---|---|
Long |
Value is a non-negative number of bytes. |
getDataUsageBytes
fun getDataUsageBytes(): Long
Return a snapshot of currently known mobile data usage at getDataUsageTime()
.
Value is a non-negative number of bytes.
Return | |
---|---|
Long |
Value is a non-negative number of bytes. |
getDataUsageTime
fun getDataUsageTime(): Long
Return the time at which getDataUsageBytes()
was valid.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
Return | |
---|---|
Long |
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
getNetworkTypes
fun getNetworkTypes(): IntArray
Return an array containing all network types this SubscriptionPlan applies to.
See Also
getPlanEndDate
fun getPlanEndDate(): ZonedDateTime?
Return the end date of this plan, or null if no end date exists.
getSubscriptionStatus
fun getSubscriptionStatus(): Int
Returns the status of the subscription plan.
getSummary
fun getSummary(): CharSequence?
Return the short summary of this plan.
Return | |
---|---|
CharSequence? |
This value may be null . |
getTitle
fun getTitle(): CharSequence?
Return the short title of this plan.
Return | |
---|---|
CharSequence? |
This value may be null . |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |