Enum Class ChannelNotAvailableReason

java.lang.Object
java.lang.Enum<ChannelNotAvailableReason>
com.dsi.ant.channel.ChannelNotAvailableReason
All Implemented Interfaces:
Serializable, Comparable<ChannelNotAvailableReason>, Constable

public enum ChannelNotAvailableReason extends Enum<ChannelNotAvailableReason>
The possible causes of a ChannelNotAvailableException.
Since:
4.0
  • Enum Constant Details

    • UNKNOWN

      public static final ChannelNotAvailableReason UNKNOWN
      The ANT Radio Service sent a reason code which is not defined in this version of the API. This could be a new reason or a more detailed explanation for an existing reason.
      Since:
      4.0
    • SERVICE_INITIALIZING

      public static final ChannelNotAvailableReason SERVICE_INITIALIZING
      The ANT Radio Service is still starting up. It is not known if there are any ANT adapters/channels available. An AntChannelProvider.ACTION_CHANNEL_PROVIDER_STATE_CHANGED Intent will be sent once the service has finished initializing.
      Since:
      4.0
    • NO_ADAPTERS_EXIST

      public static final ChannelNotAvailableReason NO_ADAPTERS_EXIST
      There is no ANT adapter to request a channel from or the requested ANT adapter has been removed.

      An ANT adapter is considered available if:

      • A built in adapter is present and it is initialized
      • or an add-on Service is installed, such as the ANT USB Service AND it has an adapter connected and initialized
      Note: A connected adapter is considered initialized except when it is resetting or for a short period of time after it has just been connected.
      Since:
      4.0
    • ANT_DISABLED_AIRPLANE_MODE_ON

      public static final ChannelNotAvailableReason ANT_DISABLED_AIRPLANE_MODE_ON
      Could not get a channel because ANT is currently disabled due to Airplane Mode being on and ANT being Airplane Mode sensitive. If desired, applications can prompt the user to disable Airplane Mode, listen for Android's Airplane Mode Changed intent, and attempt to acquire a channel again.
      Since:
      4.4.2
    • ANT_NOT_ENABLED

      public static final ChannelNotAvailableReason ANT_NOT_ENABLED
      Could not get a channel because ANT is currently disabled due to ANT allowed is switched off in the System Global Settings. If desired, applications can prompt the user to switch on ANT allowed, and attempt to acquire a channel again. The ANT System Settings page can be shown to prompt the user to enable ANT by calling AntService.displayAntSettings(android.content.Context).
      Since:
      4.8.1
    • ALL_CHANNELS_IN_USE_LEGACY

      public static final ChannelNotAvailableReason ALL_CHANNELS_IN_USE_LEGACY
      Could not get a channel because all channels are in use. An entire ANT adapter is in use by the legacy 'Whole Adapter' API. The user will receive a notification allowing them to free the adapter.
      Since:
      4.1
    • ALL_CHANNELS_IN_USE

      public static final ChannelNotAvailableReason ALL_CHANNELS_IN_USE
      Could not get a channel because all channels have been individually acquired. See ALL_CHANNELS_IN_USE_LEGACY for the case that the whole ANT adapter is in use by a legacy application.
      Since:
      4.0
    • NO_CHANNELS_MATCH_CRITERIA

      public static final ChannelNotAvailableReason NO_CHANNELS_MATCH_CRITERIA
      Could not get a channel because no available channels have the required capabilities.
      Since:
      4.0
    • RELEASE_PROCESSING

      public static final ChannelNotAvailableReason RELEASE_PROCESSING
      Could not get a channel, but one with the required capabilities is currently releasing, and an AntChannelProvider.ACTION_CHANNEL_PROVIDER_STATE_CHANGED Intent will be sent once it is available.
      Since:
      4.0
    • NETWORK_NOT_AVAILABLE

      public static final ChannelNotAvailableReason NETWORK_NOT_AVAILABLE
      There are too many simultaneous networks in use, found a channel but could not use the selected network.
      Since:
      4.0
  • Method Details

    • values

      public static ChannelNotAvailableReason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ChannelNotAvailableReason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getRawValue

      public int getRawValue()
      Returns the raw value of the channel not available reason.
      Since:
      4.0
    • create

      public static ChannelNotAvailableReason create(int rawValue)
      Creates a ChannelNotAvailableReason for the given raw value.
      Parameters:
      rawValue - An integer value matching a reason in the enumeration
      Returns:
      The reason that matches the given raw value. Unknown, if no match in the enumeration is found.
      Since:
      4.0