Commit Graph

3594 Commits

Author SHA1 Message Date
Lucie Gérard e523e84aaf Add REUSE.toml files and missing licenses
REUSE.toml files are read by reuse to complement or override the
copyright and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Pick-to: 6.8
Change-Id: I641e0dfa17a62cdff5b3b76698c4edb4df100bc4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-14 16:10:07 +01:00
Qt Submodule Update Bot 9b187f8e31 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Idc19432e4108a9a50c19cd4eaa0a7216cd020873
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-07 05:23:07 +00:00
Qt Submodule Update Bot 3f5ab157dd Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Id96de1ae879f2ffa8507b145757b9134d39751d0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-06 11:58:29 +00:00
Ivan Solovev 8b95d7779b Docs: clarify QLowEnergyAdvertisingData::setRawData() limitations
It is only available on Linux Kernel API backend, so explicitly mention
it in the docs. Also explain, why it cannot be supported on other
backends with the current API.

As the new Linux D-Bus backend, together with the Linux Specific docs
section, was introduced only in 6.5, pick this patch down to that
branch only.

Task-number: QTBUG-130146
Task-number: QTBUG-130891
Pick-to: 6.8 6.5
Change-Id: I5395fed6606d84ed1d1f032c45b31759330293dd
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-11-06 09:49:12 +01:00
Qt Submodule Update Bot 4a06af3b2e Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I734f6750a0933ba107940236de6b60146c02e00d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-01 18:09:53 +00:00
Qt Submodule Update Bot 25482fb720 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I7b470a4e1ebd143ccd1e146ab9e19640dd12ad2c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-10-30 20:14:47 +00:00
Timur Pocheptsov 7b632d0547 Near field manager (iOS): protect against dangling pointers
clearTarget calls 'invalidate' on a private target pimpl object,
which it's documented to own (via a public target object).
It's possible to call deleteLater on QNearFieldTarget object
but this potentially leaves us with a dandling pointer, since
we do not remove deleted object from 'detectedTargets'.
Protect against this using QPointer.

Change-Id: Ib970fde0233d383b727b90afeb2aedf7eb4a9e9c
Pick-to: 6.8
Fixes: QTBUG-129977
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-10-30 15:43:54 +01:00
Qt Submodule Update Bot 02ae190475 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I1f5a19c30fc550db31647572383d90220fea57bb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-10-23 03:22:02 +00:00
Ivan Solovev 25a30c0241 Suppress bogus warning from MinGW
When trying to force asserts, MinGW starts complaining about calling
qFromUnaligned<uint16_t>() with a static QBA::_empty member:

  error: array subscript 'short unsigned int[0]' is partly outside
         array bounds of 'const char [1]' [-Werror=array-bounds=]

However, the code explicitly checks that QBA size is >= 2 before
going into this branch, so it looks like an incorrect disgnostics
from MinGW.

We already had the similar warnings in other places, and
qtbase/de005e7976e4b110d6b5f32a8bab5141713acb7b suggests that the
proper fix is to cache the QBA::size().

However, applying this fix alone does not solve the problem, so
explicitly create a QByteArrayView on the response, and use it
in all the operations, except for the final assignment.

Fixes: QTBUG-129763
Pick-to: 6.8 6.5
Change-Id: I1e7ce87801320a0960fded208a41984e7668dfb0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-10-21 09:37:34 +02:00
Qt Submodule Update Bot b6c27e56ee Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I3689fd18476af58174b0d756bde50b2de57bf78e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-27 06:59:25 +00:00
Qt Submodule Update Bot 7f925eb896 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Ie412bac521d6d180f555c216f92e7ade61a4e698
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-25 04:24:33 +00:00
Qt Submodule Update Bot ffd96c58ef Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Ifbd6f095b869427e39a3230bb2e76e91f427763e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-23 18:09:33 +00:00
Qt Submodule Update Bot 3c81f32e5d Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I4cb0cc73ac9bf47b98cdd02e78f24be456b934fd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-20 16:57:41 +00:00
Volker Hilsheimer a22665e334 Android: simplify JNI code
Use QJniArray and rely on implicit conversion for QString, QByteArray,
and QStringList. Make QJniArray instances const to avoid problems when a
mutating iterator API is added to QJniArray.

Change-Id: I174a0a2bc99b77f07242e03f76735ef1333c89c4
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-09-19 12:33:34 +02:00
Qt Submodule Update Bot 52773e14fb Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Iee9f23c825ce73418de3a257f8f5912804fd2cf1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-11 07:09:10 +00:00
Qt Submodule Update Bot 01d963e62f Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Ic8231a85006d78fa589337936e2ba111eb17527f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-05 05:14:20 +00:00
Qt Submodule Update Bot 3f84dd826b Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Id624111f0ad064fcc14052ee104a412c03f5cbd7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-03 18:42:46 +00:00
Juha Vuolle 86b957da94 Prevent BT LE Mtu exchange from triggering RSSI read
The commit introdocing RSSI read for Android
bc6e4e2860
seems to miss a 'break' statement when checking
BT LE (central) job type, causing MTU exchange to
also perform an RSSI read.

Pick-to: 6.8 6.7 6.5
Change-Id: I6746148b39dc11af6527efd8b41d25940a93ca49
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-09-02 18:51:14 +03:00
Juha Vuolle d7d9b43cdd Fix a fall-through warning
Pick-to: 6.8
Change-Id: Id95f1fb811a04c28775709d6d0e1a8e2d176fe1e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-09-02 18:51:11 +03:00
Qt Submodule Update Bot e008e50969 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Ied33a958d7c68c315ec42b5b0ec2f3e47bdd075a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-31 07:01:15 +00:00
Ivan Solovev 83876bdca3 qlowenergycontroller_winrt.cpp: fix namespace build
For some reason, the operators should be inside Qt namespace, otherwise
the compiler fails to see them.

That slipped through the CI because we do not have any Windows configs
with namespace builds there.

Amends a5552379dd.

Fixes: QTBUG-128465
Change-Id: I047a20549d526f18cac6bc51a74a62a88ff022ff
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-08-30 10:08:58 +02:00
Juha Vuolle 7c79a50cbb Set ACCESS_FINE_LOCATION maxSdkVersion to 30
Since API-level 31 the location permission is not mandatory in most
cases, and this commit makes the recommended maxSdkVersion entry.

Notably the application may also link against for example QtPositioning
module which also defines the ACCESS_FINE_LOCATION but without any
maxSdkLevel entries. Therefore a pre-requisite for this change
is a permission duplicate-resolution change in 'androiddeployqt'
utility (a permission without additional attributes must get
priority).

Change-Id: I76dbf3b423efe16b094bda92d9fdb62402346b03
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-08-29 14:55:53 +03:00
Juha Vuolle 0cdd0304c7 [QtNfc] Use the new Android cmake permission function
Change-Id: I839dc2d3143e4fae71ed74a65f72bb587f3a09d2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-08-29 14:55:50 +03:00
Juha Vuolle dca2eb939c Check if location checks can be skipped with bluetooth scan
Since Android-12 (API-level 31) the location isn't a mandatory
requirement, and the code should allow proceeding also when
location services are switched off.

Location and the related permission  isn't needed if
the API-level is 31+, and the BLUETOOTH_SCAN asserts
'neverForLocation'.

[ChangeLog][Important Behavior Changes][QtBluetoothDeviceDiscoveryAgent]
Android implementation now allows starting scan even if Location is
switched off and location permissions aren't granted. This requires
that API level is 31+ and that BLUETOOTH_SCAN asserts
'neverForLocation'.

Task-number: QTBUG-117358
Task-number: QTBUG-112164
Change-Id: Iac7a99fdf5d3144d6ad06d93aa394b2df71d37b0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-08-29 14:55:47 +03:00
Juha Vuolle ada8ffd7c8 Set sdkVersions and neverForLocation bluetooth permission assertions
Since Android-12 / API-level 31 the ACCESS_FINE_LOCATION is no longer
mandatory for Bluetooth usage. Removing it will avoid unnecessary
location permission query (user prompt).

In addition, for the Bluetooth to work without ACCESS_FINE_LOCATION on
these newer API-levels, we must also assert in the manifest that
we don't use bluetooth scanning to derive a location. This is an
attribute for the BLUETOOTH_SCAN permission.

There are less common use cases to derive the location too. In these
cases the user must override the BLUETOOTH_SCAN permission so that it
no longer asserts neverForLocation, and also request the
ACCESS_FINE_LOCATION permission separately (QLocationPermission).

This change also relates to QBluetoothPermission change in QtCore,
which no longer shall request the ACCESS_FINE_LOCATION permission.

Task-number: QTBUG-117358
Task-number: QTBUG-112164
Change-Id: If6ebc17dff1c4799bf35ff037f70d97d91be5dfe
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-08-29 14:55:44 +03:00
Qt Submodule Update Bot d38ec4a265 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I65f03f69f5c62d16da1287cbf201691b2614ed86
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-29 07:35:11 +00:00
Qt Submodule Update Bot 069d454ad8 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I2a5d164576be8cfde7a5f5c26cd165dc8fdc569e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-28 01:39:14 +00:00
Paul Wicking c39aa15c0f Doc: Remove usage of defunct QDoc command
The QDoc command `\tableofcontents` was rendered useless by a change
more than a decade ago. Remove the use of `\tableofcontents` as it
serves no purpose, and ensure that the surrounding context still makes
sense for the reader, by removing preceding text that refers to a
non-existing table of contents, such as `Contents:`.

Task-number: QTBUG-128173
Pick-to: 6.8
Change-Id: Iaed52f113633f97fa58705298140d2e68bdd3683
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2024-08-27 12:28:59 +02:00
Juha Vuolle 86cd96a6b1 Darwin: Add Bluetooth state monitoring for QBluetoothLocalDevice
This change adds CBCentralManagerDelegate for listening bluetooth
state changes. This enables the emission of
QBluetoothLocalDevice::hostModeStateChanged() signal also on macOS.

Fixes: QTBUG-123425
Change-Id: Ic07ecb120f7fd8f061ba832101b96ca5b442dffc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-08-27 08:21:53 +03:00
Ivan Solovev b16c4cfa6f Fix a typo in the log message
It should mention RFCOMM channel, not L2CAP.

Pick-to: 6.8 6.7 6.5 6.2
Change-Id: I2c23a73f9f4e5ccaea82402c5bd4b5301dda393d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-08-26 15:31:48 +02:00
Ivan Solovev c382034457 macOS Bluetooth: report RemoteHostClosed error when the RFCOMM channel is closed
The ChannelDelegate::channelClosed() virtual method is called in two
cases:
* when an attempt to open the channel failed (because of the timeout
  or an error in rfcommChannelOpenComplete() callbalk).
* when the rfcommChannelClosed() callback is triggered. This happens
  only when the remote host closes the connection.

In the first case we set UnknownSocketError. Keep this behavior.

In the second case no error was reported, which is different from how
other backends behave. This patch updates the code to set the
RemoteHostClosed error if the channelClosed() is called, and the
socket was in Connected state.

Task-number: QTBUG-123430
Pick-to: 6.8 6.7 6.5
Change-Id: Ie21a2e66b570a32b1c4401305738515bc6d04f85
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-08-26 15:31:46 +02:00
Ivan Solovev 05b8398aa6 macOS Bluetooth: use a timer when opening RFCOMM channel
An attempt to open an RFCOMM channel should trigger an
rfcommChannelOpenComplete() callback which has an error status.
This happens correctly if the channel is opened successfully (the error
is kIOReturnSuccess in this case).
However, when the remote device is turned off, the attempt to open an
RFCOMM channel never triggers any callback, so the socket simply
hangs in the Connecting state.
Fix it by explicitly using a connection timer. The timer timeout is
picked more or less randomly, but 5s looks like a reasonable time,
because at this point we are simply trying to connect to a known
service. No discovery is needed.

As a drive-by: update the error handling code path in
rfcommChannelOpenComplete() to also signal that the channel is closed.
Otherwise the socket will report an error, but keep hanging in the
Connecting state. This code path is never executed now, but it might
be fixed in later macOS releases.

Task-number: QTBUG-123430
Pick-to: 6.8 6.7 6.5
Change-Id: I187a0b2e293462c6e9b7e5e3afee2e6ddf4d2ab1
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-08-26 15:31:43 +02:00
Qt Submodule Update Bot 90e592dfdc Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I7bc67b16b0dbb5ca3a39b49cbc31e0bcd176a584
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-24 05:54:23 +00:00
Qt Submodule Update Bot 65117adb20 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I96dacf4f994023c7a22d466014f5bef896dc927c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-21 21:14:22 +00:00
Qt Submodule Update Bot 4656c403e5 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I5d239107a3549861d7a41823384000fc28441d9b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-19 11:36:20 +00:00
Assam Boudjelthia 025020adf3 Android: call the init class setContext() from JNI_OnLoad()
After making internal Java classes non-public, using the init
classes mechanism doesn't work, so do the initialization from
within the module's JNI_OnLoad() instead.

Amends 8e38a6ffcf.

Task-number: QTBUG-126478
Pick-to: 6.8
Change-Id: I370f9c9f860195a688f4e65db976d45e238a11b7
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-08-19 08:49:20 +00:00
Qt Submodule Update Bot f2c70e93db Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I75709a591501c0a358a00547f660620729d39fd7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-14 21:26:52 +00:00
Konsta Alajärvi f2660541d8 Remove android:icon property from annotatedurl AndroidManifest.xml
Remove android:icon property from annotatedurl example
AndroidManifest.xml as there are no icons to be used. This results
in Android resource linking failure.

Fixes: QTBUG-127407
Pick-to: 6.8
Change-Id: Ic74f6879f4ec593fdaa4b36d2233bd48df0c5f8f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-08-14 14:34:55 +03:00
Qt Submodule Update Bot f0cf8d9012 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: Ib84a5a841d781d4422b4a6289ed715aec464decb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-09 12:41:24 +00:00
Qt Submodule Update Bot 201635bc9d Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I16c4e47169544b51cefe3a20546982602a301abb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-06 22:39:11 +00:00
Qt Submodule Update Bot 49ed538769 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I8ef774d36723bcf45de5e10c18118ef840b0dac6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-01 11:11:36 +00:00
Topi Reinio 285729563f Doc: Fix link to Qt for Linux
The correct page title to link to is 'Qt for Linux/X11'.

Pick-to: 6.8
Change-Id: I9de1a6882e0f81867caff649fcff6b5874654f49
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-07-31 08:53:54 +00:00
Qt Submodule Update Bot 5288859e1f Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I374bc013be3ffee128adb05626532f8ac746f3e4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-30 15:09:11 +00:00
Miguel Costa a5552379dd Use C++/WinRT in qlowenergycontroller_winrt
Most changes in this patch are direct translations of WRL-style API
calls to C++/WinRT, ideally with no change in caller-observable
behavior.

The C++/WinRT API provides error handling by means of exceptions. To
maintain caller-observable behavior, all API calls need to be secured by
a try-catch block. A few helpful macros are used to keep the translated
code readable:
  - TRY(x): evaluates x, yields a bool that indicates if the evaluation
    generated an API exception (true = no exception).
  - HR(x): evaluates x, yields an HRESULT that corresponds to the
    exception generated (S_OK = no exception).
  - SAFE(x): yields a value corresponding to the evaluation of x, or
    nullptr in case an API exception was generated.

Task-number: QTBUG-120665
Change-Id: Iaef4f04c61fca2265e4730fb44e99877b38dc168
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-07-30 16:12:39 +02:00
Qt Submodule Update Bot 3fe0851fca Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I081dfd1ec3aa8cecc5b7ced564620ef56bfd5694
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-26 16:10:45 +00:00
Alexei Cazacov 4e95338806 Docs: Organize topics in the qtconnectivity project
This commit organizes the articles, so they:
- have a reasonable tree structure
- can be navigated through the topic tree in the Qt Creator help viewer

Task-number: QTBUG-127023
Change-Id: Idfd2eb82e5c110a0bc1db573e4230381e484ce0e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-07-25 07:37:05 +03:00
Marc Mutz e707e33e14 Port to std::snprintf() and mark the module qsnprintf()-clean
Pick-to: 6.8
Task-number: QTBUG-127110
Change-Id: I5cbe79c3f5a95ba4ccbab5e2056e2a061f93d448
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-07-22 20:07:20 +02:00
Marc Mutz fcee2074e1 sdpscanner: fix format strings for (u)int64_t
This probably only worked on Little-Endian machines, but it's UB
there, too, of course.

Wasn't detected by the compiler because qsnprintf() doen't have
__attribute__(printf), for some reason.

Prepare the folded part of the line so a follow-up port to
std::snprintf() doesn't have to re-indent it.

Amends 3ee0be1013.

[ChangeLog][QtBluetooth][sdpscanner] Fixed a bug involving broken
serialization of SDP_(U)INT64 DTDs on Big-Endian machines.

Pick-to: 6.8 6.7 6.5 6.2 5.15
Change-Id: Ib4e24007cf498814f3c91b5a57e7dfd6a311926c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-07-22 18:56:00 +02:00
Qt Submodule Update Bot f9888436c8 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I8a4ea4810c895434e011e41e6339a7bb76e29faf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-21 23:40:01 +00:00
Qt Submodule Update Bot 755612f407 Update dependencies on 'dev' in qt/qtconnectivity
Change-Id: I8d6ace4819cf3ddf8bc38297790b12841d133ce3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-17 23:49:06 +00:00