Added in API level 28

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 SubscriptionPlan.

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 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
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

Int

Return the behavior of data access when usage reaches getDataLimitBytes().

Long

Return the usage threshold at which data access changes according to getDataLimitBehavior().

Long

Return a snapshot of currently known mobile data usage at getDataUsageTime().

Long

Return the time at which getDataUsageBytes() was valid.

IntArray

Return an array containing all network types this SubscriptionPlan applies to.

CharSequence?

Return the short summary of this plan.

CharSequence?

Return the short title of this plan.

Int

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<SubscriptionPlan!>

Constants

BYTES_UNKNOWN

Added in API level 28
static val BYTES_UNKNOWN: Long

Value indicating a number of bytes is unknown.

Value: -1L

BYTES_UNLIMITED

Added in API level 28
static val BYTES_UNLIMITED: Long

Value indicating a number of bytes is unlimited.

Value: 9223372036854775807L

LIMIT_BEHAVIOR_BILLED

Added in API level 28
static val LIMIT_BEHAVIOR_BILLED: Int

When a resource limit is hit, the user is billed automatically.

Value: 1

LIMIT_BEHAVIOR_DISABLED

Added in API level 28
static val LIMIT_BEHAVIOR_DISABLED: Int

When a resource limit is hit, access is disabled.

Value: 0

LIMIT_BEHAVIOR_THROTTLED

Added in API level 28
static val LIMIT_BEHAVIOR_THROTTLED: Int

When a resource limit is hit, access is throttled to a slower rate.

Value: 2

LIMIT_BEHAVIOR_UNKNOWN

Added in API level 28
static val LIMIT_BEHAVIOR_UNKNOWN: Int

When a resource limit is hit, the behavior is unknown.

Value: -1

TIME_UNKNOWN

Added in API level 28
static val TIME_UNKNOWN: Long

Value indicating a timestamp is unknown.

Value: -1L

Public methods

cycleIterator

Added in API level 28
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

Added in API level 28
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

Added in API level 28
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 return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values 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.
  • For any non-null reference value x, x.equals(null) should return false.

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.

getDataLimitBytes

Added in API level 28
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

Added in API level 28
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

Added in API level 28
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.

getSummary

Added in API level 28
fun getSummary(): CharSequence?

Return the short summary of this plan.

Return
CharSequence? This value may be null.

getTitle

Added in API level 28
fun getTitle(): CharSequence?

Return the short title of this plan.

Return
CharSequence? This value may be null.

hashCode

Added in API level 28
fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 28
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 28
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

Properties

CREATOR

Added in API level 28
static val CREATOR: Parcelable.Creator<SubscriptionPlan!>