diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-11-10 22:42:26 +0200 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-11-10 22:42:26 +0200 |
commit | e957d4810b05d8453e163d7bcdcab42d3c60a7bb (patch) | |
tree | 76ed3d969c478042f8ca747bf425b0e5d2e893dc /src/bluetooth/osx/osxbtutility.mm | |
parent | 47c424c7990061714bd3108e3fbaa4339ba411b9 (diff) | |
parent | a6f5b79169991ffde38643d7b1a04d6a9de137bf (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Change-Id: I4d53774cfe0783f50a123158d8bac7a02c382968
Diffstat (limited to 'src/bluetooth/osx/osxbtutility.mm')
-rw-r--r-- | src/bluetooth/osx/osxbtutility.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtutility.mm b/src/bluetooth/osx/osxbtutility.mm index c7fa7c42..3d41a224 100644 --- a/src/bluetooth/osx/osxbtutility.mm +++ b/src/bluetooth/osx/osxbtutility.mm @@ -42,6 +42,7 @@ #include "osxbtutility_p.h" #include "qbluetoothuuid.h" +#include <QtCore/qoperatingsystemversion.h> #include <QtCore/qendian.h> #include <QtCore/qstring.h> @@ -76,6 +77,8 @@ const int defaultLEScanTimeoutMS = 25000; // We use it only on iOS for now: const int maxValueLength = 512; +NSString *const bluetoothUsageKey = @"NSBluetoothAlwaysUsageDescription"; + QString qt_address(NSString *address) { if (address && address.length) { @@ -351,6 +354,22 @@ ObjCStrongReference<NSMutableData> mutable_data_from_bytearray(const QByteArray return result; } +bool qt_appNeedsBluetoothUsageDescription() +{ +#ifdef Q_OS_MACOS + return QOperatingSystemVersion::current() > QOperatingSystemVersion::MacOSBigSur; +#endif + return true; +} + +bool qt_appPlistContainsDescription(NSString *key) +{ + Q_ASSERT(key); + + NSDictionary<NSString *, id> *infoDict = NSBundle.mainBundle.infoDictionary; + return !!infoDict[key]; +} + // A small RAII class for a dispatch queue. class SerialDispatchQueue { |