Im trying to check if there is a bluetooth headset connected to the device or not
BluetoothAdapter mAdapter;
mAdapter = BluetoothAdapter.getDefaultAdapter();
Log.d("TAG","HEADSET: " + mAdapter.getProfileConnectionState(BluetoothProfile.HEADSET));
Log.d("TAG","HEALTH: " + mAdapter.getProfileConnectionState(BluetoothProfile.HEALTH));
Log.d("TAG","A2DP: " + mAdapter.getProfileConnectionState(BluetoothProfile.A2DP));
This is always returning HEADSET 2 (Connected), Health 0 (disconnected) and A2DP 0 (Disconnected). It doesnt matter if I have a bluetooth headset connected or not, headset connection state is 0 only when bluetooth is disabled