Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IHandsfreeClient

interface IHandsfreeClient
Extends com.amazon.apmf.IStandard

Methods

addListener()

com.amazon.apmf.ISubscription* addListener(IHandsfreeClientListener* listener)
Subscribe to hands-free client connection events that are triggered by the remote device OR by another application. A call to IHandsfreeClientConnection::connect() does NOT trigger events in this listener. This listener is for receiving events related to connections triggered by the remote device and other applications only. Privilege: com.amazon.bluetooth.privilege.access

Parameters

listener
IHandsfreeClientListener* — Required Callback for receiving hands-free client incoming connection events OR connections triggered by other applications. See IHandsfreeClientListener.

Returns

com.amazon.apmf.ISubscription* Returns pointer to ISubscription.

getOrMakeHandsfreeClientDevice()

IHandsfreeClientConnection* getOrMakeHandsfreeClientDevice(IDevice* device)
Creates a hands-free client connection interface for a specific device. This API only creates the interface (creating a IHandsfreeClientConnection object), it does NOT create a profile-level hands-free connection automatically. If an interface already exists for the specified device, it is returned by this API. For outgoing connections: The IHandsfreeClientConnection::connect() function must be called to initiate the profile connection. For incoming connections/connections initiated by other applications: IHandsfreeClientListener::onConnection() is received with the IHandsfreeClientConnection interface for the connected device. If the client application drops the reference to the IHandsfreeClientConnection interface, the IHandsfreeClientConnectionListener does not receive events.

Parameters

device
IDevice* — Required The device to create the interface for.

Returns

IHandsfreeClientConnection* Returns a connection interface, see IHandsfreeClientConnection. The connection interface is a smart pointer and it must be stored as long as the caller wants to use this connection.

getConnectedDevices()

IDevice*[] getConnectedDevices()
Get the list of devices currently connected with the hands-free profile. This returns and array of IDevice objects that have active connections only. If there is no hands-free client profile connection active, it is not be included in this list. To interact with a device, the IHandsfreeClient::getOrMakeHandsfreeClientDevice() function needs to be called on each device to retrieve the IHandsfreeClientConnection interface. To register for events related to the device, a call to IHandsfreeClientConnection::addListener is required to register the IHandsfreeClientConnectionListener. Privilege: com.amazon.bluetooth.privilege.access

Returns

IDevice*[] Returns an array of connected devices. Empty if no devices connected.
Last modified on October 29, 2026