summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-27 09:24:33 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-27 09:24:33 +0200
commit55162f53d4b71ebf6b0891006a18a0815908380a (patch)
tree1216b388aede1ffaf67208bce794d3fb435ceb9f /src
parent35fe7d452d5b85eabe1c3ec9d09019fe4f3e2d2e (diff)
parent0de627e44fc74c6fbacf64b40a01408d1114907e (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15.0
Diffstat (limited to 'src')
-rw-r--r--src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java33
-rw-r--r--src/bluetooth/qlowenergycontroller_winrt.cpp1
-rw-r--r--src/nfc/doc/src/nfc-overview.qdoc15
3 files changed, 30 insertions, 19 deletions
diff --git a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java
index 3e602186..e9717a1d 100644
--- a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java
+++ b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java
@@ -296,7 +296,7 @@ public class QtBluetoothLE {
//unlock the queue for next item
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
performNextIO();
@@ -309,7 +309,7 @@ public class QtBluetoothLE {
if (requestTimedOut) {
Log.w(TAG, "Late char read reply after timeout was hit for handle " + foundHandle);
// Timeout has hit before this response -> ignore the response
- // no need to unlock ioJobPending -> the timeout has done that already
+ // no need to unlock pendingJob -> the timeout has done that already
return;
}
@@ -349,7 +349,7 @@ public class QtBluetoothLE {
//unlock the queue for next item
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
performNextIO();
@@ -373,7 +373,7 @@ public class QtBluetoothLE {
if (requestTimedOut) {
Log.w(TAG, "Late char write reply after timeout was hit for handle " + handle);
// Timeout has hit before this response -> ignore the response
- // no need to unlock ioJobPending -> the timeout has done that already
+ // no need to unlock pendingJob -> the timeout has done that already
return;
}
@@ -386,9 +386,10 @@ public class QtBluetoothLE {
errorCode = 2; break; // CharacteristicWriteError
}
- byte[] value = pendingJob.newValue;
+ byte[] value;
synchronized (readWriteQueue) {
- ioJobPending = false;
+ value = pendingJob.newValue;
+ pendingJob = null;
}
leCharacteristicWritten(qtObject, handle+1, value, errorCode);
performNextIO();
@@ -419,7 +420,7 @@ public class QtBluetoothLE {
//unlock the queue for next item
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
performNextIO();
return;
@@ -432,7 +433,7 @@ public class QtBluetoothLE {
Log.w(TAG, "Late descriptor read reply after timeout was hit for handle " +
foundHandle);
// Timeout has hit before this response -> ignore the response
- // no need to unlock ioJobPending -> the timeout has done that already
+ // no need to unlock pendingJob -> the timeout has done that already
return;
}
@@ -491,7 +492,7 @@ public class QtBluetoothLE {
//unlock the queue for next item
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
performNextIO();
@@ -512,7 +513,7 @@ public class QtBluetoothLE {
Log.w(TAG, "Late descriptor write reply after timeout was hit for handle " +
handle);
// Timeout has hit before this response -> ignore the response
- // no need to unlock ioJobPending -> the timeout has done that already
+ // no need to unlock pendingJob -> the timeout has done that already
return;
}
@@ -526,7 +527,7 @@ public class QtBluetoothLE {
}
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
leDescriptorWritten(qtObject, handle+1, descriptor.getValue(), errorCode);
@@ -559,12 +560,12 @@ public class QtBluetoothLE {
if (requestTimedOut) {
Log.w(TAG, "Late mtu reply after timeout was hit");
// Timeout has hit before this response -> ignore the response
- // no need to unlock ioJobPending -> the timeout has done that already
+ // no need to unlock pendingJob -> the timeout has done that already
return;
}
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
performNextIO();
@@ -724,7 +725,6 @@ public class QtBluetoothLE {
private final LinkedList<ReadWriteJob> readWriteQueue = new LinkedList<ReadWriteJob>();
- private boolean ioJobPending;
private ReadWriteJob pendingJob;
/*
@@ -1247,7 +1247,7 @@ public class QtBluetoothLE {
{
//unlock the queue for next item
synchronized (readWriteQueue) {
- ioJobPending = false;
+ pendingJob = null;
}
performNextIOThreaded();
@@ -1308,7 +1308,7 @@ public class QtBluetoothLE {
int handle = HANDLE_FOR_RESET;
synchronized (readWriteQueue) {
- if (readWriteQueue.isEmpty() || ioJobPending)
+ if (readWriteQueue.isEmpty() || pendingJob != null)
return;
nextJob = readWriteQueue.remove();
@@ -1352,7 +1352,6 @@ public class QtBluetoothLE {
if (skip) {
handleForTimeout.set(HANDLE_FOR_RESET); // not a pending call -> release atomic
} else {
- ioJobPending = true;
pendingJob = nextJob;
timeoutHandler.postDelayed(new TimeoutRunnable(
modifiedReadWriteHandle(handle, nextJob.jobType)), RUNNABLE_TIMEOUT);
diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp
index ab566bd9..abe3392a 100644
--- a/src/bluetooth/qlowenergycontroller_winrt.cpp
+++ b/src/bluetooth/qlowenergycontroller_winrt.cpp
@@ -282,6 +282,7 @@ void QLowEnergyControllerPrivateWinRT::connectToDevice()
qCDebug(QT_BT_WINRT) << "Could not find LE device";
setError(QLowEnergyController::InvalidBluetoothAdapterError);
setState(QLowEnergyController::UnconnectedState);
+ return;
}
BluetoothConnectionStatus status;
hr = mDevice->get_ConnectionStatus(&status);
diff --git a/src/nfc/doc/src/nfc-overview.qdoc b/src/nfc/doc/src/nfc-overview.qdoc
index 6ac5c1dc..cb10b400 100644
--- a/src/nfc/doc/src/nfc-overview.qdoc
+++ b/src/nfc/doc/src/nfc-overview.qdoc
@@ -45,8 +45,19 @@ With the Qt NFC API typical use cases are:
The following sections describe how to use Qt NFC C++ classes and QML types for the above use cases.
-\note On Android, Qt Nfc only works in foreground applications. Android services are not supported which is due to
-API limitations on the Android side.
+\note On Android, the detection of new NFC tags only works in foreground applications. Android
+services do not support this because of API limitations on the Android side. The only way to use a
+\l{https://developer.android.com/reference/android/nfc/Tag}{Tag} in a service is to provide an
+\l{https://developer.android.com/guide/components/aidl}{AIDL} interface accepting the Tag and forward
+it to Qt as shown in the following example.
+
+\code
+ public void setTag(Tag pTag) {
+ Intent newIntent = new Intent();
+ newIntent.putExtra(NfcAdapter.EXTRA_TAG, pTag);
+ QtNative.onNewIntent(newIntent);
+ }
+\ endcode
\section1 C++ Overview