From d1e659be259bc1c8a113a7ec39fa76b9ae4dbbb9 Mon Sep 17 00:00:00 2001 From: Michael Wachenschwanz Date: Fri, 5 Apr 2019 11:55:02 -0700 Subject: [PATCH] Clarify UsageStatsManager#queryUsageStats behavior Fixes: 67037735 Test: n/a Change-Id: I02f90f9ae93257dbe883710288a7a35ba87e1f26 --- .../android/app/usage/UsageStatsManager.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/core/java/android/app/usage/UsageStatsManager.java b/core/java/android/app/usage/UsageStatsManager.java index 7fa4360842468..749a011153cdc 100644 --- a/core/java/android/app/usage/UsageStatsManager.java +++ b/core/java/android/app/usage/UsageStatsManager.java @@ -281,20 +281,13 @@ public final class UsageStatsManager { /** * Gets application usage stats for the given time range, aggregated by the specified interval. - *

The returned list will contain a {@link UsageStats} object for each package that - * has data for an interval that is a subset of the time range given. To illustrate:

- *
-     * intervalType = INTERVAL_YEARLY
-     * beginTime = 2013
-     * endTime = 2015 (exclusive)
      *
-     * Results:
-     * 2013 - com.example.alpha
-     * 2013 - com.example.beta
-     * 2014 - com.example.alpha
-     * 2014 - com.example.beta
-     * 2014 - com.example.charlie
-     * 
+ *

+ * The returned list will contain one or more {@link UsageStats} objects for each package, with + * usage data that covers at least the given time range. + * Note: The begin and end times of the time range may be expanded to the nearest whole interval + * period. + *

* *

The caller must have {@link android.Manifest.permission#PACKAGE_USAGE_STATS}

*