Added in API level 10000
Builder
class Builder
| kotlin.Any | |
| ↳ | android.app.usage.AppUsageDurationQuery.Builder |
Builder for AppUsageDurationQuery.
Summary
| Public constructors | |
|---|---|
|
Constructor that specifies the period for which to return events. |
|
| Public methods | |
|---|---|
| AppUsageDurationQuery |
build()Builds a read-only |
| 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
Added in API level 10000
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
Added in API level 10000
fun build(): AppUsageDurationQuery
Builds a read-only AppUsageDurationQuery object.
| Return | |
|---|---|
AppUsageDurationQuery |
This value cannot be null. |
setEndTimeMillis
Added in API level 10000
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
Added in API level 10000
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
Added in API level 10000
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. |