<!-- Configuring priorities of A2DP source codecs. Larger value means
higher priority. Value -1 means the codec is disabled.
Value 0 is reserved and should not be used here. Enabled codecs
should have priorities in the interval [1, 999999], and each
priority value should be unique. -->
<integer name="a2dp_source_codec_priority_sbc">1001</integer>
<integer name="a2dp_source_codec_priority_aac">2001</integer>
<integer name="a2dp_source_codec_priority_aptx">3001</integer>
<integer name="a2dp_source_codec_priority_aptx_hd">4001</integer>
<integer name="a2dp_source_codec_priority_ldac">5001</integer>
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Bluetooth services\n\nOver Bluetooth, devices can transmit data that can be used for\ninteractive services such as audio, messaging, and telephony. You can\nfind the Bluetooth profiles used for different services in\n[include/hardware/bluetooth.h](https://android.googlesource.com/platform/system/bt/+/android16-release/include/hardware/bluetooth.h).\n\nAudio\n-----\n\n| **Note:** Only Classic Bluetooth supports any type of audio streaming.\n\n\nA Bluetooth connection lets users stream audio on Bluetooth-enabled\ndevices. For most audio use cases, the Android-powered device is the source,\nand the rendering device, such as a speaker or a headset, is the sink.\n\n### Absolute volume control\n\n\nIn Android 6.0 and higher, the Android Bluetooth stack lets a\nsource set an absolute volume, giving users accurate control over\naudio volume. The source device sends un-attenuated audio and volume\ninformation to the sink. The sink then amplifies the audio according\nto the volume information, so users hear accurate playback volume.\n\n\nThe source device can also register volume notifications. When\nvolume changes are made with controls on the sink, the sink sends a\nnotification to the source. This lets the source accurately display\nvolume information on a user interface.\n\n\nAbsolute volume control is on by default. A user can disable absolute\nvolume control in **Settings** \\\u003e\n**System** \\\u003e **Developer options**\nby clicking the **Disable absolute volume** toggle to the on position.\n\n### Advanced audio codecs\n\n\nIn Android 8.0, devices that use the Advanced Audio Distribution\nProfile (A2DP) can support additional audio codecs. The Bluetooth\nstack supports audio codec negotiation for when devices connect to\na remote audio sink. This negotiation selects the best codec\nsupported by both the sender and the sink to provide high-quality\naudio. After selection, the device routes all audio through the selected\nencoder and then sends it to the sink.\n\n#### Implementation\n\n\nDevices running Android 8.0 that support A2DP automatically\ngain the additional codec support. Device manufacturers might need\nto obtain separate licenses and binary blobs for some\nproprietary audio codecs. In addition to SBC, Android 8.0\nsupports the following codecs:\n\n- AAC\n- aptX\n- aptX HD\n- LDAC\n\n\nDevice manufacturers can choose which codecs their devices\nattempt to use first. Set the codec priorities by changing the\nfollowing values in [res/values/config.xml](https://android.googlesource.com/platform/packages/apps/Bluetooth/+/android16-release/res/values/config.xml): \n\n```scdoc\n \u003c!-- Configuring priorities of A2DP source codecs. Larger value means\n higher priority. Value -1 means the codec is disabled.\n Value 0 is reserved and should not be used here. Enabled codecs\n should have priorities in the interval [1, 999999], and each\n priority value should be unique. --\u003e\n \u003cinteger name=\"a2dp_source_codec_priority_sbc\"\u003e1001\u003c/integer\u003e\n \u003cinteger name=\"a2dp_source_codec_priority_aac\"\u003e2001\u003c/integer\u003e\n \u003cinteger name=\"a2dp_source_codec_priority_aptx\"\u003e3001\u003c/integer\u003e\n \u003cinteger name=\"a2dp_source_codec_priority_aptx_hd\"\u003e4001\u003c/integer\u003e\n \u003cinteger name=\"a2dp_source_codec_priority_ldac\"\u003e5001\u003c/integer\u003e\n \n```\n\n#### LDAC certification\n\n\nThe Android Open Source Project (AOSP) includes an encoder for Sony's LDAC codec, so a\nseparate license or blob from Sony isn't needed for it. To integrate the\nLDAC codec into your device, register with Sony and follow the\n[LDAC certification process](https://www.sony.net/Products/LDAC/aosp/).\n\n\nThe LDAC certification website has documentation about LDAC,\nsuch as specification and operation handbooks. The LDAC site also\nprovides validation and interoperability tests for mobile and\ntablet devices. Send passing test results to Sony to complete LDAC\ncertification.\n\n#### UI features\n\n\nAlong with additional codec support, Android 8.0 provides a\nuser-facing setting to disable high-definition (HD) Bluetooth\naudio codecs. A user can disable HD codecs by navigating to\n**Settings** \\\u003e **Connected devices** \\\u003e\n**Bluetooth** , tapping the gear icon next to the sink,\nand clearing the **HD Audio** checkbox.\n\n\nDevice manufacturers that customize Settings should implement a\nway for users to disable HD codecs.\n\nMessaging\n---------\n\n\nMessaging over Bluetooth lets users read, browse, and compose SMS\nmessages from a remote device. Users often use this capability when\nconnecting a phone to an in-vehicle infotainment system.\n| **Note:** Bluetooth messaging services support only SMS. Email and instant messages aren't supported.\n\nTelephony\n---------\n\n\nBluetooth telephony services let users stream calls and sync\ncontacts from a phone to another Bluetooth device. Users often use these\nfeatures for hands-free calls when driving.\n\n\nIn Android 8.0, Bluetooth supports in-band ringtone. When a phone\nconnected over Bluetooth receives an incoming call, the ringtone\nplays on the sink. Enable in-band ringtone in **Settings**\n\\\u003e **System** \\\u003e **Developer options** by\nclicking the **Enable in-band ringing** toggle to the on position.\n\nBluetooth features\n------------------\n\nTo implement the Bluetooth services, the Bluetooth stack supports a\nvariety of profiles and features.\n\n### Bluetooth profiles\n\n\nThese profiles are available for Bluetooth:\n\n| Feature || Android version |||||\n| Name | Description | 6.0 | 7.0 | 7.1 | 7.1.2 | 8.0 |\n| SAP | SIM Access Profile | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |\n| MAP | Message Access Profile for SMS | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |\n| OPP | Object Push Profile | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 |\n| OBEX over L2CAP | OBject EXchange over Logical Link Control and Adaptation Protocol | Yes | Yes | Yes | Yes | Yes |\n| HFP Audio Gateway | Hands-Free Profile | 1.6 | 1.6 | 1.7 | 1.7 | 1.7 |\n| HSP | Headset profile | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |\n| A2DP | Advanced Audio Distribution Profile | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |\n| AVRCP | Audio/Video Remote Control Profile | 1.3 | 1.3 | 1.3 | 1.3 | 1.4 |\n| HID | Human Interface Device Profile | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |\n| PBAP | Phone Book Access Profile | 1.1.1 | 1.1.1 | 1.1.1 | 1.1.1 | 1.2 |\n| HDP | Health Device Profile | 1.0 | 1.0 | 1.1 | 1.1 | 1.1 |\n| SPP | Serial Port Profile | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |\n| PAN / BNEP | Personal Area Networking Profile / Bluetooth Network Encapsulation Protocol | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |\n| DIP | Device ID Profile | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |\n| HOGP 1.0 | HID over GATT | Yes | Yes | Yes | Yes | Yes |\n| HD Audio | See [Advanced audio codecs](#advanced-audio-codecs). Implementation depends on device capabilities, both on the source and the sink. | No | No | No | No | Yes |\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------|-------|-------|-------|-------|-----|\n\n### Bluetooth Low Energy features\n\n\nThese features are available for BLE:\n\n| Feature | Android version |||||\n| Name | 6.0 | 7.0 | 7.1 | 7.1.2 | 8.0 |\n| BR/EDR secure connections | 4.1 | 4.1 | 4.1 | 4.1 | 5.0 |\n| LE privacy | 4.2 | 4.2 | 4.2 | 4.2 | 5.0 |\n| LE secure connections | 4.2 | 4.2 | 4.2 | 4.2 | 5.0 |\n| Data packet extensions | 4.2 | 4.2 | 4.2 | 4.2 | 5.0 |\n| 32-bit UUIDs | Yes | Yes | Yes | Yes | Yes |\n| Dual mode LE central/peripheral | Yes | Yes | Yes | Yes | Yes |\n| LE peripheral mode | Yes | Yes | Yes | Yes | Yes |\n| Google HCI requirements | Yes | Yes | Yes | Yes | Yes |\n| LE connection-oriented channels | No | No | No | No | No |\n|---------------------------------|-----|-----|-----|-------|-----|"]]