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
Modifier and Type Method Description protected boolean
addDynamicShortcuts(List<ShortcutInfo> shortcutInfoList)
protected Intent
createShortcutResultIntent(ShortcutInfo shortcut)
protected void
disableShortcuts(List<String> shortcutIds)
protected void
disableShortcuts(List<String> shortcutIds, CharSequence unused)
protected void
enableShortcuts(List<String> shortcutIds)
protected List<ShortcutInfo>
getDynamicShortcuts()
protected int
getIconMaxHeight()
protected int
getIconMaxWidth()
protected List<ShortcutInfo>
getManifestShortcuts()
protected int
getMaxShortcutCountPerActivity()
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 boolean
isRateLimitingActive()
protected boolean
isRequestPinShortcutSupported()
protected void
pushDynamicShortcut(ShortcutInfo shortcut)
In Robolectric, ShadowShortcutManager doesn't handle rate limiting or shortcut count limits.protected void
removeAllDynamicShortcuts()
protected void
removeDynamicShortcuts(List<String> shortcutIds)
protected void
removeLongLivedShortcuts(List<String> shortcutIds)
No-op on Robolectric.protected void
reportShortcutUsed(String shortcutId)
protected boolean
requestPinShortcut(ShortcutInfo shortcut, IntentSender resultIntent)
protected boolean
setDynamicShortcuts(List<ShortcutInfo> shortcutInfoList)
void
setIconMaxHeight(int height)
Sets the value returned bygetIconMaxHeight()
.void
setIconMaxWidth(int width)
Sets the value returned bygetIconMaxWidth()
.void
setIsRequestPinShortcutSupported(boolean isRequestPinShortcutSupported)
void
setManifestShortcuts(List<ShortcutInfo> manifestShortcuts)
Sets the value returned bygetManifestShortcuts()
.void
setMaxShortcutCountPerActivity(int value)
Sets the value returned bygetMaxShortcutCountPerActivity()
.protected boolean
updateShortcuts(List<ShortcutInfo> shortcutInfoList)
-
Constructor Details
-
ShadowShortcutManager
public ShadowShortcutManager()
-
-
Method Details
-
addDynamicShortcuts
-
createShortcutResultIntent
-
disableShortcuts
-
disableShortcuts
-
enableShortcuts
-
getDynamicShortcuts
-
getIconMaxHeight
-
getIconMaxWidth
-
setIconMaxHeight
public void setIconMaxHeight(int height)Sets the value returned bygetIconMaxHeight()
. -
setIconMaxWidth
public void setIconMaxWidth(int width)Sets the value returned bygetIconMaxWidth()
. -
getManifestShortcuts
-
setManifestShortcuts
Sets the value returned bygetManifestShortcuts()
. -
getMaxShortcutCountPerActivity
-
setMaxShortcutCountPerActivity
public void setMaxShortcutCountPerActivity(int value)Sets the value returned bygetMaxShortcutCountPerActivity()
. -
getPinnedShortcuts
-
isRateLimitingActive
-
isRequestPinShortcutSupported
-
setIsRequestPinShortcutSupported
public void setIsRequestPinShortcutSupported(boolean isRequestPinShortcutSupported) -
removeAllDynamicShortcuts
-
removeDynamicShortcuts
-
reportShortcutUsed
-
requestPinShortcut
@Implementation(minSdk=26) protected boolean requestPinShortcut(ShortcutInfo shortcut, IntentSender resultIntent) -
setDynamicShortcuts
-
updateShortcuts
-
getShortcuts
In Robolectric, ShadowShortcutManager doesn't perform any caching so long lived shortcuts are returned on place of shortcuts cached when shown in notifications. -
pushDynamicShortcut
In Robolectric, ShadowShortcutManager doesn't handle rate limiting or shortcut count limits. So, pushDynamicShortcut is similar toaddDynamicShortcuts(List)
but with only oneShortcutInfo
. -
removeLongLivedShortcuts
No-op on Robolectric. The real implementation calls out to a service, which will NPE on Robolectric.
-