summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjnihelpers.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Helper function needed to run Runnables on Android UI thread easily.BogDan Vatra2016-01-151-17/+38
| | | | | | | | Add a function to allow the users to easily run asynchronously Runnables for any thread directly on Andoroid UI thread. Change-Id: I631bf8a2c602e038039fec621ec01272af20a400 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtCore: eradicate all Q_FOREACH loops [kernel]Marc Mutz2016-01-121-2/+2
| | | | | | | | Saves just 168b in text size on optimized GCC 4.9 Linux AMD64 builds, but most for loops are in non-Linux code. Change-Id: I4f20a65c2e4953011308ff831c9e8fa37a25274b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Dispatch all key and all generic motion events java objects to QtCoreBogDan Vatra2015-10-151-1/+62
| | | | | | | | | | These events are needed to enable the usage of all input methods available on Android e.g. gamepads, stylus, etc. In orer to get GenericMotionEvents your application min API version must be at least 12, otherwise the application will receive only key events. Change-Id: I7564fccaf5423aa318ba4f62317eaf101ba6e97e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Added new private API for Android and onPause/onResumePeter Rustler2015-03-171-0/+39
| | | | | | | | | | | | | | | On Android the foreground activity can get onPause/onResume calls. In Nfc code in android we need to know if we are paused or resumed. And we need to make sure to call disableForegroundDispatch inside the onPause call and in the main Ui thread. The current implementiton of applicationStateChanged was not sufficient to acomplish that. This patch adds a way to receive those onPause/onResume calls in Qt with proper timing. Change-Id: I3a8cec093fc02ec42cc8677dfe2d0d4f8a227f8b Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Added new private API for Android and onNewIntentPeter Rustler2015-01-211-0/+33
| | | | | | | | | | | | | On Android the foreground activity can get intents with onNewIntent. Those intents can not be received in any other way. This is especially true in Android nfc. This patch adds a way to receive those intents in Qt. This patch heavily leans on the implementation of onActivityResult. Change-Id: Ic4dca301f34afe9a528149c3653e545ed3265a3c Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android: Add runOnUiThread() functionChristian Strømme2014-11-031-0/+38
| | | | | | | | Enables QRunnables to be run on the UI thread. For now this function is only intended for internal consumption. Change-Id: I5e2abb06104219a9dd55b3308113056e4da5fa07 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Android: Use exceptionCheck() function.Christian Strømme2014-06-051-3/+1
| | | | | | | | | This was the only place where we didn't use the exceptionCheck() function. Besides being more consistent, it's also more verbose if an exception occurs. Change-Id: Ib1e3dba82b0730cf189ec725f4da425d7ac85cdc Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Add enablers for listening to activity resultsEskil Abrahamsen Blomfeldt2014-02-151-0/+35
| | | | | | | | | | | | | | | | | | | When you launch an activity through an intent, data can be provided back from the activity when it has finished using onActivityResult() in the activity which launched it. This is okay for applications, since they can easily create their own activities, but does not work for libraries that need to use intents. There is no listener API for activity results which allow external classes to eavesdrop. In order to support launching intents from third-party or add-on libraries, we provide a low-level way to hook into the activity result event. The corresponding public API will be added to QtAndroidExtras. Change-Id: I89417f485e2c0e69028dcccc7c155788346a7417 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: Add convenience function to get the API level.Christian Strømme2014-01-161-0/+21
| | | | | | | | | It's common to check the Android API level at runtime to determine what functionality is available. This change provides a convenient way to get the Android SDK version (API level) from c++. Change-Id: I88f65ae87e0fa8ac0affefffbd1b1bba855c9f46 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix problem with leaking local refs.Christian Strømme2013-10-301-0/+2
| | | | | | | | | In some cases we where not releasing the local references and since we no longer disconnect from the VM on each call, the number of local refs. would accumulating until it hit the hard-limit of 512. Change-Id: I6826620e4cb61a37af26d276667489e876080076 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Use the application's class loader when loading Java classes.Christian Strømme2013-09-251-0/+20
| | | | | | | | | Previously the system class loader was used, which meant only system Java classes where available. With this change it's no longer necessary to add a JNI_OnLoad() to get a handle to application specific classes. Change-Id: Ic8fe35b4e525bfeb1d317d5ba6b496e39bf9bb30 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Added JNI_OnLoad to QtCoreChristian Strømme2013-09-201-0/+99
JNI_OnLoad is called for each library during the start-up of a Qt application on Android. When the JNI_OnLoad is called we can get a handle to the Java VM and necessary classes which enables us to access Java API's in QtCore. Change-Id: I64c1f1106cc0d5ab5a7bc9b22c752c09162fe813 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>