Interface IAudioSinkConnection
interface IAudioSinkConnection
Extends com.amazon.apmf.IStandard
The interface to provide Audio connection functionalities.
Methods
connect()
void connect()
Connect audio to a device.
This is a blocking call. The IDevice reference that is passed into this
interface via the IAudioSink::getOrMakeAudioSinkConnection is the
remote device to which this audio connection is established. If
the device is already connected, this function returns without exception.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothOutOfResources— if the maximum number of audio sink connections are already connected.BluetoothConnectionFailed— if connection can’t be initiated.
disconnect()
void disconnect()
Disconnect Audio capability from the device.
This is a blocking call and the device to be disconnected is designated by
the IDevice reference passed into this interface via the
IAudioSink::getOrMakeAudioSinkConnection.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothNotConnected— if there is no audio connection.BluetoothFail— if the disconnection fails for any reason.
isConnected()
bool isConnected()
Checks if the audio capability is connected or not.
Privilege: com.amazon.bluetooth.privilege.access
Returns
bool
Returns true if connected, false otherwise.
isAudioConnected()
bool isAudioConnected()
Checks if the audio capability is connected or not.
If the audio capability is connected, the audio packets are
streamed over the A2DP profile.
Privilege: com.amazon.bluetooth.privilege.access
Returns
bool
Returns true if audio capability is connected, false otherwise.
getAudioSinkPlayerController()
Get the AVRCP controller. Returns the AudioSinkPlayerController to be used to get all the AVRCP related attributes. This interface throws an exception if there is no audio connection existing for the device associated with this interface.IAudioSinkPlayerController*getAudioSinkPlayerController()
Returns
IAudioSinkPlayerController*
Returns pointer to IAudioSinkPlayerController.
Throws
OutOfMemoryError— if failed to make IAudioSinkPlayerController.BluetoothNotConnected— if there is no audio connection.
getDevice()
Get the device associated with this connection interface. Retrieves the device interface corresponding to the Bluetooth device to which the Audio Sink connection is established/being established.IDevice*getDevice()
Returns
IDevice*
Returns pointer to IDevice.
addListener()
Subscribe to audio connection events. This interface must be used to subscribe for any connection events from the Audio Sink stack. Privilege: com.amazon.bluetooth.privilege.accesscom.amazon.apmf.ISubscription*addListener(IAudioSinkConnectionListener*listener)
Parameters
listener
IAudioSinkConnectionListener* — Required
The listener interface to receive the Audio Sink connection
notifications.
Returns
com.amazon.apmf.ISubscription*
Returns pointer to ISubscription.

