# ReportSystemUsageRequest.Builder

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/ReportSystemUsageRequest.java+class:androidx.appsearch.app.ReportSystemUsageRequest.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
class ReportSystemUsageRequest.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest.Builder#Builder(java.lang.String,java.lang.String,java.lang.String,java.lang.String)( packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, databaseName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, documentId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest.Builder` instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest.Builder#build()()` Builds a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest`. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest.Builder#setUsageTimestampMillis(long)(usageTimestampMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the timestamp in milliseconds of the usage report (the time at which the document was used). |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
Builder(
    packageName: String,
    databaseName: String,
    namespace: String,
    documentId: String
)
```

Creates a `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest.Builder` instance.

| Parameters |
|---|---|
| `packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The package name of the app which owns the document that was used (such as from `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchResult#getPackageName()`). |
| `databaseName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The database in which the document that was used resides (such as from `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchResult#getDatabaseName()`). |
| `namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The namespace of the document that was used (such as from `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument#getNamespace()`. |
| `documentId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The ID of document that was used (such as from `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument#getId()`. |

## Public functions

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun build(): ReportSystemUsageRequest
```

Builds a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest`.

### setUsageTimestampMillis

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun setUsageTimestampMillis(usageTimestampMillis: Long): ReportSystemUsageRequest.Builder
```

Sets the timestamp in milliseconds of the usage report (the time at which the document was used).

The value is in the `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()` time base.

If unset, this defaults to the current timestamp at the time that the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/ReportSystemUsageRequest` is constructed.