Added in API level 28

Builder

class Builder
kotlin.Any
   ↳ android.telephony.SubscriptionPlan.Builder

Builder for a SubscriptionPlan.

Summary

Public methods
open SubscriptionPlan!

open static SubscriptionPlan.Builder!

Start defining a SubscriptionPlan that covers a very specific window of time, and never automatically recurs.

open static SubscriptionPlan.Builder!
createRecurring(start: ZonedDateTime!, period: Period!)

Start defining a SubscriptionPlan that starts at a specific time, and automatically recurs after each specific period of time, repeating indefinitely.

open SubscriptionPlan.Builder

Reset any network types that were set with setNetworkTypes(int[]).

open SubscriptionPlan.Builder!
setDataLimit(dataLimitBytes: Long, dataLimitBehavior: Int)

Set the usage threshold at which data access changes.

open SubscriptionPlan.Builder!
setDataUsage(dataUsageBytes: Long, dataUsageTime: Long)

Set a snapshot of currently known mobile data usage.

open SubscriptionPlan.Builder
setNetworkTypes(networkTypes: IntArray)

Set the network types this SubscriptionPlan applies to.

open SubscriptionPlan.Builder!

Set the short summary of this plan.

open SubscriptionPlan.Builder!

Set the short title of this plan.

Public methods

build

Added in API level 28
open fun build(): SubscriptionPlan!

createNonrecurring

Added in API level 28
open static fun createNonrecurring(
    start: ZonedDateTime!,
    end: ZonedDateTime!
): SubscriptionPlan.Builder!

Start defining a SubscriptionPlan that covers a very specific window of time, and never automatically recurs.

Parameters
start ZonedDateTime!: The exact time at which the plan starts.
end ZonedDateTime!: The exact time at which the plan ends.

createRecurring

Added in API level 28
open static fun createRecurring(
    start: ZonedDateTime!,
    period: Period!
): SubscriptionPlan.Builder!

Start defining a SubscriptionPlan that starts at a specific time, and automatically recurs after each specific period of time, repeating indefinitely.

When the given period is set to exactly one month, the plan will always recur on the day of the month defined by ZonedDateTime#getDayOfMonth(). When a particular month ends before this day, the plan will recur on the last possible instant of that month.

Parameters
start ZonedDateTime!: The exact time at which the plan starts.
period Period!: The period after which the plan automatically recurs.

resetNetworkTypes

Added in API level 30
open fun resetNetworkTypes(): SubscriptionPlan.Builder

Reset any network types that were set with setNetworkTypes(int[]). This will make the SubscriptionPlan apply to all network types.

Return
SubscriptionPlan.Builder This value cannot be null.

setDataLimit

Added in API level 28
open fun setDataLimit(
    dataLimitBytes: Long,
    dataLimitBehavior: Int
): SubscriptionPlan.Builder!

Set the usage threshold at which data access changes.

Parameters
dataLimitBytes Long: the usage threshold at which data access changes Value is a non-negative number of bytes.
dataLimitBehavior Int: the behavior of data access when usage reaches the threshold Value is android.telephony.SubscriptionPlan#LIMIT_BEHAVIOR_UNKNOWN, android.telephony.SubscriptionPlan#LIMIT_BEHAVIOR_DISABLED, android.telephony.SubscriptionPlan#LIMIT_BEHAVIOR_BILLED, or android.telephony.SubscriptionPlan#LIMIT_BEHAVIOR_THROTTLED

setDataUsage

Added in API level 28
open fun setDataUsage(
    dataUsageBytes: Long,
    dataUsageTime: Long
): SubscriptionPlan.Builder!

Set a snapshot of currently known mobile data usage.

Parameters
dataUsageBytes Long: the currently known mobile data usage Value is a non-negative number of bytes.
dataUsageTime Long: the time at which this snapshot was valid Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

setNetworkTypes

Added in API level 30
open fun setNetworkTypes(networkTypes: IntArray): SubscriptionPlan.Builder

Set the network types this SubscriptionPlan applies to. By default the plan will apply to all network types. An empty array means this plan applies to no network types.

Parameters
networkTypes IntArray: an array of all network types that apply to this plan. This value cannot be null. Value is android.telephony.TelephonyManager#NETWORK_TYPE_UNKNOWN, android.telephony.TelephonyManager#NETWORK_TYPE_GPRS, android.telephony.TelephonyManager#NETWORK_TYPE_EDGE, android.telephony.TelephonyManager#NETWORK_TYPE_UMTS, android.telephony.TelephonyManager#NETWORK_TYPE_CDMA, android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_0, android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_A, android.telephony.TelephonyManager#NETWORK_TYPE_1xRTT, android.telephony.TelephonyManager#NETWORK_TYPE_HSDPA, android.telephony.TelephonyManager#NETWORK_TYPE_HSUPA, android.telephony.TelephonyManager#NETWORK_TYPE_HSPA, android.telephony.TelephonyManager#NETWORK_TYPE_IDEN, android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B, android.telephony.TelephonyManager#NETWORK_TYPE_LTE, android.telephony.TelephonyManager#NETWORK_TYPE_EHRPD, android.telephony.TelephonyManager#NETWORK_TYPE_HSPAP, android.telephony.TelephonyManager#NETWORK_TYPE_GSM, android.telephony.TelephonyManager#NETWORK_TYPE_TD_SCDMA, android.telephony.TelephonyManager#NETWORK_TYPE_IWLAN, or android.telephony.TelephonyManager#NETWORK_TYPE_NR
Return
SubscriptionPlan.Builder This value cannot be null.

setSummary

Added in API level 28
open fun setSummary(summary: CharSequence?): SubscriptionPlan.Builder!

Set the short summary of this plan.

Parameters
summary CharSequence?: This value may be null.

setTitle

Added in API level 28
open fun setTitle(title: CharSequence?): SubscriptionPlan.Builder!

Set the short title of this plan.

Parameters
title CharSequence?: This value may be null.