SubscriptionPlan.Builder

public static class SubscriptionPlan.Builder
extends Object

java.lang.Object
   ↳ android.telephony.SubscriptionPlan.Builder


Builder for a SubscriptionPlan.

Summary

Public methods

SubscriptionPlan build()
static SubscriptionPlan.Builder createNonrecurring(ZonedDateTime start, ZonedDateTime end)

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

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

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

SubscriptionPlan.Builder setDataLimit(long dataLimitBytes, int dataLimitBehavior)

Set the usage threshold at which data access changes.

SubscriptionPlan.Builder setDataUsage(long dataUsageBytes, long dataUsageTime)

Set a snapshot of currently known mobile data usage.

SubscriptionPlan.Builder setSummary(CharSequence summary)

Set the short summary of this plan.

SubscriptionPlan.Builder setTitle(CharSequence title)

Set the short title of this plan.

Inherited methods

Public methods

createNonrecurring

SubscriptionPlan.Builder createNonrecurring (ZonedDateTime start, 
                ZonedDateTime end)

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.

Returns
SubscriptionPlan.Builder

createRecurring

SubscriptionPlan.Builder createRecurring (ZonedDateTime start, 
                Period period)

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

Returns
SubscriptionPlan.Builder

setDataLimit

SubscriptionPlan.Builder setDataLimit (long dataLimitBytes, 
                int dataLimitBehavior)

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 LIMIT_BEHAVIOR_UNKNOWN, LIMIT_BEHAVIOR_DISABLED, LIMIT_BEHAVIOR_BILLED or LIMIT_BEHAVIOR_THROTTLED.

Returns
SubscriptionPlan.Builder

setDataUsage

SubscriptionPlan.Builder setDataUsage (long dataUsageBytes, 
                long dataUsageTime)

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

Returns
SubscriptionPlan.Builder

setSummary

SubscriptionPlan.Builder setSummary (CharSequence summary)

Set the short summary of this plan.

Parameters
summary CharSequence

This value may be null.

Returns
SubscriptionPlan.Builder

setTitle

SubscriptionPlan.Builder setTitle (CharSequence title)

Set the short title of this plan.

Parameters
title CharSequence

This value may be null.

Returns
SubscriptionPlan.Builder