Builder

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

Builder for a SubscriptionPlan.
Requires API level 28 (Android 8.+, P)

Summary

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

Set the usage threshold at which data access changes.

open SubscriptionPlan.Builder!

Set the short title of this plan.

open SubscriptionPlan.Builder!

Set the short summary of this plan.

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

Set a snapshot of currently known mobile data usage.

open SubscriptionPlan!

Requires API level 28 (Android 8.+, P)

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.

Public methods

setDataLimit

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

Set the usage threshold at which data access changes.
Requires API level 28 (Android 8.+, P)

Parameters
dataLimitBytes Long: the usage threshold at which data access changes Value is a non-negative number of bytes.
dataLimitBehavior Long: 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

setTitle

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

Set the short title of this plan.
Requires API level 28 (Android 8.+, P)

Parameters
title CharSequence?: This value may be null.

setSummary

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

Set the short summary of this plan.
Requires API level 28 (Android 8.+, P)

Parameters
summary CharSequence?: This value may be null.

setDataUsage

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

Set a snapshot of currently known mobile data usage.
Requires API level 28 (Android 8.+, P)

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 in the System#currentTimeMillis() time base.

build

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

Requires API level 28 (Android 8.+, P)

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.
Requires API level 28 (Android 8.+, P)

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.
Requires API level 28 (Android 8.+, P)

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