diff options
| author | Zhen Zhang <zzhen@google.com> | 2021-04-08 16:29:18 -0700 |
|---|---|---|
| committer | Zhen Zhang <zzhen@google.com> | 2021-04-08 16:29:18 -0700 |
| commit | 8e14895754c05e46cbf299ed9c796252e3376d14 (patch) | |
| tree | 4d2034d580937a919294bc41067e126ede513b4b /core/java/android | |
| parent | 53a24c73191a209e0ef2f54297618ac3a260d3d5 (diff) | |
Rename API based on API review
Rename getLastTimeComponentUsed to getLastTimeAnyComponentUsed based on
the API review feedback.
Bug: 183656434
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Change-Id: Ie3388150ab49d0f4b2f16e4d5aacda1cc8b3663b
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/usage/UsageStats.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/app/usage/UsageStats.java b/core/java/android/app/usage/UsageStats.java index ef921728c616..cda463408955 100644 --- a/core/java/android/app/usage/UsageStats.java +++ b/core/java/android/app/usage/UsageStats.java @@ -30,6 +30,7 @@ import static android.app.usage.UsageEvents.Event.FOREGROUND_SERVICE_STOP; import static android.app.usage.UsageEvents.Event.ROLLOVER_FOREGROUND_SERVICE; import static android.app.usage.UsageEvents.Event.USER_INTERACTION; +import android.annotation.CurrentTimeMillisLong; import android.annotation.SystemApi; import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; @@ -277,13 +278,15 @@ public final class UsageStats implements Parcelable { /** * 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). + * milliseconds since the epoch. Note that component usage is only reported for component + * bindings (e.g. broadcast receiver, service, content provider) and only when such a binding + * would cause an app to leave the stopped state. * See {@link UsageEvents.Event#APP_COMPONENT_USED} * @hide */ @SystemApi - public long getLastTimeComponentUsed() { + @CurrentTimeMillisLong + public long getLastTimeAnyComponentUsed() { return mLastTimeComponentUsed; } |
