# 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)

*** ** * ** ***


```
public final class ReportSystemUsageRequest.Builder
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest.Builder#Builder(java.lang.String,java.lang.String,java.lang.String,java.lang.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html packageName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html databaseName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html documentId )` Creates a `https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest.Builder` instance. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest` | `https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest.Builder#build()()` Builds a new `https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/ReportSystemUsageRequest.Builder#setUsageTimestampMillis(long)(long usageTimestampMillis)` 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)

```
public Builder(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull String namespace,
    @NonNull String documentId
)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html packageName` | The package name of the app which owns the document that was used (such as from `https://developer.android.com/reference/androidx/appsearch/app/SearchResult#getPackageName()`). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html databaseName` | The database in which the document that was used resides (such as from `https://developer.android.com/reference/androidx/appsearch/app/SearchResult#getDatabaseName()`). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace` | The namespace of the document that was used (such as from `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument#getNamespace()`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html documentId` | The ID of document that was used (such as from `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument#getId()`. |

## Public methods

### build

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

```
public @NonNull ReportSystemUsageRequest build()
```

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

### setUsageTimestampMillis

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

```
public @NonNull ReportSystemUsageRequest.Builder setUsageTimestampMillis(long usageTimestampMillis)
```

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/androidx/appsearch/app/ReportSystemUsageRequest` is constructed.