Package org.robolectric.shadows
Class ShadowShortcutManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowShortcutManager
-
@Implements(value=android.content.pm.ShortcutManager.class, minSdk=25) public class ShadowShortcutManager extends Object
-
-
Constructor Summary
Constructors Constructor Description ShadowShortcutManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaddDynamicShortcuts(List<ShortcutInfo> shortcutInfoList)protected IntentcreateShortcutResultIntent(ShortcutInfo shortcut)protected voiddisableShortcuts(List<String> shortcutIds)protected voiddisableShortcuts(List<String> shortcutIds, CharSequence unused)protected voidenableShortcuts(List<String> shortcutIds)protected List<ShortcutInfo>getDynamicShortcuts()protected intgetIconMaxHeight()protected intgetIconMaxWidth()protected List<ShortcutInfo>getManifestShortcuts()protected intgetMaxShortcutCountPerActivity()protected List<ShortcutInfo>getPinnedShortcuts()protected List<ShortcutInfo>getShortcuts(int matchFlags)In Robolectric, ShadowShortcutManager doesn't perform any caching so long lived shortcuts are returned on place of shortcuts cached when shown in notifications.protected booleanisRateLimitingActive()protected booleanisRequestPinShortcutSupported()protected voidpushDynamicShortcut(ShortcutInfo shortcut)In Robolectric, ShadowShortcutManager doesn't handle rate limiting or shortcut count limits.protected voidremoveAllDynamicShortcuts()protected voidremoveDynamicShortcuts(List<String> shortcutIds)protected voidremoveLongLivedShortcuts(List<String> shortcutIds)No-op on Robolectric.protected voidreportShortcutUsed(String shortcutId)protected booleanrequestPinShortcut(ShortcutInfo shortcut, IntentSender resultIntent)protected booleansetDynamicShortcuts(List<ShortcutInfo> shortcutInfoList)voidsetIconMaxHeight(int height)Sets the value returned bygetIconMaxHeight().voidsetIconMaxWidth(int width)Sets the value returned bygetIconMaxWidth().voidsetIsRequestPinShortcutSupported(boolean isRequestPinShortcutSupported)voidsetManifestShortcuts(List<ShortcutInfo> manifestShortcuts)Sets the value returned bygetManifestShortcuts().voidsetMaxShortcutCountPerActivity(int value)Sets the value returned bygetMaxShortcutCountPerActivity().protected booleanupdateShortcuts(List<ShortcutInfo> shortcutInfoList)protected voidupdateShortcutVisibility(String packageName, byte[] certificate, boolean visible)No-op on Robolectric.
-
-
-
Method Detail
-
addDynamicShortcuts
@Implementation protected boolean addDynamicShortcuts(List<ShortcutInfo> shortcutInfoList)
-
createShortcutResultIntent
@Implementation(minSdk=26) protected Intent createShortcutResultIntent(ShortcutInfo shortcut)
-
disableShortcuts
@Implementation protected void disableShortcuts(List<String> shortcutIds)
-
disableShortcuts
@Implementation protected void disableShortcuts(List<String> shortcutIds, CharSequence unused)
-
enableShortcuts
@Implementation protected void enableShortcuts(List<String> shortcutIds)
-
getDynamicShortcuts
@Implementation protected List<ShortcutInfo> getDynamicShortcuts()
-
getIconMaxHeight
@Implementation protected int getIconMaxHeight()
-
getIconMaxWidth
@Implementation protected int getIconMaxWidth()
-
setIconMaxHeight
public void setIconMaxHeight(int height)
Sets the value returned bygetIconMaxHeight().
-
setIconMaxWidth
public void setIconMaxWidth(int width)
Sets the value returned bygetIconMaxWidth().
-
getManifestShortcuts
@Implementation protected List<ShortcutInfo> getManifestShortcuts()
-
setManifestShortcuts
public void setManifestShortcuts(List<ShortcutInfo> manifestShortcuts)
Sets the value returned bygetManifestShortcuts().
-
getMaxShortcutCountPerActivity
@Implementation protected int getMaxShortcutCountPerActivity()
-
setMaxShortcutCountPerActivity
public void setMaxShortcutCountPerActivity(int value)
Sets the value returned bygetMaxShortcutCountPerActivity().
-
getPinnedShortcuts
@Implementation protected List<ShortcutInfo> getPinnedShortcuts()
-
isRateLimitingActive
@Implementation protected boolean isRateLimitingActive()
-
isRequestPinShortcutSupported
@Implementation(minSdk=26) protected boolean isRequestPinShortcutSupported()
-
setIsRequestPinShortcutSupported
public void setIsRequestPinShortcutSupported(boolean isRequestPinShortcutSupported)
-
removeAllDynamicShortcuts
@Implementation protected void removeAllDynamicShortcuts()
-
removeDynamicShortcuts
@Implementation protected void removeDynamicShortcuts(List<String> shortcutIds)
-
reportShortcutUsed
@Implementation protected void reportShortcutUsed(String shortcutId)
-
requestPinShortcut
@Implementation(minSdk=26) protected boolean requestPinShortcut(ShortcutInfo shortcut, IntentSender resultIntent)
-
setDynamicShortcuts
@Implementation protected boolean setDynamicShortcuts(List<ShortcutInfo> shortcutInfoList)
-
updateShortcuts
@Implementation protected boolean updateShortcuts(List<ShortcutInfo> shortcutInfoList)
-
updateShortcutVisibility
protected void updateShortcutVisibility(String packageName, byte[] certificate, boolean visible)
No-op on Robolectric. The real implementation calls out to a service, which will NPE on Robolectric.
-
getShortcuts
@Implementation(minSdk=30) protected List<ShortcutInfo> getShortcuts(int matchFlags)
In Robolectric, ShadowShortcutManager doesn't perform any caching so long lived shortcuts are returned on place of shortcuts cached when shown in notifications.
-
pushDynamicShortcut
@Implementation(minSdk=30) protected void pushDynamicShortcut(ShortcutInfo shortcut)
In Robolectric, ShadowShortcutManager doesn't handle rate limiting or shortcut count limits. So, pushDynamicShortcut is similar toaddDynamicShortcuts(List)but with only oneShortcutInfo.
-
removeLongLivedShortcuts
@Implementation(minSdk=30) protected void removeLongLivedShortcuts(List<String> shortcutIds)
No-op on Robolectric. The real implementation calls out to a service, which will NPE on Robolectric.
-
-