private void emptyTasks(final int status) {
		final BluetoothDevice oldBluetoothDevice = bluetoothDevice;
		if (initQueue != null) {
			for (final Request task : initQueue) {
				if (oldBluetoothDevice != null)
					task.notifyFail(oldBluetoothDevice, status);
				else
					task.notifyInvalidRequest();
			}
			initQueue = null;
		}
		for (final Request task : taskQueue) {
			if (oldBluetoothDevice != null) {
				if (status == FailCallback.REASON_BLUETOOTH_DISABLED ||
						task.characteristic != null ||
						task.descriptor != null) {
					task.notifyFail(oldBluetoothDevice, status);
				} else {
					task.notifyFail(oldBluetoothDevice, FailCallback.REASON_CANCELLED);
				}
			} else {
				task.notifyInvalidRequest();
			}
		}
		taskQueue.clear();
	}
This method clears the task queues and notifies removed requests of cancellation.
@param status the reason of cancellation.
ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java