Builder
class Builder
kotlin.Any | |
↳ | android.telephony.SubscriptionPlan.Builder |
Builder for a SubscriptionPlan
.
Summary
Public methods | |
---|---|
open SubscriptionPlan! |
build() |
open static SubscriptionPlan.Builder! |
createNonrecurring(start: ZonedDateTime!, end: ZonedDateTime!) Start defining a |
open static SubscriptionPlan.Builder! |
createRecurring(start: ZonedDateTime!, period: Period!) Start defining a |
open SubscriptionPlan.Builder |
Reset any network types that were set with |
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! |
setSummary(summary: CharSequence?) Set the short summary of this plan. |
open SubscriptionPlan.Builder! |
setTitle(title: CharSequence?) Set the short title of this plan. |
Public methods
createNonrecurring
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
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
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
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
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
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.
Return | |
---|---|
SubscriptionPlan.Builder |
This value cannot be null . |
See Also
setSummary
open fun setSummary(summary: CharSequence?): SubscriptionPlan.Builder!
Set the short summary of this plan.
Parameters | |
---|---|
summary |
CharSequence?: This value may be null . |
setTitle
open fun setTitle(title: CharSequence?): SubscriptionPlan.Builder!
Set the short title of this plan.
Parameters | |
---|---|
title |
CharSequence?: This value may be null . |