diff --git a/src/android/BluetoothLePlugin.java b/src/android/BluetoothLePlugin.java index 0d8048c..d8dc271 100644 --- a/src/android/BluetoothLePlugin.java +++ b/src/android/BluetoothLePlugin.java @@ -4018,15 +4018,6 @@ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState return; } - //Check for queued operations in progress on this device - if (newState == BluetoothProfile.STATE_DISCONNECTED) { - LinkedList queue = (LinkedList) connection.get(keyQueue); - Operation operation = queue.peek(); - if (operation != null) { - queueRemove(connection); - } - } - CallbackContext callbackContext = (CallbackContext) connection.get(operationConnect); JSONObject returnObj = new JSONObject(); @@ -4040,6 +4031,9 @@ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState connection.put(keyPeripheral, gatt); connection.put(keyState, BluetoothProfile.STATE_DISCONNECTED); connection.put(keyDiscoveredState, STATE_UNDISCOVERED); + + LinkedList queue = new LinkedList(); + connection.put(keyQueue, queue); connections.put(device.getAddress(), connection);