BluetoothProfile
interface BluetoothProfile
| android.bluetooth.BluetoothProfile | 
Public APIs for the Bluetooth Profiles.
Clients should call BluetoothAdapter.getProfileProxy, to get the Profile Proxy. Each public profile implements this interface.
Summary
| Nested classes | |
|---|---|
| abstract | 
            
             An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service.  | 
        
| Constants | |
|---|---|
| static Int | 
            
             Advanced Audio Distribution Profile (A2DP)  | 
        
| static Int | 
            
             Coordinated Set Identification Profile (CSIP) set coordinator  | 
        
| static String | 
            
             Extra for the connection state intents of the individual profiles.  | 
        
| static String | 
            
             Extra for the   | 
        
| static String | 
            
             Extra for the connection state intents of the individual profiles.  | 
        
| static Int | 
            
             Generic Attribute Profile (GATT)  | 
        
| static Int | 
            
             Generic Attribute Profile (GATT) Server  | 
        
| static Int | |
| static Int | 
            
             Headset and Handsfree profile  | 
        
| static Int | 
            
             Health Profile  | 
        
| static Int | 
            
             Hearing Aid Device  | 
        
| static Int | 
            
             Human Interface Device (HID) Device  | 
        
| static Int | 
            
             LE Audio Device  | 
        
| static Int | 
            
             SIM Access Profile (SAP)  | 
        
| static Int | 
            
             The profile is in connected state  | 
        
| static Int | 
            
             The profile is in connecting state  | 
        
| static Int | 
            
             The profile is in disconnected state  | 
        
| static Int | 
            
             The profile is in disconnecting state  | 
        
| Public methods | |
|---|---|
| abstract MutableList<BluetoothDevice!>! | 
            
             Get connected devices for this specific profile.  | 
        
| abstract Int | 
            getConnectionState(device: BluetoothDevice!)Get the current connection state of the profile  | 
        
| abstract MutableList<BluetoothDevice!>! | 
            getDevicesMatchingConnectionStates(states: IntArray!)Get a list of devices that match any of the given connection states.  | 
        
Constants
CSIP_SET_COORDINATOR
static val CSIP_SET_COORDINATOR: Int
Coordinated Set Identification Profile (CSIP) set coordinator
Value: 25EXTRA_PREVIOUS_STATE
static val EXTRA_PREVIOUS_STATE: String
Extra for the connection state intents of the individual profiles.
This extra represents the previous connection state of the profile of the Bluetooth device.
Value: "android.bluetooth.profile.extra.PREVIOUS_STATE"EXTRA_PROFILE
static val EXTRA_PROFILE: String
Extra for the BluetoothProfile that the intent applies to. 
This extra represents the Bluetooth profile that the intent applies to.
Value: "android.bluetooth.profile.extra.PROFILE"EXTRA_STATE
static val EXTRA_STATE: String
Extra for the connection state intents of the individual profiles.
This extra represents the current connection state of the profile of the Bluetooth device.
Value: "android.bluetooth.profile.extra.STATE"GATT_SERVER
static val GATT_SERVER: Int
Generic Attribute Profile (GATT) Server
Value: 8HEALTH
static valHEALTH: Int
Deprecated: Health Device Profile (HDP) and MCAP protocol are no longer used. New apps should use Bluetooth Low Energy based solutions such as BluetoothGatt, android.bluetooth.BluetoothAdapter#listenUsingL2capChannel(), or android.bluetooth.BluetoothDevice#createL2capChannel(int)
Health Profile
Value: 3HID_DEVICE
static val HID_DEVICE: Int
Human Interface Device (HID) Device
Value: 19STATE_CONNECTED
static val STATE_CONNECTED: Int
The profile is in connected state
Value: 2STATE_CONNECTING
static val STATE_CONNECTING: Int
The profile is in connecting state
Value: 1STATE_DISCONNECTED
static val STATE_DISCONNECTED: Int
The profile is in disconnected state
Value: 0STATE_DISCONNECTING
static val STATE_DISCONNECTING: Int
The profile is in disconnecting state
Value: 3Public methods
getConnectedDevices
abstract fun getConnectedDevices(): MutableList<BluetoothDevice!>!
Get connected devices for this specific profile.
Return the set of devices which are in state STATE_CONNECTED
| Return | |
|---|---|
MutableList<BluetoothDevice!>! | 
            List of devices. The list will be empty on error. | 
getConnectionState
abstract fun getConnectionState(device: BluetoothDevice!): Int
Get the current connection state of the profile
| Parameters | |
|---|---|
device | 
            BluetoothDevice!: Remote bluetooth device. | 
| Return | |
|---|---|
Int | 
            State of the profile connection. One of STATE_CONNECTED, STATE_CONNECTING, STATE_DISCONNECTED, STATE_DISCONNECTING Value is android.bluetooth.BluetoothProfile#STATE_DISCONNECTED, android.bluetooth.BluetoothProfile#STATE_CONNECTING, android.bluetooth.BluetoothProfile#STATE_CONNECTED, or android.bluetooth.BluetoothProfile#STATE_DISCONNECTING | 
          
getDevicesMatchingConnectionStates
abstract fun getDevicesMatchingConnectionStates(states: IntArray!): MutableList<BluetoothDevice!>!
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.
| Parameters | |
|---|---|
states | 
            IntArray!: Array of states. States can be one of STATE_CONNECTED, STATE_CONNECTING, STATE_DISCONNECTED, STATE_DISCONNECTING, | 
          
| Return | |
|---|---|
MutableList<BluetoothDevice!>! | 
            List of devices. The list will be empty on error. |