27 Mart 2025'ten itibaren AOSP'yi derlemek ve AOSP'ye katkıda bulunmak için aosp-main
yerine android-latest-release
kullanmanızı öneririz. Daha fazla bilgi için AOSP'de yapılan değişiklikler başlıklı makaleyi inceleyin.
Android OS tanımlama
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
keywords: AiAssisted,release16,androidconnectivity,bluetooth,category:AndroidConnectivity,docType:Guide
Android 14'ten itibaren Android çerçevesi, Bluetooth cihazların Android API düzeyini hizmetin bir GATT özelliği olarak okumasına olanak tanıyan Android bilgi hizmeti (AIS) adlı bir Genel Özellik (GATT) hizmeti içerir.
Bu hizmet, Bluetooth cihaz üreticilerinin bir Bluetooth çevre biriminin Android OS çalıştıran bir merkezi cihazla eşleştirilip eşleştirilmediğini bilmesini sağlar ve API düzeyine göre özel mantığı yönetir.
AIS, standart bir GATT hizmetidir ve bir cihazda yalnızca bir AIS örneği olabilir. Birincil hizmet UUID'si e73e0001-ef1b-4e74-8291-2e4f3164f3b5
.
Android API düzeyi özelliği (UUID:
e73e0002-ef1b-4e74-8291-2e4f3164f3b5
), cihazın API düzeyini ikili biçimde (little-endian) işaretsiz 32 bit tam sayı olarak içerir. Android API düzeyi özelliğinin değeri 4 sekizli uzunluğundadır (örneğin, API düzeyi 36 0x24_00_00_00
'dır). Cihaz bulunabilir olduğunda Android API düzeyi özellik değeri, kimlik doğrulama veya yetkilendirme olmadan okunabilir.
Cihaz bulunamadığında Android API düzeyi özelliği yalnızca kimlik doğrulama ve yetkilendirme ile okunabilir.
Hizmeti keşfetme
Bluetooth cihazı GATT istemci rolünde, Android destekli cihaz ise sunucu rolünde olmalıdır. AIS'yi keşfetmek ve Android API düzeyini okumak için Bluetooth cihazlar, birincil hizmet keşfi, özellik keşfi ve özellik değeri okuma gibi GATT profili prosedürlerini kullanır. Bu prosedürlerle ilgili ayrıntılar için GATT profil spesifikasyonuna bakın.
API düzeyi, ro.build.version.sdk
sistem özelliğiyle tanımlanır. Birincil hizmet bulunamıyorsa sistem özelliği tanımlanmamış, değer boş olarak ayarlanmış veya ana makine işletim sistemi Android değil demektir.
Doğrulama
AIS'nin bulunabildiğini doğrulamak için Bluetooth çevre birimini Android destekli bir cihazla eşleyerek manuel bir test çalıştırın ve ardından bulunan birincil hizmetlerde AIS hizmeti UUID'sini arayın.
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-22 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-22 UTC."],[],[],null,["# Android OS identification\n\nkeywords: AiAssisted,release16,androidconnectivity,bluetooth,category:AndroidConnectivity,docType:Guide\n\nStarting in Android 14, the Android framework includes a Generic Attribute\n(GATT) service called Android information service (AIS), which lets Bluetooth\ndevices read the Android API level as a GATT characteristic of the service.\nThis service lets Bluetooth device manufacturers know whether a Bluetooth\nperipheral is pairing with a central device that is running the Android OS,\nand manage specialized logic based on the API level.\n\nAndroid information service (AIS)\n---------------------------------\n\nAIS is a standard GATT service and there can be only one instance of AIS on\na device. The primary service UUID is `e73e0001-ef1b-4e74-8291-2e4f3164f3b5`.\nThe Android API level characteristic (UUID:\n`e73e0002-ef1b-4e74-8291-2e4f3164f3b5`) contains the API level of the device as\nan unsigned 32-bit integer in binary form (little-endian). The value of the\nAndroid API level characteristic is 4 octets in length (for example, API\nlevel 36 is `0x24_00_00_00`). When the device is discoverable, the Android API\nlevel characteristic value is readable without authentication or authorization.\nWhen the device isn't discoverable, the Android API level characteristic is\nreadable only with authentication and authorization.\n\nDiscover the service\n--------------------\n\nThe Bluetooth device is on the GATT client role and the Android-powered device\nis on the server role. To discover AIS and read the Android API level, Bluetooth\ndevices use GATT profile procedures such as the *primary service discovery* ,\n*characteristic discovery* , and *characteristic value read* procedures. For\ndetails on these procedures, see the [GATT profile specification](https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-54/out/en/host/generic-attribute-profile--gatt-.html).\n\nThe API level is defined by the `ro.build.version.sdk` system property. If the\nprimary service can't be discovered, it means that the system property isn't\ndefined or the value is set to empty, or the host operation system isn't\nAndroid.\n\nValidation\n----------\n\nTo verify that AIS can be discovered, run a manual test by pairing a Bluetooth\nperipheral with an Android-powered device, and then looking up the AIS service\nUUID in the discovered primary services."]]