FileDocCategorySizeDatePackage
BluetoothProfile.javaAPI DocAndroid 5.1 API6227Thu Mar 12 22:22:10 GMT 2015android.bluetooth

BluetoothProfile

public interface BluetoothProfile
Public APIs for the Bluetooth Profiles.

Clients should call {@link BluetoothAdapter#getProfileProxy}, to get the Profile Proxy. Each public profile implements this interface.

Fields Summary
public static final String
EXTRA_STATE
Extra for the connection state intents of the individual profiles. This extra represents the current connection state of the profile of the Bluetooth device.
public static final String
EXTRA_PREVIOUS_STATE
Extra for the connection state intents of the individual profiles. This extra represents the previous connection state of the profile of the Bluetooth device.
public static final int
STATE_DISCONNECTED
The profile is in disconnected state
public static final int
STATE_CONNECTING
The profile is in connecting state
public static final int
STATE_CONNECTED
The profile is in connected state
public static final int
STATE_DISCONNECTING
The profile is in disconnecting state
public static final int
HEADSET
Headset and Handsfree profile
public static final int
A2DP
A2DP profile.
public static final int
HEALTH
Health Profile
public static final int
INPUT_DEVICE
Input Device Profile
public static final int
PAN
PAN Profile
public static final int
PBAP
PBAP
public static final int
GATT
GATT
public static final int
GATT_SERVER
GATT_SERVER
public static final int
MAP
MAP Profile
public static final int
A2DP_SINK
A2DP Sink Profile
public static final int
AVRCP_CONTROLLER
AVRCP Controller Profile
public static final int
HEADSET_CLIENT
Headset Client - HFP HF Role
public static final int
PRIORITY_AUTO_CONNECT
Default priority for devices that we try to auto-connect to and and allow incoming connections for the profile
public static final int
PRIORITY_ON
Default priority for devices that allow incoming and outgoing connections for the profile
public static final int
PRIORITY_OFF
Default priority for devices that does not allow incoming connections and outgoing connections for the profile.
public static final int
PRIORITY_UNDEFINED
Default priority when not set or when the device is unpaired
Constructors Summary
Methods Summary
public java.util.ListgetConnectedDevices()
Get connected devices for this specific profile.

Return the set of devices which are in state {@link #STATE_CONNECTED}

Requires {@link android.Manifest.permission#BLUETOOTH} permission.

return
List of devices. The list will be empty on error.

public intgetConnectionState(BluetoothDevice device)
Get the current connection state of the profile

Requires {@link android.Manifest.permission#BLUETOOTH} permission.

param
device Remote bluetooth device.
return
State of the profile connection. One of {@link #STATE_CONNECTED}, {@link #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING}

public java.util.ListgetDevicesMatchingConnectionStates(int[] states)
Get a list of devices that match any of the given connection states.

If none of the devices match any of the given states, an empty list will be returned.

Requires {@link android.Manifest.permission#BLUETOOTH} permission.

param
states Array of states. States can be one of {@link #STATE_CONNECTED}, {@link #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING},
return
List of devices. The list will be empty on error.