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 ofCardEmulation
.
-
-
Constructor Summary
Constructors Constructor Description ShadowCardEmulation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ComponentName
getPreferredService()
Utility function that returns the latestComponentName
captured when callingsetPreferredService(Activity, ComponentName)
.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)
boolean
unsetPreferredService(Activity activity)
-
-
-
Method Detail
-
isDefaultServiceForCategory
@Implementation(minSdk=19) public boolean isDefaultServiceForCategory(ComponentName service, String category)
-
setPreferredService
@Implementation(minSdk=21) public boolean setPreferredService(Activity activity, ComponentName service)
-
unsetPreferredService
@Implementation(minSdk=21) public boolean unsetPreferredService(Activity activity)
-
setDefaultServiceForCategory
public static void setDefaultServiceForCategory(ComponentName service, String category)
Modifies the behavior ofisDefaultServiceForCategory(ComponentName, String)
to returntrue
for the given inputs.
-
getPreferredService
public static ComponentName 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
.
-
reset
@Resetter public static void reset()
-
-