summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjnihelpers.cpp
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2021-03-03 00:59:29 +0200
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2021-05-05 16:28:27 +0300
commitafd7460affa17b5f8aac9034b1b9c3b13dd115f7 (patch)
tree3e40110b6a93cb73cbf71768b45e4ecc61144cf8 /src/corelib/kernel/qjnihelpers.cpp
parent3969ef40cca426cc0d5ae0fd88e087f0274750eb (diff)
Add new app permissions API under QCoreApplication
The API allows users to request and check the status of various permissions. A predefined enum class of the common permission types on different platforms is used to allow requesting permission with a common code. Platform specific permissions are defined only on their relevant platform. For permissions that are not predefined, they can be requested via a string variant of this API. This adds the Android implementation only. [ChangeLog][QtCore] Add new API for handling app permissions with an initial implementation for Android. Task-number: QTBUG-90498 Change-Id: I3bc98c6ab2dceeea3ee8edec20a332ed8f56ad4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/kernel/qjnihelpers.cpp')
-rw-r--r--src/corelib/kernel/qjnihelpers.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp
index 0ad5988297..a7e368017a 100644
--- a/src/corelib/kernel/qjnihelpers.cpp
+++ b/src/corelib/kernel/qjnihelpers.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -47,6 +47,7 @@
#include "qsharedpointer.h"
#include "qthread.h"
+#include <QtCore/private/qcoreapplication_p.h>
#include <QtCore/qrunnable.h>
#include <deque>
@@ -397,6 +398,9 @@ jint QtAndroidPrivate::initJNI(JavaVM *vm, JNIEnv *env)
if (!regOk && QJniEnvironment::checkAndClearExceptions(env))
return JNI_ERR;
+ if (!registerPermissionNatives())
+ return JNI_ERR;
+
g_runPendingCppRunnablesMethodID = env->GetStaticMethodID(jQtNative,
"runPendingCppRunnablesOnAndroidThread",
"()V");