File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/core/platforms/android Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ inline QJniObject qtAndroidContext()
35
35
return QJniObject ( QCoreApplication::instance ()->nativeInterface <QNativeInterface::QAndroidApplication>()->context () );
36
36
}
37
37
38
+ inline int qtAndroidSkdVersion ()
39
+ {
40
+ return QCoreApplication::instance ()->nativeInterface <QNativeInterface::QAndroidApplication>()->sdkVersion ();
41
+ }
42
+
38
43
inline void runOnAndroidMainThread ( const std::function<void ()> &runnable )
39
44
{
40
45
QCoreApplication::instance ()->nativeInterface <QNativeInterface::QAndroidApplication>()->runOnAndroidMainThread ( [runnable]() {
@@ -778,8 +783,11 @@ void AndroidPlatformUtilities::requestBackgroundPositioningPermissions()
778
783
779
784
void AndroidPlatformUtilities::startPositioningService () const
780
785
{
781
- // Request notification permission
782
- checkAndAcquirePermissions ( { QStringLiteral ( " android.permission.POST_NOTIFICATIONS" ) } );
786
+ if ( qtAndroidSkdVersion () >= 33 )
787
+ {
788
+ // Request notification permission
789
+ checkAndAcquirePermissions ( { QStringLiteral ( " android.permission.POST_NOTIFICATIONS" ) } );
790
+ }
783
791
784
792
qInfo () << " Launching QField positioning service..." ;
785
793
QJniObject::callStaticMethod<void >( " ch/opengis/" APP_PACKAGE_NAME " /QFieldPositioningService" ,
You can’t perform that action at this time.
0 commit comments