diff --git a/core/api/system-current.txt b/core/api/system-current.txt index a5291af3d6339..6668dd5ef7b64 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -1971,8 +1971,8 @@ package android.app.usage { method public void reportUsageStop(@NonNull android.app.Activity, @NonNull String); method @RequiresPermission(android.Manifest.permission.CHANGE_APP_IDLE_STATE) public void setAppStandbyBucket(String, int); method @RequiresPermission(android.Manifest.permission.CHANGE_APP_IDLE_STATE) public void setAppStandbyBuckets(java.util.Map); - method @RequiresPermission(android.Manifest.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE) public void setEstimatedLaunchTime(@NonNull String, long); - method @RequiresPermission(android.Manifest.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE) public void setEstimatedLaunchTimes(@NonNull java.util.Map); + method @RequiresPermission(android.Manifest.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE) public void setEstimatedLaunchTimeMillis(@NonNull String, long); + method @RequiresPermission(android.Manifest.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE) public void setEstimatedLaunchTimesMillis(@NonNull java.util.Map); method @RequiresPermission(allOf={android.Manifest.permission.SUSPEND_APPS, android.Manifest.permission.OBSERVE_APP_USAGE}) public void unregisterAppUsageLimitObserver(int); method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterAppUsageObserver(int); method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterUsageSessionObserver(int); diff --git a/core/java/android/app/usage/UsageStatsManager.java b/core/java/android/app/usage/UsageStatsManager.java index 3cbb24b586b79..630b8d26f52e9 100644 --- a/core/java/android/app/usage/UsageStatsManager.java +++ b/core/java/android/app/usage/UsageStatsManager.java @@ -779,24 +779,25 @@ public final class UsageStatsManager { * thinks the app will be launched sooner, 2) the estimated time has passed. Passing in * {@link Long#MAX_VALUE} effectively clears the previously set launch time for the app. * - * @param packageName The package name of the app to set the bucket for. - * @param estimatedLaunchTime The next time the app is expected to be launched. Units are in - * milliseconds since epoch (the same as - * {@link System#currentTimeMillis()}). + * @param packageName The package name of the app to set the bucket for. + * @param estimatedLaunchTimeMillis The next time the app is expected to be launched. Units are + * in milliseconds since epoch (the same as + * {@link System#currentTimeMillis()}). * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE) - public void setEstimatedLaunchTime(@NonNull String packageName, - @CurrentTimeMillisLong long estimatedLaunchTime) { + public void setEstimatedLaunchTimeMillis(@NonNull String packageName, + @CurrentTimeMillisLong long estimatedLaunchTimeMillis) { if (packageName == null) { throw new NullPointerException("package name cannot be null"); } - if (estimatedLaunchTime <= 0) { + if (estimatedLaunchTimeMillis <= 0) { throw new IllegalArgumentException("estimated launch time must be positive"); } try { - mService.setEstimatedLaunchTime(packageName, estimatedLaunchTime, mContext.getUserId()); + mService.setEstimatedLaunchTime( + packageName, estimatedLaunchTimeMillis, mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -806,19 +807,20 @@ public final class UsageStatsManager { * Changes the estimated launch times for multiple apps at once. The map is keyed by the * package name and the value is the estimated launch time. * - * @param estimatedLaunchTimes A map of package name to estimated launch time. - * @see #setEstimatedLaunchTime(String, long) + * @param estimatedLaunchTimesMillis A map of package name to estimated launch time. + * @see #setEstimatedLaunchTimeMillis(String, long) * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE) - public void setEstimatedLaunchTimes(@NonNull Map estimatedLaunchTimes) { - if (estimatedLaunchTimes == null) { - throw new NullPointerException("estimatedLaunchTimes cannot be null"); + public void setEstimatedLaunchTimesMillis( + @NonNull Map estimatedLaunchTimesMillis) { + if (estimatedLaunchTimesMillis == null) { + throw new NullPointerException("estimatedLaunchTimesMillis cannot be null"); } final List estimateList = - new ArrayList<>(estimatedLaunchTimes.size()); - for (Map.Entry estimateEntry : estimatedLaunchTimes.entrySet()) { + new ArrayList<>(estimatedLaunchTimesMillis.size()); + for (Map.Entry estimateEntry : estimatedLaunchTimesMillis.entrySet()) { final String pkgName = estimateEntry.getKey(); if (pkgName == null) { throw new NullPointerException("package name cannot be null");