From 4b5cf4856064efbc018c0f2b4d6d3ff199403ee0 Mon Sep 17 00:00:00 2001 From: Stanley Tng Date: Fri, 13 Apr 2018 14:54:10 -0700 Subject: [PATCH] Clarify API doc for BluetoothGattServer::addService Clarify that the caller has to wait for onServiceAdded callback before calling BluetoothGattServer::addService again. Bug: 72717069 Test: Compile Change-Id: I20b031c724ba64bfd71cf10e58e587f69e4a2555 --- core/java/android/bluetooth/BluetoothGattServer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/java/android/bluetooth/BluetoothGattServer.java b/core/java/android/bluetooth/BluetoothGattServer.java index 4ed250043ae96..ef1b0bd718854 100644 --- a/core/java/android/bluetooth/BluetoothGattServer.java +++ b/core/java/android/bluetooth/BluetoothGattServer.java @@ -701,10 +701,14 @@ public final class BluetoothGattServer implements BluetoothProfile { *

If the local device has already exposed services when this function * is called, a service update notification will be sent to all clients. * + *

The {@link BluetoothGattServerCallback#onServiceAdded} callback will indicate + * whether this service has been added successfully. Do not add another service + * before this callback. + * *

Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param service Service to be added to the list of services provided by this device. - * @return true, if the service has been added successfully + * @return true, if the request to add service has been initiated */ public boolean addService(BluetoothGattService service) { if (DBG) Log.d(TAG, "addService() - service: " + service.getUuid());