summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjnihelpers_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Forward Service.onBind notification to QtBogDan Vatra2017-07-041-0/+14
| | | | | | | It is needed to implement Android Binder in Qt. Change-Id: I8f6f8ef778f97a444a1b16d6f62e211e188b65cc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-191-2/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
| * Android: Fix deadlock when calling requestPermissionBogDan Vatra2017-06-071-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The hang happend when using QtAndroidPrivate::requestPermissions before the QApplication::exec. Android UI calls "sendRequestPermissionsResult" which was blocking until the event is delivered, but the qt main loop is blocked and waits for the main surface to be created by the Android UI thread which is already blocked. With this patch sendRequestPermissionsResult won't block for the result to be delivered. Change-Id: I48ada65fe9ea63471ab46d8a9d839ba1b91d17b3 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Android: Allow timeout to fade out splash screenMathias Hasselmann2017-03-011-1/+1
|/ | | | | | Change-Id: I7b24f4d402da7f74b4c983467008ff4c19fc3b1b Task-number: QTBUG-59200 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Android: De-duplicate vtables of exported private classesMarc Mutz2017-02-161-7/+7
| | | | | | | | | | | | | | | | | | | | By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false-negative dynamic_cast and catch evaluation. Since the classes are already exported, users of these classes are unaffected by the change, and since it's private API, we don't need to avoid adding code to the out-of-line destructor until Qt 6. While at it, de-inline also the empty default implementations of virtual (non-dtor) functions. Task-number: QTBUG-45582 Change-Id: I3e6f37eab1dee0db445f6c13638a43ca3bf6ac62 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Say hello to Android 6+ permissions modelBogDan Vatra2016-09-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This API was introduced by Android v23 and is used in connection with the new permission request system. From Android v23 onwards, some permissions such as Location permissions cannot only be granted via Android's Manifest files. An additional runtime check/request system was introduced which forces applications to prompt the user the first time a privileged function is called. Such user prompt responses are returned to the current application via the Activity.onRequestPermissionsResult(..) callback. This change add Qt API to nicely check & request permissions. For now this is private API which can be used to fix permission problems in other Qt compontents. Later Qt versions will introduce a public API to QtAndroidExtras. [ChangeLog][QtCore][Android] Introduced a mechanism to forward permission related callbacks on Activity objects to interested parties. Task-number: QTBUG-55035 Task-number: QTBUG-50759 Change-Id: I64ee748d741b39e35c4713ed9fdd15dd1d96dc56 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add QtAndroidPrivate::context()Alex Blasche2016-08-031-0/+1
| | | | | | | | This simplifies the retrieval of the correct Context object. Task-number: QTBUG-55102 Change-Id: I303bc5393a7900ceb4bde36e711938f3f49075c1 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Make sure all private headers in Qt Core include qglobal_p.hThiago Macieira2016-06-251-1/+1
| | | | | | | | | | | | The rule was: - if the header included qglobal.h, turn that into qglobal_p.h - otherwise, insert the #include after the "We mean it" warning qglobal_p.h currently only includes qglobal.h. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Perfect (almost) Qt on Android splash screen.BogDan Vatra2016-02-241-0/+2
| | | | | | | | | | | | | There is no need to show the splash image immediately when the application starts, because it will be removed shortly in QtActivityDelegate.java, therefore show the splash in QtActivityDelegate.java. This patch also adds a new option to AndroidManifest.xml which keeps the splash screen visible until user to decides to hide it, by using the QtAndroid::hideSplashScreen() function. Change-Id: I8a29a5a757d626c4c9d6a2748a60ca3091ebf82d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Say hello to Android ServicesBogDan Vatra2016-02-171-0/+1
| | | | | | | | | | | | | | This changeset enables running a QCoreApplication from within an Android Service. The Android Application running can now have a QtActivity or a QtService, but having both in the same process is not supported. This patch was based on Cory Slep's patch [ChangeLog][Android] Qt can now be used to easily create Android Services. Task-number: QTBUG-37221 Change-Id: I0fd693daaa85b991940ffe9cc41c483022677199 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: Add runOnAndroidThreadSyncBogDan Vatra2016-02-041-0/+1
| | | | | | | This is a convenient function which waits (timoutMS) for the runnable to be executed. Change-Id: I2c0f262d3795c29961e8182b7ffc35a2c6f8a1f6 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Helper function needed to run Runnables on Android UI thread easily.BogDan Vatra2016-01-151-0/+4
| | | | | | | | 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>
* Dispatch all key and all generic motion events java objects to QtCoreBogDan Vatra2015-10-151-0/+20
| | | | | | | | | | 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/+13
| | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | 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/+3
| | | | | | | | 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: Add enablers for listening to activity resultsEskil Abrahamsen Blomfeldt2014-02-151-0/+11
| | | | | | | | | | | | | | | | | | | 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: Export QtAndroidPrivate::androidSdkVersion()Christian Strømme2014-01-311-1/+1
| | | | | | | | Prerequisite for making the SDK version (API level) available through QtAndroidExtras and to other modules. Change-Id: Iffd7540c1a85f60d6b6a3e658faa69e095d87afa Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Add convenience function to get the API level.Christian Strømme2014-01-161-0/+1
| | | | | | | | | 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: Use the application's class loader when loading Java classes.Christian Strømme2013-09-251-0/+1
| | | | | | | | | 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/+70
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>