From c127487afb8ed75e5225cc29190cd53ec8b49214 Mon Sep 17 00:00:00 2001
From: Pawel Wasowski
Date: Tue, 1 Dec 2020 11:30:10 +0200
Subject: [PATCH] [Bluetooth] Prevent "Wrong listener identifier" errors for
BLE scan
The following app code caused aforementioned errors:
var adapter = tizen.bluetooth.getLEAdapter();
adapter.startScan();
setTimeout(function() {
adapter.stopScan();
}, 10000);
Now, the error is not thrown.
[Validation] tct-bluetooth-tizen-tests: auto: 100% pass rate,
manual Bluetooth04_BLE_wearable suite: 100% pass rate
The code above runs in ChromeDevTools without errors
Change-Id: Id9ec278b4bb1c5ce38d0b3ffb1324498152ab645
Signed-off-by: Pawel Wasowski
---
src/bluetooth/bluetooth_api.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js
index 984fb77..1869e14 100755
--- a/src/bluetooth/bluetooth_api.js
+++ b/src/bluetooth/bluetooth_api.js
@@ -1514,12 +1514,12 @@ BluetoothLEAdapter.prototype.startScan = function() {
BluetoothLEAdapter.prototype.stopScan = function() {
privUtils_.log('Entered BluetoothLEAdapter.stopScan()');
- _bleScanListener.removeListener();
-
var result = native.callSync('BluetoothLEAdapter_stopScan', {});
if (native.isFailure(result)) {
throw native.getErrorObject(result);
}
+
+ _bleScanListener.removeListener();
};
var _BluetoothAdvertisePacketType = {
--
2.7.4