public interface BluetoothProfile
Clients should call BluetoothAdapter.getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int)
,
to get the Profile Proxy. Each public profile implements this
interface.
Modifier and Type | Interface and Description |
---|---|
static interface |
BluetoothProfile.ServiceListener
An interface for notifying BluetoothProfile IPC clients when they have
been connected or disconnected to the service.
|
Modifier and Type | Field and Description |
---|---|
static int |
A2DP
A2DP profile.
|
static String |
EXTRA_PREVIOUS_STATE
Extra for the connection state intents of the individual profiles.
|
static String |
EXTRA_STATE
Extra for the connection state intents of the individual profiles.
|
static int |
HEADSET
Headset and Handsfree profile
|
static int |
HEALTH
Health Profile
|
static int |
INPUT_DEVICE
Input Device Profile
|
static int |
PAN
PAN Profile
|
static int |
PBAP
PBAP
|
static int |
PRIORITY_AUTO_CONNECT
Default priority for devices that we try to auto-connect to and
and allow incoming connections for the profile
|
static int |
PRIORITY_OFF
Default priority for devices that does not allow incoming
connections and outgoing connections for the profile.
|
static int |
PRIORITY_ON
Default priority for devices that allow incoming
and outgoing connections for the profile
|
static int |
PRIORITY_UNDEFINED
Default priority when not set or when the device is unpaired
|
static int |
STATE_CONNECTED
The profile is in connected state
|
static int |
STATE_CONNECTING
The profile is in connecting state
|
static int |
STATE_DISCONNECTED
The profile is in disconnected state
|
static int |
STATE_DISCONNECTING
The profile is in disconnecting state
|
Modifier and Type | Method and Description |
---|---|
List<BluetoothDevice> |
getConnectedDevices()
Get connected devices for this specific profile.
|
int |
getConnectionState(BluetoothDevice device)
Get the current connection state of the profile
|
List<BluetoothDevice> |
getDevicesMatchingConnectionStates(int[] states)
Get a list of devices that match any of the given connection
states.
|
static final String EXTRA_STATE
static final String EXTRA_PREVIOUS_STATE
static final int STATE_DISCONNECTED
static final int STATE_CONNECTING
static final int STATE_CONNECTED
static final int STATE_DISCONNECTING
static final int HEADSET
static final int A2DP
static final int HEALTH
static final int INPUT_DEVICE
static final int PAN
static final int PBAP
static final int PRIORITY_AUTO_CONNECT
static final int PRIORITY_ON
static final int PRIORITY_OFF
static final int PRIORITY_UNDEFINED
List<BluetoothDevice> getConnectedDevices()
Return the set of devices which are in state STATE_CONNECTED
Requires android.Manifest.permission#BLUETOOTH
permission.
List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states)
If none of the devices match any of the given states, an empty list will be returned.
Requires android.Manifest.permission#BLUETOOTH
permission.
states
- Array of states. States can be one of
STATE_CONNECTED
, STATE_CONNECTING
,
STATE_DISCONNECTED
, STATE_DISCONNECTING
,int getConnectionState(BluetoothDevice device)
Requires android.Manifest.permission#BLUETOOTH
permission.
device
- Remote bluetooth device.STATE_CONNECTED
, STATE_CONNECTING
,
STATE_DISCONNECTED
, STATE_DISCONNECTING