Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/telephony/SubscriptionPlan#nestedclasses) \| [Constants](https://developer.android.com/reference/android/telephony/SubscriptionPlan#constants) \| [Inherited Constants](https://developer.android.com/reference/android/telephony/SubscriptionPlan#inhconstants) \| [Fields](https://developer.android.com/reference/android/telephony/SubscriptionPlan#lfields) \| [Methods](https://developer.android.com/reference/android/telephony/SubscriptionPlan#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telephony/SubscriptionPlan#inhmethods)

# SubscriptionPlan

*** ** * ** ***

` public final class SubscriptionPlan `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.SubscriptionPlan |

<br />

*** ** * ** ***

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 `https://developer.android.com/reference/android/telephony/SubscriptionManager` when setting the plans.

Plan selection will prefer plans that have specific network types defined over plans that apply to all network types.
**See also:**

- `https://developer.android.com/reference/android/telephony/SubscriptionManager#setSubscriptionPlans(int,%20java.util.List<android.telephony.SubscriptionPlan>)`
- `https://developer.android.com/reference/android/telephony/SubscriptionManager#getSubscriptionPlans(int)`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan.Builder` Builder for a `https://developer.android.com/reference/android/telephony/SubscriptionPlan`. |

| ### Constants ||
|---|---|
| `long` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#BITRATE_UNKNOWN` Value indicating data rate is unknown. |
| `long` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#BYTES_UNKNOWN` Value indicating a number of bytes is unknown. |
| `long` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#BYTES_UNLIMITED` Value indicating a number of bytes is unlimited. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_BILLED` Indicates that the user will be billed for data usage beyond the limit. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_DISABLED` Indicates that data access is disabled when the data limit is reached. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_THROTTLED` Indicates that data access is throttled to a slower speed when the limit is reached. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_UNKNOWN` Indicates that the behavior for when a data limit is reached is unknown. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_BUSINESS` The plan is for business or enterprise customers. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_CELLULAR` The plan provides conventional cellular service. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_DATA_ONLY` The plan is for data-only service. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_FAMILY` The plan is a family plan, shared among multiple users. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_IOT` The plan is designed for Internet of Things (IoT) devices. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_POSTPAID` The plan is a postpaid plan. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_PREPAID` The plan is a prepaid plan. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_ROAMING` The plan is specifically for roaming services. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_SATELLITE` The plan provides satellite-based service. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_TETHERING` The plan provides a data allowance specifically for tethering or mobile hotspot usage. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_ACTIVE` The subscription is active. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_INACTIVE` The subscription is inactive. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_SUSPENDED` The subscription is suspended. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_TRIAL` The subscription is in a trial period. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_UNKNOWN` The subscription status is unknown. |
| `long` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#TIME_UNKNOWN` Value indicating a timestamp is unknown. |
| `int` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#UNSPECIFIED_ID` Value indicating that the SubscriptionPlan ID is not specified. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: 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)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/telephony/SubscriptionPlan>` | `https://developer.android.com/reference/android/telephony/SubscriptionPlan#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/util/Iterator<https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/time/ZonedDateTime>>` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#cycleIterator()() ` Returns an iterator that provides the data usage billing cycles for this plan, based on its recurrence rule. |
| ` int` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. |
| ` int` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataLimitBehavior()() ` Returns the behavior of data access when usage reaches the limit defined by `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataLimitBytes()`. |
| ` long` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataLimitBytes()() ` Returns the data limit for the plan. |
| ` long` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageBytes()() ` Returns a snapshot of the mobile data usage, in bytes, as of the time reported by `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageTime()`. |
| ` https://developer.android.com/reference/java/time/ZonedDateTime` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageResetTime()() ` Returns the time at which the data usage will reset. |
| ` long` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageTime()() ` Returns the time at which `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageBytes()` was measured, in milliseconds since the Unix epoch. |
| ` int` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getId()() ` Returns the unique integer identifier for this subscription plan. |
| ` int[]` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getNetworkTypes()() ` Returns the network types that this plan applies to. |
| ` https://developer.android.com/reference/java/time/ZonedDateTime` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getPlanEndDate()() ` Returns the end date of this subscription plan. |
| ` int` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getSubscriptionStatus()() ` Returns the status of the subscription plan. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getSummary()() ` Returns a brief, human-readable summary of the subscription plan. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getTitle()() ` Returns a user-visible title for this plan. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#getTypes()() ` Returns the characteristics of this subscription plan as a set of type constants. |
| ` int` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/telephony/SubscriptionPlan#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### BITRATE_UNKNOWN

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long BITRATE_UNKNOWN
```

Value indicating data rate is unknown.

<br />

Constant Value: -1 (0xffffffffffffffff)

### BYTES_UNKNOWN

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long BYTES_UNKNOWN
```

Value indicating a number of bytes is unknown.

This value is used when the carrier has not provided a specific data limit or usage value.

<br />

Constant Value: -1 (0xffffffffffffffff)

### BYTES_UNLIMITED

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long BYTES_UNLIMITED
```

Value indicating a number of bytes is unlimited.

This value is used when the carrier has not specified a data limit.

<br />

Constant Value: 9223372036854775807 (0x7fffffffffffffff)

### LIMIT_BEHAVIOR_BILLED

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LIMIT_BEHAVIOR_BILLED
```

Indicates that the user will be billed for data usage beyond the limit.

When the user exceeds their data limit, they will incur overage charges. Data access continues, but at an additional cost.

<br />

Constant Value: 1 (0x00000001)

### LIMIT_BEHAVIOR_DISABLED

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LIMIT_BEHAVIOR_DISABLED
```

Indicates that data access is disabled when the data limit is reached.

Once the user's data usage hits the defined limit, their mobile data connection will be turned off until the next billing cycle begins.

<br />

Constant Value: 0 (0x00000000)

### LIMIT_BEHAVIOR_THROTTLED

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LIMIT_BEHAVIOR_THROTTLED
```

Indicates that data access is throttled to a slower speed when the limit is reached.

After the user consumes their high-speed data allowance, the data connection remains active but is reduced to a lower bandwidth for the remainder of the billing cycle.

<br />

Constant Value: 2 (0x00000002)

### LIMIT_BEHAVIOR_UNKNOWN

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LIMIT_BEHAVIOR_UNKNOWN
```

Indicates that the behavior for when a data limit is reached is unknown.

This is the default value and should be used when the carrier has not specified what happens when the user's data usage exceeds the limit.

<br />

Constant Value: -1 (0xffffffff)

### PLAN_TYPE_BUSINESS

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_BUSINESS
```

The plan is for business or enterprise customers.

This type indicates that the plan may include features tailored for corporate use, such as dedicated support, static IP addresses, or specific service-level agreements (SLAs).

<br />

Constant Value: 8 (0x00000008)

### PLAN_TYPE_CELLULAR

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_CELLULAR
```

The plan provides conventional cellular service.

This type is for standard mobile plans that offer data, voice, and messaging services over terrestrial cellular networks (e.g., 4G LTE, 5G).

<br />

Constant Value: 1 (0x00000001)

### PLAN_TYPE_DATA_ONLY

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_DATA_ONLY
```

The plan is for data-only service.

This type indicates that the plan provides only mobile data connectivity and does not include traditional voice or SMS services. It is commonly used for tablets, mobile hotspots, or as a secondary data line.

<br />

Constant Value: 6 (0x00000006)

### PLAN_TYPE_FAMILY

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_FAMILY
```

The plan is a family plan, shared among multiple users.

This type indicates that data limits and usage may be pooled across several subscriptions. Data management applications can use this to provide a consolidated view of the shared usage for all members of the family plan.

<br />

Constant Value: 7 (0x00000007)

### PLAN_TYPE_IOT

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_IOT
```

The plan is designed for Internet of Things (IoT) devices.

These plans are typically tailored for devices with low data consumption and specific network requirements, such as smart sensors or asset trackers.

<br />

Constant Value: 3 (0x00000003)

### PLAN_TYPE_POSTPAID

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_POSTPAID
```

The plan is a postpaid plan.

With a postpaid plan, the user consumes services and is billed at the end of each billing cycle for the usage incurred.

<br />

Constant Value: 4 (0x00000004)

### PLAN_TYPE_PREPAID

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_PREPAID
```

The plan is a prepaid plan.

With a prepaid plan, the user pays for services in advance, and the service is available until the paid balance is depleted or the service period expires.

<br />

Constant Value: 5 (0x00000005)

### PLAN_TYPE_ROAMING

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_ROAMING
```

The plan is specifically for roaming services.

This type is used for plans or add-ons designed for international or out-of-network usage. It helps the system and applications to better inform the user about potential costs or usage restrictions while roaming.

<br />

Constant Value: 9 (0x00000009)

### PLAN_TYPE_SATELLITE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_SATELLITE
```

The plan provides satellite-based service.

This is used for plans that deliver connectivity via satellite.

<br />

Constant Value: 2 (0x00000002)

### PLAN_TYPE_TETHERING

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PLAN_TYPE_TETHERING
```

The plan provides a data allowance specifically for tethering or mobile hotspot usage.

This type is used for plans or add-ons that allocate a specific amount of data for use when the device is acting as a mobile hotspot. Many carriers offer a separate, often smaller, data cap for tethering, which is distinct from the on-device data limit. This allows the system and data management applications to track usage against this specific allowance and inform the user of their remaining hotspot data.

<br />

Constant Value: 10 (0x0000000a)

### SUBSCRIPTION_STATUS_ACTIVE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SUBSCRIPTION_STATUS_ACTIVE
```

The subscription is active.

This indicates that the subscription is in good standing and all services are available to the user.

<br />

Constant Value: 1 (0x00000001)

### SUBSCRIPTION_STATUS_INACTIVE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SUBSCRIPTION_STATUS_INACTIVE
```

The subscription is inactive.

This status means the subscription is not currently in service. This could be because it has been canceled, has expired, or has not yet been activated.

<br />

Constant Value: 2 (0x00000002)

### SUBSCRIPTION_STATUS_SUSPENDED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SUBSCRIPTION_STATUS_SUSPENDED
```

The subscription is suspended.

A suspended subscription has been temporarily disabled. This can occur due to billing issues, a user's request, or a violation of the carrier's terms of service. Services are unavailable, but the subscription can typically be reactivated.

<br />

Constant Value: 4 (0x00000004)

### SUBSCRIPTION_STATUS_TRIAL

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SUBSCRIPTION_STATUS_TRIAL
```

The subscription is in a trial period.

This indicates that the user is on a promotional or trial plan, which may have different features or limitations than a standard subscription. After the trial period ends, the status will typically change to active or inactive.

<br />

Constant Value: 3 (0x00000003)

### SUBSCRIPTION_STATUS_UNKNOWN

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SUBSCRIPTION_STATUS_UNKNOWN
```

The subscription status is unknown.

This is the default value, used when the carrier is unable to provide the current status of the subscription.

<br />

Constant Value: 0 (0x00000000)

### TIME_UNKNOWN

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long TIME_UNKNOWN
```

Value indicating a timestamp is unknown.

<br />

Constant Value: -1 (0xffffffffffffffff)

### UNSPECIFIED_ID

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int UNSPECIFIED_ID
```

Value indicating that the SubscriptionPlan ID is not specified.

<br />

Constant Value: -1 (0xffffffff)

## Fields

### CREATOR

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<SubscriptionPlan> CREATOR
```

<br />

<br />

## Public methods

### cycleIterator

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Iterator<Range<ZonedDateTime>> cycleIterator ()
```

Returns an iterator that provides the data usage billing cycles for this plan, based on its recurrence rule.

The iterator starts from the cycle that is currently active and walks backwards through time. Each cycle is represented as a `https://developer.android.com/reference/android/util/Range` of `https://developer.android.com/reference/java/time/ZonedDateTime` objects, indicating the start and end of that period.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Iterator<https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/time/ZonedDateTime>>` | An iterator for the plan's billing cycles. <br /> |

### describeContents

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### equals

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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:

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

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getDataLimitBehavior

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getDataLimitBehavior ()
```

Returns the behavior of data access when usage reaches the limit defined by `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataLimitBytes()`.

This defines what happens to the user's data connection once they have consumed the amount of data specified in the data limit. For example, the carrier might throttle the connection to a slower speed, disable it entirely, or start billing for overage.

<br />

| Returns ||
|---|---|
| `int` | The data limit behavior, which will be one of `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_UNKNOWN`, `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_DISABLED`, `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_BILLED`, or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_THROTTLED`. Value is one of the following: - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_UNKNOWN` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_DISABLED` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_BILLED` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#LIMIT_BEHAVIOR_THROTTLED` |

### getDataLimitBytes

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getDataLimitBytes ()
```

Returns the data limit for the plan.

This is the usage threshold, in bytes, at which data access changes according to the behavior defined by `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataLimitBehavior()`. For example, once data usage reaches this limit, the connection might be throttled or disabled.   

Value is a non-negative number of bytes.

<br />

| Returns ||
|---|---|
| `long` | The data limit in bytes. This may be `https://developer.android.com/reference/android/telephony/SubscriptionPlan#BYTES_UNKNOWN` if the limit is not available, or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#BYTES_UNLIMITED` if there is no limit. Value is a non-negative number of bytes. <br /> |

### getDataUsageBytes

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getDataUsageBytes ()
```

Returns a snapshot of the mobile data usage, in bytes, as of the time reported by `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageTime()`.

The usage reported here corresponds to the data consumption within the current billing cycle defined by `https://developer.android.com/`. If the plan specifies different limits for various network types, this value represents the total usage across all applicable networks.   

Value is a non-negative number of bytes.

<br />

| Returns ||
|---|---|
| `long` | The data usage in bytes, or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#BYTES_UNKNOWN` if unavailable. Value is a non-negative number of bytes. <br /> |

### getDataUsageResetTime

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZonedDateTime getDataUsageResetTime ()
```

Returns the time at which the data usage will reset.

This is distinct from the billing cycle or plan duration returned by `https://developer.android.com/`. For example, a 15-day travel plan might have a `https://developer.android.com/` covering the entire 15-day duration, but a daily data limit of 1GB. In this case, `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageResetTime()` would indicate the time (e.g., midnight) when that daily 1GB limit resets, while `https://developer.android.com/` defines when the plan itself expires.

This is particularly relevant for plans with a daily data allowance. The value provided for `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageBytes()` must reflect the data consumed since this reset time.

It may be `null` if this information is not available or not applicable to the plan.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/ZonedDateTime` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageBytes()`
- `https://developer.android.com/`

### getDataUsageTime

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getDataUsageTime ()
```

Returns the time at which `https://developer.android.com/reference/android/telephony/SubscriptionPlan#getDataUsageBytes()` was measured, in milliseconds since the Unix epoch.

This timestamp indicates how recent the data usage information is. It allows applications to decide whether the usage value is current enough for their needs.   

Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

<br />

| Returns ||
|---|---|
| `long` | The time of the data usage snapshot as a Unix epoch timestamp, or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#TIME_UNKNOWN` if unavailable. Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. <br /> |

**See also:**

- `https://developer.android.com/reference/java/lang/System#currentTimeMillis()`

### getId

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getId ()
```

Returns the unique integer identifier for this subscription plan.

This ID is provided by the carrier and can be used to uniquely identify this plan, particularly when interacting with entitlement server for enrolling.

It may be `https://developer.android.com/reference/android/telephony/SubscriptionPlan#UNSPECIFIED_ID` if no ID is specified.

<br />

| Returns ||
|---|---|
| `int` | The unique integer identifier for the plan, or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#UNSPECIFIED_ID` if not specified. <br /> |

### getNetworkTypes

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] getNetworkTypes ()
```

Returns the network types that this plan applies to.

A "default" plan, which applies to any network type not explicitly covered by another plan, will include all possible network types in the returned array. Each subscription should have at most one default plan.

A RAT-specific plan will return an array containing only the network types it applies to, for example, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_LTE`.

<br />

| Returns ||
|---|---|
| `int[]` | A new copy of the array of network types this plan applies to. The values will be constants from `https://developer.android.com/reference/android/telephony/TelephonyManager`, such as `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_LTE`. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UNKNOWN` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_GPRS` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EDGE` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UMTS` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_CDMA` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EVDO_0` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EVDO_A` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_1xRTT` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSDPA` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSUPA` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSPA` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_IDEN` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EVDO_B` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_LTE` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EHRPD` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSPAP` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_GSM` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_TD_SCDMA` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_IWLAN` - `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_NR` |

**See also:**

- `https://developer.android.com/`

### getPlanEndDate

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZonedDateTime getPlanEndDate ()
```

Returns the end date of this subscription plan.

This indicates the specific date and time when the plan is no longer valid. For recurring plans that do not have a defined end, this will be `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/ZonedDateTime` | The plan's end date as a `https://developer.android.com/reference/java/time/ZonedDateTime`, or `null` if unavailable. <br /> |

### getSubscriptionStatus

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSubscriptionStatus ()
```

Returns the status of the subscription plan.

This indicates the current state of the subscription, such as whether it is active, suspended, or in a trial period. This status provides context on the plan's availability and can be used to inform the user about their subscription's lifecycle.

<br />

| Returns ||
|---|---|
| `int` | The subscription status, which is one of the `SUBSCRIPTION_STATUS_*` constants, or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_UNKNOWN` if not available. Value is one of the following: - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_UNKNOWN` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_ACTIVE` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_INACTIVE` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_TRIAL` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_SUSPENDED` |

**See also:**

- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_UNKNOWN`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_ACTIVE`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_INACTIVE`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_TRIAL`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#SUBSCRIPTION_STATUS_SUSPENDED`

### getSummary

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getSummary ()
```

Returns a brief, human-readable summary of the subscription plan.

This could include details about the plan's features, such as "10GB of high-speed data" or "Unlimited talk and text". This summary is intended for display to the user.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | A short, user-friendly summary of the plan, or `null` if not specified. <br /> |

### getTitle

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getTitle ()
```

Returns a user-visible title for this plan.

This title is provided by the carrier to identify the subscription plan, for example, "Unlimited+" or "Family plan". It is intended for display to the user.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The title of the plan, or `null` if not specified. <br /> |

### getTypes

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Integer> getTypes ()
```

Returns the characteristics of this subscription plan as a set of type constants. A plan can have multiple types that describe its nature. For example, a plan might be both a `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_CELLULAR` and a `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_POSTPAID` plan.

The returned set allows for efficient checks of plan characteristics using `https://developer.android.com/reference/java/util/Set#contains(java.lang.Object)` and `https://developer.android.com/reference/java/util/Set#containsAll(java.util.Collection<?>)`.

The types can be used to understand the plan's attributes and tailor an application's behavior. For instance, a data management app could display different UI elements for a `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_PREPAID` versus a `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_POSTPAID` plan.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | An unmodifiable `https://developer.android.com/reference/java/util/Set` of plan type constants, for example `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_CELLULAR` or `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_DATA_ONLY`. The set will be empty if no types are associated with the plan. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_CELLULAR` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_SATELLITE` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_IOT` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_POSTPAID` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_PREPAID` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_DATA_ONLY` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_FAMILY` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_BUSINESS` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_ROAMING` - `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_TETHERING` |

**See also:**

- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_CELLULAR`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_SATELLITE`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_IOT`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_POSTPAID`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_PREPAID`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_DATA_ONLY`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_FAMILY`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_BUSINESS`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_ROAMING`
- `https://developer.android.com/reference/android/telephony/SubscriptionPlan#PLAN_TYPE_TETHERING`

### hashCode

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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 `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `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.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#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.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |