From: Pawel Wasowski
Date: Fri, 2 Oct 2020 16:28:27 +0000 (+0200)
Subject: [Bluetooth][bugfix] Call success callbacks in registerService()
X-Git-Tag: submit/tizen/20201005.050422^0
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F245140%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Bluetooth][bugfix] Call success callbacks in registerService()
registerService() used to call successCallback only when registered
service had at least 1 component with read/write value request callback.
Now, the function will call successCallback even, if the service
has no components with such read/write value request calbacks.
[Verification] registerService() calls successCallback when no
read/write value request callbacks are registered
Change-Id: I4f4af260179fb21ac785dc1ccb0f5dab6d986496
Signed-off-by: Pawel Wasowski
---
diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js
index 26ad9474..826cbb9e 100755
--- a/src/bluetooth/bluetooth_api.js
+++ b/src/bluetooth/bluetooth_api.js
@@ -2176,6 +2176,12 @@ function _registerReadWriteValueRequestCallbacksInGATTService(
errorCallback
) {
var count = _countCallbackToRegisterInService(service);
+
+ if (count === 0) {
+ successCallback();
+ return;
+ }
+
var callbacksAggregator = new ResultCallbacksAggregator(
count,
function onAllSucceeded() {