Builder


class Builder
kotlin.Any
   ↳ android.app.usage.AppUsageDurationQuery.Builder

Builder for AppUsageDurationQuery.

Summary

Public constructors
Builder(startTimeMillis: Long, endTimeMillis: Long, intervalType: Int)

Constructor that specifies the period for which to return events.

Public methods
AppUsageDurationQuery

Builds a read-only AppUsageDurationQuery object.

AppUsageDurationQuery.Builder
setEndTimeMillis(endTimeMillis: Long)

Sets the exclusive end timestamp.

AppUsageDurationQuery.Builder
setIntervalType(intervalType: Int)

Sets the time interval by which the stats are aggregated.

AppUsageDurationQuery.Builder
setStartTimeMillis(startTimeMillis: Long)

Sets the inclusive start timestamp.

Public constructors

Builder

Builder(
    startTimeMillis: Long,
    endTimeMillis: Long,
    intervalType: Int)

Constructor that specifies the period for which to return events.

Parameters
startTimeMillis Long: inclusive start timestamp, as per java.lang.System#currentTimeMillis()
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
endTimeMillis Long: exclusive end timestamp, as per java.lang.System#currentTimeMillis()
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
intervalType Int: time interval by which the stats are aggregated.
Value is one of the following:
Exceptions
java.lang.IllegalArgumentException if endTimeMillis < startTimeMillis or if startTimeMillis is negative, or if intervalType is invalid.

Public methods

build

fun build(): AppUsageDurationQuery

Builds a read-only AppUsageDurationQuery object.

Return
AppUsageDurationQuery This value cannot be null.

setEndTimeMillis

fun setEndTimeMillis(endTimeMillis: Long): AppUsageDurationQuery.Builder

Sets the exclusive end timestamp.

Parameters
endTimeMillis Long: exclusive end timestamp, as per java.lang.System#currentTimeMillis()
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
Return
AppUsageDurationQuery.Builder this Builder object.
This value cannot be null.

setIntervalType

fun setIntervalType(intervalType: Int): AppUsageDurationQuery.Builder

Sets the time interval by which the stats are aggregated.

Parameters
intervalType Int: time interval by which the stats are aggregated.
Value is one of the following:
Return
AppUsageDurationQuery.Builder this Builder object.
This value cannot be null.

setStartTimeMillis

fun setStartTimeMillis(startTimeMillis: Long): AppUsageDurationQuery.Builder

Sets the inclusive start timestamp.

Parameters
startTimeMillis Long: inclusive start timestamp, as per java.lang.System#currentTimeMillis()
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
Return
AppUsageDurationQuery.Builder this Builder object.
This value cannot be null.