I am using this code to get notified whenever a bluetooth device is connected or disconnected, however, it does not check whether the bluetooth device is connected as an audio device or not
// ... IntentFilter filter1 = new IntentFilter( BluetoothDevice.ACTION_ACL_CONNECTED); IntentFilter filter2 = new IntentFilter( BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED); IntentFilter filter3 = new IntentFilter( BluetoothDevice.ACTION_ACL_DISCONNECTED); this.registerReceiver(BTReceiver, filter1); this.registerReceiver(BTReceiver, filter2); this.registerReceiver(BTReceiver, filter3); } // The BroadcastReceiver that listens for bluetooth broadcasts private final BroadcastReceiver BTReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) { // Do something if connected Toast.makeText(getApplicationContext(), "BT Connected", Toast.LENGTH_SHORT).show(); } else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) { // Do something if disconnected Toast.makeText(getApplicationContext(), "BT Disconnected", Toast.LENGTH_SHORT).show(); } // else if... } }; how do i detect A2DP, btA2dp audio devices?