Stay organized with collections
Save and categorize content based on your preferences.
ReportSystemUsageRequest
class ReportSystemUsageRequest
A request to report usage of a document owned by another app from a system UI surface.
Usage reported in this way is measured separately from usage reported via android.app.appsearch.AppSearchSession#reportUsage
.
See GlobalSearchSession.reportSystemUsage
for a detailed description of usage reporting.
Summary
Public methods |
String |
Returns the database in which the document that was used resides.
|
String |
Returns the ID of document that was used.
|
String |
Returns the namespace of the document that was used.
|
String |
Returns the package name of the app which owns the document that was used.
|
Long |
Returns the timestamp in milliseconds of the usage report (the time at which the document was used).
|
Public methods
getDatabaseName
fun getDatabaseName(): String
Returns the database in which the document that was used resides.
Return |
String |
This value cannot be null . |
getDocumentId
fun getDocumentId(): String
Returns the ID of document that was used.
Return |
String |
This value cannot be null . |
getNamespace
fun getNamespace(): String
Returns the namespace of the document that was used.
Return |
String |
This value cannot be null . |
getPackageName
fun getPackageName(): String
Returns the package name of the app which owns the document that was used.
Return |
String |
This value cannot be null . |
getUsageTimestampMillis
fun getUsageTimestampMillis(): Long
Returns 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.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
Return |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ReportSystemUsageRequest\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nReportSystemUsageRequest\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/appsearch/ReportSystemUsageRequest \"View this page in Java\") \n\n```\nclass ReportSystemUsageRequest\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.appsearch.ReportSystemUsageRequest](#) |\n\nA request to report usage of a document owned by another app from a system UI surface.\n\nUsage reported in this way is measured separately from usage reported via [android.app.appsearch.AppSearchSession#reportUsage](/reference/kotlin/android/app/appsearch/AppSearchSession#reportUsage(android.app.appsearch.ReportUsageRequest,%20java.util.concurrent.Executor,%20java.util.function.Consumer)).\n\nSee [GlobalSearchSession.reportSystemUsage](/reference/kotlin/android/app/appsearch/GlobalSearchSession#reportSystemUsage(android.app.appsearch.ReportSystemUsageRequest,%20java.util.concurrent.Executor,%20java.util.function.Consumer)) for a detailed description of usage reporting.\n\nSummary\n-------\n\n| Nested classes ||\n|---|----------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/app/appsearch/ReportSystemUsageRequest.Builder) Builder for [ReportSystemUsageRequest](#) objects. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getDatabaseName](#getDatabaseName())`()` Returns the database in which the document that was used resides. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getDocumentId](#getDocumentId())`()` Returns the ID of document that was used. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getNamespace](#getNamespace())`()` Returns the namespace of the document that was used. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getPackageName](#getPackageName())`()` Returns the package name of the app which owns the document that was used. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getUsageTimestampMillis](#getUsageTimestampMillis())`()` Returns the timestamp in milliseconds of the usage report (the time at which the document was used). |\n\nPublic methods\n--------------\n\n### getDatabaseName\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getDatabaseName(): String\n```\n\nReturns the database in which the document that was used resides.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getDocumentId\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getDocumentId(): String\n```\n\nReturns the ID of document that was used.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getNamespace\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getNamespace(): String\n```\n\nReturns the namespace of the document that was used.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getPackageName\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPackageName(): String\n```\n\nReturns the package name of the app which owns the document that was used.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getUsageTimestampMillis\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getUsageTimestampMillis(): Long\n```\n\nReturns 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. \nValue is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.\n\n| Return ||\n|------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|\n| [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. |"]]