From f805b43da7f6d9b12993f9320d80587bc0d0d16a Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Thu, 7 Jul 2016 11:51:52 -0700 Subject: [PATCH] Hide more shortcut APIs Change-Id: I911b4963b878e67ad2084190ac080e8555ba63c0 --- api/current.txt | 2 -- api/system-current.txt | 2 -- api/test-current.txt | 2 -- .../android/content/pm/ShortcutManager.java | 22 ++++--------------- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/api/current.txt b/api/current.txt index b675136153d57..d5f36bdb081f8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10108,8 +10108,6 @@ package android.content.pm { method public java.util.List getManifestShortcuts(); method public int getMaxShortcutCountPerActivity(); method public java.util.List getPinnedShortcuts(); - method public long getRateLimitResetTime(); - method public int getRemainingCallCount(); method public void removeAllDynamicShortcuts(); method public void removeDynamicShortcuts(java.util.List); method public void reportShortcutUsed(java.lang.String); diff --git a/api/system-current.txt b/api/system-current.txt index d69cb648917f8..cda5ba7430822 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -10533,8 +10533,6 @@ package android.content.pm { method public java.util.List getManifestShortcuts(); method public int getMaxShortcutCountPerActivity(); method public java.util.List getPinnedShortcuts(); - method public long getRateLimitResetTime(); - method public int getRemainingCallCount(); method public void removeAllDynamicShortcuts(); method public void removeDynamicShortcuts(java.util.List); method public void reportShortcutUsed(java.lang.String); diff --git a/api/test-current.txt b/api/test-current.txt index 95d2408db4b51..7fdbb6411ef48 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -10122,8 +10122,6 @@ package android.content.pm { method public java.util.List getManifestShortcuts(); method public int getMaxShortcutCountPerActivity(); method public java.util.List getPinnedShortcuts(); - method public long getRateLimitResetTime(); - method public int getRemainingCallCount(); method public void removeAllDynamicShortcuts(); method public void removeDynamicShortcuts(java.util.List); method public void reportShortcutUsed(java.lang.String); diff --git a/core/java/android/content/pm/ShortcutManager.java b/core/java/android/content/pm/ShortcutManager.java index 7b3c487172635..1af63a01ce2bc 100644 --- a/core/java/android/content/pm/ShortcutManager.java +++ b/core/java/android/content/pm/ShortcutManager.java @@ -63,24 +63,6 @@ import java.util.List; * published, existing shortcuts with the same ID will be updated. Note this may include a * pinned shortcut. * - *

Rate limiting

- * - * Calls to {@link #setDynamicShortcuts(List)}, {@link #addDynamicShortcuts(List)}, - * and {@link #updateShortcuts(List)} from background applications will be - * rate-limited. An application can call these methods at most - * {@link #getRemainingCallCount()} times until the rate-limiting counter is reset, - * which happens at a certain time every day. - * - *

An application can use {@link #getRateLimitResetTime()} to get the next reset time. - * - *

Foreground applications (i.e. ones with a foreground activity or a foreground services) - * will not be throttled. Also, when an application comes to foreground, - * {@link #getRemainingCallCount()} will be reset to the initial value. - * - *

For testing purposes, use "Developer Options" (found in the Settings menu) to reset the - * internal rate-limiting counter. Automated tests can use the following ADB shell command to - * achieve the same effect:

- *
adb shell cmd shortcut reset-throttling
* *

Backup and Restore

* @@ -328,6 +310,8 @@ public class ShortcutManager { * before the rate limit counter is reset. * * @see #getRateLimitResetTime() + * + * @hide */ public int getRemainingCallCount() { try { @@ -342,6 +326,8 @@ public class ShortcutManager { * * @see #getRemainingCallCount() * @see System#currentTimeMillis() + * + * @hide */ public long getRateLimitResetTime() { try {