I have a broadcast receiver in my app that logs every connection of a BT device by tracking the android.bluetooth.device.action.ACL_CONNECTED
broadcast. But I need to know if the BT device isa headset, and more importantly, if it's an SCO or an A2DP headse开发者_高级运维t. I can find out what services the connected device supports using BluetoothClass.Service, but I don't know which services are supposed to correspong to each type of headset. Here are the ones listed:
AUDIO
CAPTURE
INFORMATION
LIMITED_DISCOVERABILITY
NETWORKING
OBJECT_TRANSFER
POSITIONING
RENDER
TELEPHONY
Can anyone tell me which of these determiny the headset profile type (headset, hands-free, or A2DP?
You can use BluetoothProfile.ServiceListener and listen for onServiceConnetced and you will get notifications for A2DP or SCO connected. See here
精彩评论