7 Commits

Author SHA1 Message Date
Assam Boudjelthia
68ed06b17b Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptions
Address feedback from header view.

Task-number: QTBUG-90211
Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b9f27335e7462a15ac642841bb6d86ebebb349f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-30 09:24:01 +00:00
Wang Yicun
bb1070e17a Simplify code, remove redundant condition
'clazz || (!clazz && isCached)' is equivalent to
'clazz || isCached'

Done-with: Tang Peng <tangpeng@uniontech.com>
Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a913002f13d8a2faad512ffda6c70f413b8e7ee5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 15:35:35 +00:00
Assam Boudjelthia
8d94f5b549 Re-order includes in qjniobject.cpp
Change-Id: I80acd829bfd0940d17170f2277e92bc9620ce929
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f265736e9fdce7e9d049774f2e9f648f52aef31f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-22 17:53:27 +00:00
Assam Boudjelthia
ea8a0eb417 Fix docs misuse of escape character \
Use {} instead of \, this fix a badly generated block of text.

Task-number: QTBUG-89632
Change-Id: Ia4aad4c06285eb016a092f4340669fcbef1a6780
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 448ea34637af3a8a92c2a4c5780815ca44e0ecf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-12 11:09:17 +00:00
Assam Boudjelthia
121ad4c22f Refactor duplicate code for clearing JNI exceptions before returning
Add a private function to handle checking/clearing and deleting the
local reference to jobject before returning a QJniObject.

Task-number: QTBUG-89633
Change-Id: I0ea28c8ba4da0bfc1e341c6b4c1f61fecfec87a6
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit c7bcc51e2c196e5cc3def89137ca31b4a9d29157)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 19:16:29 +00:00
Assam Boudjelthia
77b035aa6e Documentation improvements to JNI API
Amends 4e60681c879a54cf5b34862a30e27c492ed36363.

Fixes: QTBUG-89632
Change-Id: I7856e9b63eea5ba68a5472575016540ae656ec5f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 817f8ac03cd4e85b7813b45f8cabf5b679f28702)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-09 18:23:26 +00:00
Assam Boudjelthia
4e60681c87 Make QJniObject and QJniEnvironment public API
As part of Qt 6 restructring for the extras modules, this change exposes
the Jni APIs which are very important for Android platform. This patch
adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based
from private QtCore and QtAndroidExtras.

The Jni interface is cross-platform which justifies the name, but
currently, this API is used mainly for Android, and the naming comes
generic without Android keyword to avoid any future limitation on
supporting other platforms.

[ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and
QJniExceptionCleaner APIs.

Task-number: QTBUG-89482
Fixes: QTBUG-89633
Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-01-27 17:23:04 +02:00