Package com.dsi.ant.channel.ipc.aidl
Class AntChannelProviderCommunicatorAidl
java.lang.Object
com.dsi.ant.channel.ipc.aidl.AntChannelProviderCommunicatorAidl
- All Implemented Interfaces:
IAntChannelProviderCommunicator
public class AntChannelProviderCommunicatorAidl
extends Object
implements IAntChannelProviderCommunicator
An implementation of an ANT Channel Pool Communicator which uses AIDL as the communication
method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Key needed to extract continuous scan mode supported from the data bundle of an IPC message.static final String
Key needed to extract desiredAdapterInfo
from the data bundle of an IPC message.static final String
Key needed to extract desiredCapabilities
from the data bundle of an IPC message.static final String
Key needed to extract the library version code of this library.static final String
Key needed to extract aNetworkKey
from the data bundle of an IPC message.static final String
Key needed to extract thePredefinedNetwork
from the data bundle of an IPC message.static final String
Key needed to extract requiredCapabilities
from the data bundle of an IPC message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquireAllChannelsForContinuousScan
(android.content.Context context, AdapterInfo adapterInfo, int predefinedNetwork, android.os.Bundle error) Acquires channels to use for continuous scan from the ANT Radio ServiceacquireAllChannelsForContinuousScan
(android.content.Context context, AdapterInfo adapterInfo, NetworkKey networkKey, android.os.Bundle error) Acquires channels to use for continuous scan from the ANT Radio ServiceacquireChannel
(android.content.Context context, int whichNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) Request a new ANT channel from the ANT Radio Service.acquireChannelFromAdapter
(android.content.Context context, AdapterInfo desiredAdapter, int whichNetwork, android.os.Bundle error) Request a new ANT channel on the specified adapter from the ANT Radio Service.acquireChannelOnPrivateNetwork
(android.content.Context context, NetworkKey privateNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) Request a new ANT channel on the specified private network from the ANT Radio Service.acquireChannelOnPrivateNetworkFromAdapter
(android.content.Context context, AdapterInfo desiredAdapter, NetworkKey privateNetwork, android.os.Bundle error) Request a new ANT channel on the specified adapter from the ANT Radio Service.int
getNumChannelsAvailable
(Capabilities requiredCapabilities) Query the availability of channels with the specified capabilities.boolean
Queries if the legacy interface is in use.
-
Field Details
-
KEY_LIBRARY_VERSION_CODE
Key needed to extract the library version code of this library.- See Also:
-
KEY_NETWORK_KEY
Key needed to extract aNetworkKey
from the data bundle of an IPC message.- See Also:
-
KEY_PREDEFINED_NETWORK
Key needed to extract thePredefinedNetwork
from the data bundle of an IPC message.- See Also:
-
KEY_REQUIRED_CAPABILITIES
Key needed to extract requiredCapabilities
from the data bundle of an IPC message.- See Also:
-
KEY_DESIRED_CAPABILITIES
Key needed to extract desiredCapabilities
from the data bundle of an IPC message.- See Also:
-
KEY_DESIRED_ADAPTER
Key needed to extract desiredAdapterInfo
from the data bundle of an IPC message.- See Also:
-
KEY_CONTINUOUS_SCAN_MODE_SUPPORTED
Key needed to extract continuous scan mode supported from the data bundle of an IPC message.- See Also:
-
-
Constructor Details
-
AntChannelProviderCommunicatorAidl
public AntChannelProviderCommunicatorAidl(android.os.IBinder binder)
-
-
Method Details
-
acquireChannel
public IAntChannelCommunicator acquireChannel(android.content.Context context, int whichNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) throws android.os.RemoteException Description copied from interface:IAntChannelProviderCommunicator
Request a new ANT channel from the ANT Radio Service.- Specified by:
acquireChannel
in interfaceIAntChannelProviderCommunicator
- Returns:
- The acquired ANT channel, or null. If the returned channel is null the Bundle
"error" will contain a
ChannelNotAvailableException
under the key "error" - Throws:
android.os.RemoteException
-
acquireChannelOnPrivateNetwork
public IAntChannelCommunicator acquireChannelOnPrivateNetwork(android.content.Context context, NetworkKey privateNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicator
Request a new ANT channel on the specified private network from the ANT Radio Service. This replaces the acquire channel method that receives a byte array, which still must exist in the aidl file to ensure backwards compatibility and is still required to be implemented by ANT Radio Service.- Specified by:
acquireChannelOnPrivateNetwork
in interfaceIAntChannelProviderCommunicator
- Returns:
- The acquired ANT channel, or null. If the returned channel is null
the Bundle "error" will contain a
ChannelNotAvailableException
under the key "error" - Throws:
android.os.RemoteException
UnsupportedFeatureException
-
acquireChannelFromAdapter
public IAntChannelCommunicator acquireChannelFromAdapter(android.content.Context context, AdapterInfo desiredAdapter, int whichNetwork, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicator
Request a new ANT channel on the specified adapter from the ANT Radio Service.- Specified by:
acquireChannelFromAdapter
in interfaceIAntChannelProviderCommunicator
- Returns:
- The acquired ANT channel, or null. If the returned channel is null
the Bundle "error" will contain a
ChannelNotAvailableException
under the key "error" - Throws:
android.os.RemoteException
UnsupportedFeatureException
-
acquireChannelOnPrivateNetworkFromAdapter
public IAntChannelCommunicator acquireChannelOnPrivateNetworkFromAdapter(android.content.Context context, AdapterInfo desiredAdapter, NetworkKey privateNetwork, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicator
Request a new ANT channel on the specified adapter from the ANT Radio Service.- Specified by:
acquireChannelOnPrivateNetworkFromAdapter
in interfaceIAntChannelProviderCommunicator
- Returns:
- The acquired ANT channel, or null. If the returned channel is null
the Bundle "error" will contain a
ChannelNotAvailableException
under the key "error" - Throws:
android.os.RemoteException
UnsupportedFeatureException
-
getNumChannelsAvailable
public int getNumChannelsAvailable(Capabilities requiredCapabilities) throws android.os.RemoteException Description copied from interface:IAntChannelProviderCommunicator
Query the availability of channels with the specified capabilities.- Specified by:
getNumChannelsAvailable
in interfaceIAntChannelProviderCommunicator
- Returns:
- the number of channels with the requested capabilities available at the time of the query
- Throws:
android.os.RemoteException
-
isLegacyInterfaceInUse
public boolean isLegacyInterfaceInUse() throws android.os.RemoteExceptionDescription copied from interface:IAntChannelProviderCommunicator
Queries if the legacy interface is in use. If there are no channels available, applications can use this check to determine if the legacy interface is using all the channels. In this case, applications can attempt to acquire a channel to force claim the adapter.- Specified by:
isLegacyInterfaceInUse
in interfaceIAntChannelProviderCommunicator
- Returns:
- true if the legacy interface is in use. If true, applications can attempt to acquire channels anyway and force claim the adapter.
- Throws:
android.os.RemoteException
-
acquireAllChannelsForContinuousScan
public IAntChannelCommunicator[] acquireAllChannelsForContinuousScan(android.content.Context context, AdapterInfo adapterInfo, NetworkKey networkKey, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicator
Acquires channels to use for continuous scan from the ANT Radio Service- Specified by:
acquireAllChannelsForContinuousScan
in interfaceIAntChannelProviderCommunicator
- Returns:
- All ANT channels pertaining to adapterInfo, or null. If the
returned channel is null the Bundle "error" will contain a
ChannelNotAvailableException
under the key "error" - Throws:
android.os.RemoteException
UnsupportedFeatureException
-
acquireAllChannelsForContinuousScan
public IAntChannelCommunicator[] acquireAllChannelsForContinuousScan(android.content.Context context, AdapterInfo adapterInfo, int predefinedNetwork, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicator
Acquires channels to use for continuous scan from the ANT Radio Service- Specified by:
acquireAllChannelsForContinuousScan
in interfaceIAntChannelProviderCommunicator
- Returns:
- All ANT channels pertaining to adapterInfo, or null. If the
returned channel is null the Bundle "error" will contain a
ChannelNotAvailableException
under the key "error" - Throws:
android.os.RemoteException
UnsupportedFeatureException
-