Starting in Android 16, the Android framework includes a Generic Attribute (GATT) service called Android information service (AIS), which lets Bluetooth devices read the Android API level as a GATT characteristic of the service. This service lets Bluetooth device manufacturers know whether a Bluetooth peripheral is pairing with a central device that is running the Android OS, and manage specialized logic based on the API level.
Android information service (AIS)
The AIS is a standard GATT service and there can be only one instance of AIS on
a device. The primary service UUID is e73e0001-ef1b-4e74-8291-2e4f3164f3b5
.
The Android API level characteristic (UUID:
e73e0002-ef1b-4e74-8291-2e4f3164f3b5
) contains the API level of the device as
an unsigned 32-bit integer in binary form (little-endian). The value of the
Android API level characteristic is 4 octets in length (for example, API
level 36 is 0x24_00_00_00
). When the device is discoverable, the Android API
level characteristic value is readable without authentication or authorization.
When the device isn't discoverable, the Android API level characteristic is
readable only with authentication and authorization.
Discover the service
The Bluetooth device is on the GATT client role and the Android device is on the server role. To discover AIS and read the Android API level, Bluetooth devices use GATT profile procedures such as the primary service discovery, characteristic discovery and characteristic value read procedures. For details on these procedures, see the GATT profile specification.
The API level is defined by the ro.build.version.sdk
system property. If the
primary service can't be discovered, it means that the system property isn't
defined or the value is set to empty, or the host operation system isn't
Android.
Validation
To verify that AIS can be discovered, run a manual test by pairing a Bluetooth peripheral with an Android device, and then looking up the AIS service UUID in the discovered primary services.