diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | dist/changes-5.12.10 | 28 | ||||
-rw-r--r-- | dist/changes-5.12.6 | 20 | ||||
-rw-r--r-- | dist/changes-5.12.7 | 20 | ||||
-rw-r--r-- | dist/changes-5.12.8 | 20 | ||||
-rw-r--r-- | dist/changes-5.12.9 | 20 | ||||
-rw-r--r-- | src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java | 11 | ||||
-rw-r--r-- | src/bluetooth/bluetooth.pro | 1 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp | 62 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_winrt.cpp | 1 | ||||
-rw-r--r-- | src/nfc/qnearfieldtarget.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp | 19 |
12 files changed, 185 insertions, 20 deletions
diff --git a/.qmake.conf b/.qmake.conf index 2e1d6b7f..912747cb 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.12.6 +MODULE_VERSION = 5.12.12 diff --git a/dist/changes-5.12.10 b/dist/changes-5.12.10 new file mode 100644 index 00000000..c9b97b2a --- /dev/null +++ b/dist/changes-5.12.10 @@ -0,0 +1,28 @@ +Qt 5.12.10 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.9. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + https://doc.qt.io/qt-5.12/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + +**************************************************************************** +* Library * +**************************************************************************** + + diff --git a/dist/changes-5.12.6 b/dist/changes-5.12.6 new file mode 100644 index 00000000..ad5098e3 --- /dev/null +++ b/dist/changes-5.12.6 @@ -0,0 +1,20 @@ +Qt 5.12.6 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.5. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. diff --git a/dist/changes-5.12.7 b/dist/changes-5.12.7 new file mode 100644 index 00000000..c9716139 --- /dev/null +++ b/dist/changes-5.12.7 @@ -0,0 +1,20 @@ +Qt 5.12.7 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.6. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. diff --git a/dist/changes-5.12.8 b/dist/changes-5.12.8 new file mode 100644 index 00000000..729d7404 --- /dev/null +++ b/dist/changes-5.12.8 @@ -0,0 +1,20 @@ +Qt 5.12.8 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.7. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. diff --git a/dist/changes-5.12.9 b/dist/changes-5.12.9 new file mode 100644 index 00000000..d3d50ba6 --- /dev/null +++ b/dist/changes-5.12.9 @@ -0,0 +1,20 @@ +Qt 5.12.9 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.8. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. 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 6c548f84..5e8bf484 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 @@ -403,8 +403,15 @@ public class QtBluetoothLE { descriptor.getUuid().toString(), descriptor.getValue()); } else { if (isServiceDiscoveryRun) { - //ignore - Log.w(TAG, "onDescriptorcRead during discovery error: " + status); + // Cannot read but still advertise the fact that we found a descriptor + // The value will be empty. + Log.w(TAG, "onDescriptorRead during discovery error: " + status); + Log.d(TAG, "Non-readable descriptor " + descriptor.getUuid() + + " for characteristic " + descriptor.getCharacteristic().getUuid() + + " for service " + descriptor.getCharacteristic().getService().getUuid()); + leDescriptorRead(qtObject, descriptor.getCharacteristic().getService().getUuid().toString(), + descriptor.getCharacteristic().getUuid().toString(), foundHandle + 1, + descriptor.getUuid().toString(), descriptor.getValue()); } else { // This must be in sync with QLowEnergyService::DescriptorReadError final int descriptorReadError = 6; diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro index 193ed217..0b253942 100644 --- a/src/bluetooth/bluetooth.pro +++ b/src/bluetooth/bluetooth.pro @@ -139,6 +139,7 @@ qtConfig(bluez) { ANDROID_PERMISSIONS = \ android.permission.BLUETOOTH \ android.permission.BLUETOOTH_ADMIN \ + android.permission.ACCESS_FINE_LOCATION \ android.permission.ACCESS_COARSE_LOCATION # since Android 6.0 (API lvl 23) ANDROID_BUNDLED_JAR_DEPENDENCIES = \ jar/QtAndroidBluetooth.jar:org.qtproject.qt5.android.bluetooth.QtBluetoothBroadcastReceiver diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp index ce3b8f10..e1816932 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp @@ -185,6 +185,44 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent qCWarning(QT_BT_ANDROID) << "ACCESS_COARSE|FINE_LOCATION permission available"; } + // Double check Location service is turned on + bool locationTurnedOn = true; // backwards compatible behavior to previous Qt versions + const QAndroidJniObject locString = QAndroidJniObject::getStaticObjectField( + "android/content/Context", "LOCATION_SERVICE", "Ljava/lang/String;"); + const QAndroidJniObject locService = QtAndroid::androidContext().callObjectMethod( + "getSystemService", + "(Ljava/lang/String;)Ljava/lang/Object;", + locString.object<jstring>()); + + if (locService.isValid()) { + if (QtAndroid::androidSdkVersion() >= 28) { + locationTurnedOn = bool(locService.callMethod<jboolean>("isLocationEnabled")); + } else { + // try GPS and network provider + QAndroidJniObject provider = QAndroidJniObject::getStaticObjectField( + "android/location/LocationManager", "GPS_PROVIDER", "Ljava/lang/String;"); + bool gpsTurnedOn = bool(locService.callMethod<jboolean>("isProviderEnabled", + "(Ljava/lang/String;)Z", provider.object<jstring>())); + + provider = QAndroidJniObject::getStaticObjectField( + "android/location/LocationManager", "NETWORK_PROVIDER", "Ljava/lang/String;"); + bool providerTurnedOn = bool(locService.callMethod<jboolean>("isProviderEnabled", + "(Ljava/lang/String;)Z", provider.object<jstring>())); + + locationTurnedOn = gpsTurnedOn || providerTurnedOn; + } + } + + if (!locationTurnedOn) { + qCWarning(QT_BT_ANDROID) << "Search not possible due to turned off Location service"; + lastError = QBluetoothDeviceDiscoveryAgent::UnknownError; + errorString = QBluetoothDeviceDiscoveryAgent::tr("Location service turned off. Search is not possible."); + emit q->error(lastError); + return; + } + + qCDebug(QT_BT_ANDROID) << "Location turned on"; + // install Java BroadcastReceiver if (!receiver) { // SDP based device discovery @@ -201,17 +239,25 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent if (requestedMethods & QBluetoothDeviceDiscoveryAgent::ClassicMethod) { const bool success = adapter.callMethod<jboolean>("startDiscovery"); if (!success) { - lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; - errorString = QBluetoothDeviceDiscoveryAgent::tr("Classic Discovery cannot be started"); - emit q->error(lastError); + qCDebug(QT_BT_ANDROID) << "Classic Discovery cannot be started"; + if (requestedMethods == QBluetoothDeviceDiscoveryAgent::ClassicMethod) { + //only classic discovery requested -> error out + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; + errorString = QBluetoothDeviceDiscoveryAgent::tr("Classic Discovery cannot be started"); + + emit q->error(lastError); + return; + } // else fall through to LE discovery + } else { + m_active = SDPScanActive; + qCDebug(QT_BT_ANDROID) + << "QBluetoothDeviceDiscoveryAgentPrivate::start() - Classic search successfully started."; return; } + } - m_active = SDPScanActive; - qCDebug(QT_BT_ANDROID) - << "QBluetoothDeviceDiscoveryAgentPrivate::start() - Classic search successfully started."; - } else { - // LE search only requested + if (requestedMethods & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod) { + // LE search only requested or classic discovery failed but lets try LE scan anyway Q_ASSERT(requestedMethods & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod); if (QtAndroidPrivate::androidSdkVersion() < 18) { diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp index f946b541..12ca9d10 100644 --- a/src/bluetooth/qlowenergycontroller_winrt.cpp +++ b/src/bluetooth/qlowenergycontroller_winrt.cpp @@ -325,6 +325,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/qnearfieldtarget.cpp b/src/nfc/qnearfieldtarget.cpp index e9a6fa11..f7612d36 100644 --- a/src/nfc/qnearfieldtarget.cpp +++ b/src/nfc/qnearfieldtarget.cpp @@ -538,6 +538,7 @@ bool QNearFieldTarget::handleResponse(const QNearFieldTarget::RequestId &id, void QNearFieldTarget::reportError(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id) { + setResponseForRequest(id, QVariant(), false); QMetaObject::invokeMethod(this, [this, error, id]() { Q_EMIT this->error(error, id); }, Qt::QueuedConnection); diff --git a/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp b/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp index fb7aa7ae..2d1f052e 100644 --- a/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp +++ b/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp @@ -174,8 +174,7 @@ void tst_QNearFieldTagType1::staticMemoryModel() quint8 byte = target->requestResponse(id).toUInt(); id = target->writeByte(i, 0x55); - QVERIFY(!target->waitForRequestCompleted(id,50)); - + QVERIFY(target->waitForRequestCompleted(id)); QVERIFY(!target->requestResponse(id).isValid()); id = target->readByte(i); @@ -224,8 +223,7 @@ void tst_QNearFieldTagType1::staticMemoryModel() quint8 byte = target->requestResponse(id).toUInt(); id = target->writeByte(i, 0x55); - QVERIFY(!target->waitForRequestCompleted(id,50)); - + QVERIFY(target->waitForRequestCompleted(id)); QVERIFY(!target->requestResponse(id).isValid()); id = target->readByte(i); @@ -272,7 +270,7 @@ void tst_QNearFieldTagType1::dynamicMemoryModel() QCOMPARE(quint8(block.at(7)), quint8(0x00)); id = target->writeBlock(0x00, QByteArray(8, quint8(0x55))); - QVERIFY(!target->waitForRequestCompleted(id,50)); + QVERIFY(target->waitForRequestCompleted(id)); QVERIFY(!target->requestResponse(id).isValid()); QCOMPARE(target->uid(), block.left(7)); @@ -338,7 +336,7 @@ void tst_QNearFieldTagType1::dynamicMemoryModel() QByteArray block = target->requestResponse(id).toByteArray(); id = target->writeBlock(i, QByteArray(8, quint8(0x55))); - QVERIFY(!target->waitForRequestCompleted(id,50)); + QVERIFY(target->waitForRequestCompleted(id)); QVERIFY(!target->requestResponse(id).isValid()); id = target->readBlock(i); @@ -350,14 +348,17 @@ void tst_QNearFieldTagType1::dynamicMemoryModel() for (int i = 0; i < 256; ++i) { QNearFieldTarget::RequestId id = target->readBlock(i); - QVERIFY(!target->waitForRequestCompleted(id,50)); + QVERIFY(target->waitForRequestCompleted(id)); + QVERIFY(!target->requestResponse(id).isValid()); id = target->writeBlock(i, QByteArray(8, quint8(0x55))); - QVERIFY(!target->waitForRequestCompleted(id,50)); + QVERIFY(target->waitForRequestCompleted(id)); + QVERIFY(!target->requestResponse(id).isValid()); } for (int i = 0; i < 16; ++i) { QNearFieldTarget::RequestId id = target->readSegment(i); - QVERIFY(!target->waitForRequestCompleted(id,50)); + QVERIFY(target->waitForRequestCompleted(id)); + QVERIFY(!target->requestResponse(id).isValid()); } } } |