Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.app.appsearch.ReportUsageRequest.Builder

Builder for ReportUsageRequest objects.

Summary

Public constructors
Builder(namespace: String, documentId: String)

Creates a new ReportUsageRequest.Builder instance.

Public methods
ReportUsageRequest

Builds a new ReportUsageRequest.

ReportUsageRequest.Builder
setUsageTimestampMillis(usageTimestampMillis: Long)

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

Public constructors

Builder

Added in API level 31
Builder(
    namespace: String,
    documentId: String)

Creates a new ReportUsageRequest.Builder instance.

Parameters
namespace String: The namespace of the document that was used (such as from android.app.appsearch.GenericDocument#getNamespace. This value cannot be null.
documentId String: The ID of document that was used (such as from android.app.appsearch.GenericDocument#getId. This value cannot be null.

Public methods

build

Added in API level 31
fun build(): ReportUsageRequest

Builds a new ReportUsageRequest.

Return
ReportUsageRequest This value cannot be null.

setUsageTimestampMillis

Added in API level 31
fun setUsageTimestampMillis(usageTimestampMillis: Long): ReportUsageRequest.Builder

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

The value is in the System#currentTimeMillis time base.

If unset, this defaults to the current timestamp at the time that the ReportUsageRequest is constructed.

Parameters
usageTimestampMillis Long: Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
Return
ReportUsageRequest.Builder This value cannot be null.