diff options
| author | 2021-04-13 20:07:53 +0000 | |
|---|---|---|
| committer | 2021-04-13 20:07:53 +0000 | |
| commit | c7c816a95125c95d570032e4870d48b6aaa3b30f (patch) | |
| tree | b62ec9040155d4c827ca9ff5f810663406f754e3 | |
| parent | 21142c13de26007a4e49ea5c3eab5f8e7b22bd55 (diff) | |
| parent | 8e14895754c05e46cbf299ed9c796252e3376d14 (diff) | |
Merge "Rename API based on API review" into sc-dev
| -rw-r--r-- | core/api/system-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/usage/UsageStats.java | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index d42f07d6b070..e290ce47c032 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -1850,7 +1850,7 @@ package android.app.usage { public final class UsageStats implements android.os.Parcelable { method public int getAppLaunchCount(); - method public long getLastTimeComponentUsed(); + method public long getLastTimeAnyComponentUsed(); } public final class UsageStatsManager { 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; } |