Package org.robolectric.shadows
Class ShadowCardEmulation
java.lang.Object
org.robolectric.shadows.ShadowCardEmulation
@Implements(android.nfc.cardemulation.CardEmulation.class)
public class ShadowCardEmulation
extends Object
Shadow implementation of
CardEmulation
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentName
Utility function that returns the latestComponentName
captured when callingsetPreferredService(Activity, ComponentName)
.static boolean
Returns whether the given service has dynamically set observe mode to be enabled by default.boolean
isDefaultServiceForCategory
(ComponentName service, String category) static void
reset()
static void
setCategoryPaymentAllowsForegroundPreference
(boolean value) Modifies the behavior ofcategoryAllowsForegroundPreference(String)
to return the givenvalue
for theCardEmulation.CATEGORY_PAYMENT
.static void
setDefaultServiceForCategory
(ComponentName service, String category) Modifies the behavior ofisDefaultServiceForCategory(ComponentName, String)
to returntrue
for the given inputs.boolean
setPreferredService
(Activity activity, ComponentName service) protected boolean
setShouldDefaultToObserveModeForService
(ComponentName service, boolean shouldDefaultToObserveMode) boolean
unsetPreferredService
(Activity activity)
-
Constructor Details
-
ShadowCardEmulation
public ShadowCardEmulation()
-
-
Method Details
-
isDefaultServiceForCategory
-
setPreferredService
-
unsetPreferredService
-
setShouldDefaultToObserveModeForService
@Implementation(minSdk=35) protected boolean setShouldDefaultToObserveModeForService(ComponentName service, boolean shouldDefaultToObserveMode) -
setDefaultServiceForCategory
Modifies the behavior ofisDefaultServiceForCategory(ComponentName, String)
to returntrue
for the given inputs. -
getPreferredService
Utility function that returns the latestComponentName
captured when callingsetPreferredService(Activity, ComponentName)
. -
setCategoryPaymentAllowsForegroundPreference
public static void setCategoryPaymentAllowsForegroundPreference(boolean value) Modifies the behavior ofcategoryAllowsForegroundPreference(String)
to return the givenvalue
for theCardEmulation.CATEGORY_PAYMENT
. -
getShouldDefaultToObserveModeForService
Returns whether the given service has dynamically set observe mode to be enabled by default. -
reset
-