From 57112911d6ca74c258138629f75380851105456d Mon Sep 17 00:00:00 2001 From: Zhen Zhang Date: Mon, 15 Mar 2021 22:24:22 -0700 Subject: [PATCH] Improve the documentation of getLastTimeComponentUsed() API Mentioned that only certain types of component usage are reported and added a link to UsageEvents.Event#APP_COMPONENT_USED for people to find out the actual reporting point. Bug: 175829712 Test: Built successfully Change-Id: Ic192593f96b58b6e65c6f4b866276f7375eb45e8 --- core/java/android/app/usage/UsageStats.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/java/android/app/usage/UsageStats.java b/core/java/android/app/usage/UsageStats.java index 5d50c5d778878..ef921728c616e 100644 --- a/core/java/android/app/usage/UsageStats.java +++ b/core/java/android/app/usage/UsageStats.java @@ -110,7 +110,9 @@ public final class UsageStats implements Parcelable { public long mTotalTimeForegroundServiceUsed; /** - * Last time this package's component is used, measured in milliseconds since the epoch. + * Last time this package's component is used by a client package, measured in milliseconds + * since the epoch. Note that component usage is only reported in certain cases (e.g. broadcast + * receiver, service, content provider). * See {@link UsageEvents.Event#APP_COMPONENT_USED} * @hide */ @@ -274,8 +276,10 @@ public final class UsageStats implements Parcelable { } /** - * Get the last time this package's component was used, measured in milliseconds since the - * epoch. + * Get the last time this package's component was used by a client package, measured in + * milliseconds since the epoch. Note that component usage is only reported in certain cases + * (e.g. broadcast receiver, service, content provider). + * See {@link UsageEvents.Event#APP_COMPONENT_USED} * @hide */ @SystemApi