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 Details

    • ShadowCardEmulation

      public ShadowCardEmulation()
  • Method Details

    • isDefaultServiceForCategory

      @Implementation public boolean isDefaultServiceForCategory(ComponentName service, String category)
    • setPreferredService

      @Implementation public boolean setPreferredService(Activity activity, ComponentName service)
    • unsetPreferredService

      @Implementation public boolean unsetPreferredService(Activity activity)
    • setShouldDefaultToObserveModeForService

      @Implementation(minSdk=35) protected boolean setShouldDefaultToObserveModeForService(ComponentName service, boolean shouldDefaultToObserveMode)
    • registerPollingLoopPatternFilterForService

      @Implementation(minSdk=35) protected boolean registerPollingLoopPatternFilterForService(ComponentName service, String pollingLoopFilter, boolean autoTransact)
      Registers a polling loop filter for a service and stores if auto transact is enabled.
    • removePollingLoopPatternFilterForService

      @Implementation(minSdk=35) protected boolean removePollingLoopPatternFilterForService(ComponentName service, String pollingLoopFilter)
      Registers a polling loop filter for a service and stores if auto transact is enabled.
    • setDefaultServiceForCategory

      public static void setDefaultServiceForCategory(ComponentName service, String category)
      Modifies the behavior of isDefaultServiceForCategory(ComponentName, String) to return true for the given inputs.
    • getPreferredService

      @Nullable public static ComponentName getPreferredService()
      Utility function that returns the latest ComponentName captured when calling setPreferredService(Activity, ComponentName).
    • setCategoryPaymentAllowsForegroundPreference

      public static void setCategoryPaymentAllowsForegroundPreference(boolean value)
      Modifies the behavior of categoryAllowsForegroundPreference(String) to return the given value for the CardEmulation.CATEGORY_PAYMENT.
    • getShouldDefaultToObserveModeForService

      public static boolean getShouldDefaultToObserveModeForService(ComponentName service)
      Returns whether the given service has dynamically set observe mode to be enabled by default.
    • getRegisteredPollingLoopPatternFiltersForService

      @Nullable public static Map<String,Boolean> getRegisteredPollingLoopPatternFiltersForService(ComponentName service)
      Utility function that returns the list of polling loop filters and their auto transact status for a given service.
    • reset

      @Resetter public static void reset()