Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for ReportSystemUsageRequest
objects.
Summary
Public constructors
Public methods
setUsageTimestampMillis
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 System.currentTimeMillis
time base.
If unset, this defaults to the current timestamp at the time that the ReportSystemUsageRequest
is constructed.
Parameters |
usageTimestampMillis |
Long: Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ReportSystemUsageRequest.Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/appsearch/ReportSystemUsageRequest.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.appsearch.ReportSystemUsageRequest.Builder](#) |\n\nBuilder for [ReportSystemUsageRequest](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest) objects.\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.String,%20kotlin.String,%20kotlin.String,%20kotlin.String))`(`packageName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `databaseName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `namespace:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `documentId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a [ReportSystemUsageRequest.Builder](#) instance. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ReportSystemUsageRequest](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest) | [build](#build())`()` Builds a new [ReportSystemUsageRequest](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest). |\n| [ReportSystemUsageRequest.Builder](#) | [setUsageTimestampMillis](#setUsageTimestampMillis(kotlin.Long))`(`usageTimestampMillis:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the timestamp in milliseconds of the usage report (the time at which the document was used). |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(\n packageName: String, \n databaseName: String, \n namespace: String, \n documentId: String)\n```\n\nCreates a [ReportSystemUsageRequest.Builder](#) instance.\n\n| Parameters ||\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The package name of the app which owns the document that was used (such as from [SearchResult.getPackageName](/reference/kotlin/android/app/appsearch/SearchResult#getPackageName())). This value cannot be `null`. |\n| `databaseName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The database in which the document that was used resides (such as from [SearchResult.getDatabaseName](/reference/kotlin/android/app/appsearch/SearchResult#getDatabaseName())). This value cannot be `null`. |\n| `namespace` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The namespace of the document that was used (such as from [android.app.appsearch.GenericDocument#getNamespace](/reference/kotlin/android/app/appsearch/GenericDocument#getNamespace()). This value cannot be `null`. |\n| `documentId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The ID of document that was used (such as from [android.app.appsearch.GenericDocument#getId](/reference/kotlin/android/app/appsearch/GenericDocument#getId()). This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ReportSystemUsageRequest\n```\n\nBuilds a new [ReportSystemUsageRequest](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest).\n\n| Return ||\n|----------------------------------------------------------------------------------------------|------------------------------|\n| [ReportSystemUsageRequest](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest) | This value cannot be `null`. |\n\n### setUsageTimestampMillis\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setUsageTimestampMillis(usageTimestampMillis: Long): ReportSystemUsageRequest.Builder\n```\n\nSets the timestamp in milliseconds of the usage report (the time at which the document was used).\n\nThe value is in the [System.currentTimeMillis](../../../java/lang/System.html#currentTimeMillis()) time base.\n\nIf unset, this defaults to the current timestamp at the time that the [ReportSystemUsageRequest](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest) is constructed.\n\n| Parameters ||\n|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `usageTimestampMillis` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |\n\n| Return ||\n|---------------------------------------|------------------------------|\n| [ReportSystemUsageRequest.Builder](#) | This value cannot be `null`. |"]]