Bluetooth services

Over Bluetooth, devices can transmit data that can be used for interactive services such as audio, messaging, and telephony. You can find the Bluetooth profiles used for different services in include/hardware/bluetooth.h.

Audio

A Bluetooth connection lets users stream audio on Bluetooth-enabled devices. For most audio use cases, the Android-powered device is the source, and the rendering device, such as a speaker or a headset, is the sink.

Absolute volume control

In Android 6.0 and higher, the Android Bluetooth stack lets a source set an absolute volume, giving users accurate control over audio volume. The source device sends un-attenuated audio and volume information to the sink. The sink then amplifies the audio according to the volume information, so users hear accurate playback volume.

The source device can also register volume notifications. When volume changes are made with controls on the sink, the sink sends a notification to the source. This lets the source accurately display volume information on a user interface.

Absolute volume control is on by default. A user can disable absolute volume control in Settings > System > Developer options by clicking the Disable absolute volume toggle to the on position.

Advanced audio codecs

In Android 8.0, devices that use the Advanced Audio Distribution Profile (A2DP) can support additional audio codecs. The Bluetooth stack supports audio codec negotiation for when devices connect to a remote audio sink. This negotiation selects the best codec supported by both the sender and the sink to provide high-quality audio. After selection, the device routes all audio through the selected encoder and then sends it to the sink.

Implementation

Devices running Android 8.0 that support A2DP automatically gain the additional codec support. Device manufacturers might need to obtain separate licenses and binary blobs for some proprietary audio codecs. In addition to SBC, Android 8.0 supports the following codecs:

  • AAC
  • aptX
  • aptX HD
  • LDAC

Device manufacturers can choose which codecs their devices attempt to use first. Set the codec priorities by changing the following values in res/values/config.xml:

  <!-- 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>
      

LDAC certification

The Android Open Source Project (AOSP) includes an encoder for Sony's LDAC codec, so a separate license or blob from Sony isn't needed for it. To integrate the LDAC codec into your device, register with Sony and follow the LDAC certification process.

The LDAC certification website has documentation about LDAC, such as specification and operation handbooks. The LDAC site also provides validation and interoperability tests for mobile and tablet devices. Send passing test results to Sony to complete LDAC certification.

UI features

Along with additional codec support, Android 8.0 provides a user-facing setting to disable high-definition (HD) Bluetooth audio codecs. A user can disable HD codecs by navigating to Settings > Connected devices > Bluetooth, tapping the gear icon next to the sink, and clearing the HD Audio checkbox.

Device manufacturers that customize Settings should implement a way for users to disable HD codecs.

Messaging

Messaging over Bluetooth lets users read, browse, and compose SMS messages from a remote device. Users often use this capability when connecting a phone to an in-vehicle infotainment system.

Telephony

Bluetooth telephony services let users stream calls and sync contacts from a phone to another Bluetooth device. Users often use these features for hands-free calls when driving.

In Android 8.0, Bluetooth supports in-band ringtone. When a phone connected over Bluetooth receives an incoming call, the ringtone plays on the sink. Enable in-band ringtone in Settings > System > Developer options by clicking the Enable in-band ringing toggle to the on position.

Bluetooth features

To implement the Bluetooth services, the Bluetooth stack supports a variety of profiles and features.

Bluetooth profiles

These profiles are available for Bluetooth:

Feature Android version
Name Description 6.0 7.0 7.1 7.1.2 8.0
SAP SIM Access Profile 1.1 1.1 1.1 1.1 1.1
MAP Message Access Profile for SMS 1.2 1.2 1.2 1.2 1.2
OPP Object Push Profile 1.1 1.1 1.1 1.1 1.2
OBEX over L2CAP OBject EXchange over Logical Link Control and Adaptation Protocol Yes Yes Yes Yes Yes
HFP Audio Gateway Hands-Free Profile 1.6 1.6 1.7 1.7 1.7
HSP Headset profile 1.2 1.2 1.2 1.2 1.2
A2DP Advanced Audio Distribution Profile 1.2 1.2 1.2 1.2 1.2
AVRCP Audio/Video Remote Control Profile 1.3 1.3 1.3 1.3 1.4
HID Human Interface Device Profile 1.0 1.0 1.0 1.0 1.0
PBAP Phone Book Access Profile 1.1.1 1.1.1 1.1.1 1.1.1 1.2
HDP Health Device Profile 1.0 1.0 1.1 1.1 1.1
SPP Serial Port Profile 1.2 1.2 1.2 1.2 1.2
PAN / BNEP Personal Area Networking Profile / Bluetooth Network Encapsulation Protocol 1.0 1.0 1.0 1.0 1.0
DIP Device ID Profile 1.3 1.3 1.3 1.3 1.3
HOGP 1.0 HID over GATT Yes Yes Yes Yes Yes
HD Audio See Advanced audio codecs. Implementation depends on device capabilities, both on the source and the sink. No No No No Yes

Bluetooth Low Energy features

These features are available for BLE:

Feature Android version
Name 6.0 7.0 7.1 7.1.2 8.0
BR/EDR secure connections 4.1 4.1 4.1 4.1 5.0
LE privacy 4.2 4.2 4.2 4.2 5.0
LE secure connections 4.2 4.2 4.2 4.2 5.0
Data packet extensions 4.2 4.2 4.2 4.2 5.0
32-bit UUIDs Yes Yes Yes Yes Yes
Dual mode LE central/peripheral Yes Yes Yes Yes Yes
LE peripheral mode Yes Yes Yes Yes Yes
Google HCI requirements Yes Yes Yes Yes Yes
LE connection-oriented channels No No No No No