summaryrefslogtreecommitdiffstats
path: root/src/android/jar/src/org/qtproject/qt/android/QtNative.java
Commit message (Collapse)AuthorAgeFilesLines
* Android: Notify listener about app state changes when quittingPetri Virkkunen2024-04-301-1/+1
| | | | | | | | | | Specifically the isStarted flag is set to false in QtNative.quitApp. This should be listened to by functionality interface providers to unregister their interfaces, in case the Activity is restarted. Task-number: QTBUG-118874 Change-Id: Iadf5ab548c4e865c89ed4b83d258f09d6c767e16 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Extend app state listener interface with native plugin statePetri Virkkunen2024-04-301-1/+10
| | | | | | | | | | | | Instead of using the generic onAppStateDetailsChanged function, use a specific callback for native plugin readiness state in cases where only native plugin readiness matters. Add default empty implementations for both functions in the interface. Task-number: QTBUG-118874 Change-Id: Ie736b0e7789400421247648cb3a008712fd959c5 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: runAction can now be run past queueLauri Pohjanheimo2024-04-091-6/+16
| | | | | | | | | | | | On vulkan implementation it was possible that when going background destroySurface was queued and then run when coming back foreground that caused vulkan not being able to draw. Fixes: QTBUG-118985 Fixes: QTBUG-118840 Pick-to: 6.7 Change-Id: I5957b74b89384ea84fc09d9b55afcccf5c82e390 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: run runAction() actions in onPause stateLauri Pohjanheimo2024-02-261-2/+4
| | | | | | | | | | Fixes QTBUG-113255 by running graphics related actions also onPaused state when the paused app is visible. Also corrects possible other problems where UI should be updated while app is onPaused state. Fixes: QTBUG-113255 Pick-to: 6.7 Change-Id: I02ee6b0713ec5f08ebba676c5edf94d2c1f81958 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add possibility to listen for changes in app statesTinja Paavoseppä2024-01-161-0/+31
| | | | | | | | | | This is useful for example the embedded QML case, where we want to make sure everything from Qt side is ready before we start to create Qt windows. Pick-to: 6.7 Change-Id: I8148405e35cc8ebb89110f05e07cef06f8ff3709 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Give raster windows their own surface, and flush via RHITinja Paavoseppä2023-12-071-1/+1
| | | | | | | | | | | | | | Refactored platform windows on Android so that all window types, including raster windows, have their own surface to draw on. Raster windows now flush the backing-store via RHI/OpenGL. As a drive by, update to newer JNI syntax where appropriate. Task-number: QTBUG-116187 Change-Id: I3b764b7126abf53556750b0ccbb7d27efe007bc1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Android: accept both spaces and tabs separators for env vars and argsAssam Boudjelthia2023-11-301-2/+2
| | | | | | | | | | | | | | | | | The requirement for separating the app args by tabs only is not justified, since the the args are passed as a string to C++ where QProcess::splitCommand() is used to get a list of single args and that knows how to handle the parsing properly anyway. As for env vars, QtLoader currently expects env vars to be separated by tabs only, however, to account for different use cases, it should handle both tabs and spaces. Task-number: QTBUG-115016 Task-number: QTBUG-106478 Task-number: QTQAINFRA-5703 Change-Id: I58258861477776b82294a4c2603b230f178f16a6 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: rectify the visibility of QtAndroid.jar classAssam Boudjelthia2023-11-281-1/+1
| | | | | | | | | | | | | Since we expect soon to support embedding of Qt from native Android apps, and allowing native apps to access some Qt java classes as API to enbale the embedding, it's needed now to set the visibility to public only to classes that are meant to be public. Task-number: QTBUG-115017 Change-Id: Iec73f8d39bf9c5f7d303176b2b345d5928fb46c7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Android: rename isPluginRunning to isNativePluginIntegrationReadyAssam Boudjelthia2023-11-281-0/+7
| | | | | | | | | This has been used to notify that the platform integration is setup and ready, now the name is more descriptive of what it does. Task-number: QTBUG-118077 Change-Id: I9fab525f07433f9ec8057e2475a3b1e4658f84d9 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: rework app state trackingAssam Boudjelthia2023-11-281-16/+32
| | | | | | | | | | | Cleanup 'isStarted' and state management logic and move it to QtNative. Currently, it's spread between QtActivityDelegate and QtNative where multiple variables are used for overlapping use cases. Task-number: QTBUG-118077 Change-Id: I2c98b48be78809c30636bfdf6d6640317470cec6 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: don't return an unused result from QtNative.startApplication()Assam Boudjelthia2023-11-241-6/+6
| | | | | | | | | No one is using that return code, instead print an error when the call to startQtAndroidPlugin() fails. Task-number: QTBUG-118077 Change-Id: I98c8e4ca9af5f1c45af36044336d461bed6acdc9 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: fix few deprecation and wrong code usage warningsAssam Boudjelthia2023-11-241-0/+1
| | | | | | | | | | * Some more leftover unused imports. * Deprecated API, especially reflection warnings. * Some unused method parameters warnings. Task-number: QTBUG-118077 Change-Id: Ic9b7d5b69ef64aaf640bc9f53a13428f1c49278c Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: support lambda expressions in Java codeAssam Boudjelthia2023-11-241-35/+12
| | | | | | | | | | | use -classpath instead of -bootclasspath param to allow javac to use the default boot class path to support building lambdas, pass the user Android class via -classpath. Task-number: QTBUG-118077 Change-Id: I1ba8274d57e1bd528a1d5b7d779191e7f1412184 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: use WeakReference for static activity/service objectsAssam Boudjelthia2023-11-231-20/+35
| | | | | | | | | Wrap the activity and service static objects with a WeakReference to fix a potential memory leak warning. Task-number: QTBUG-118077 Change-Id: Ifafd137cc49ec5ea23d8425b6bd58b43573970b9 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: add note on usage of QtNative.runAction()Assam Boudjelthia2023-11-231-0/+2
| | | | | | Task-number: QTBUG-118077 Change-Id: I2a743c1b65733e1ca0bf20d172d35c46d7ec8b08 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: don't directly access m_qtThread memberAssam Boudjelthia2023-11-231-1/+1
| | | | | | Task-number: QTBUG-118077 Change-Id: I2103483a2bfa8abe9be832790611b07a5d011f76 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: add @UsedFromNativeCode annotation for java method used in c++Assam Boudjelthia2023-11-221-0/+11
| | | | | | | | | | | | | | | | To get rid of unused method warnings in Java code for methods used only from C++ code and make it more visible which methods are used by native code. This annotation would need to be added to the relevant methods in this patch or future one. Use this annotation for all methods called from native code. And along the way remove few methods that are not used anywhere. Task-number: QTBUG-118077 Change-Id: Ie493fb057f4a93aff513f85e0936bc65a9bb304c Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: cleanup up warnings in QtNative codeAssam Boudjelthia2023-11-181-94/+60
| | | | | | | | few cosmetic changes, and warning fixes in QtNative code. Task-number: QTBUG-118077 Change-Id: I0b064b59005f3cd50cf56221ce2287d72842a65c Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: don't call delegates outside of the ActivityAssam Boudjelthia2023-11-101-166/+5
| | | | | | | | | | | | | | | | | | | | | The delegate classes shouldn't be used outside of the Activity/Service classes, since they're practically private implementation, so don't use them anywhere outside Activity/Service. Since Qt Android apps still mainly support having one QtActivity/ QtService, QtNative heavily uses those objects to do various operations. For that reason, we still need to use the delegate there. The aim is to change that in future patches and do the operations where they make more sense for example directly under QtActivityBase/QtActivityDelegate or Service counterpart. The QtServiceDelegate is used no where and have no special implementation, so it's removed here. Task-number: QTBUG-118077 Change-Id: I5e106318169be19fec8163e8e500ee573af0e1bc Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Android: don't call setApplicationDisplayMetrics() from QtNativeAssam Boudjelthia2023-11-101-1/+0
| | | | | | | | | | | | | | It's not immediately clear why setApplicationDisplayMetrics() is called from within QtNative.startApplication() while it's also called by QtLayout.onSizeChanged(), it seems to be a redundant call when starting the native Qt app because QtLayout takes care of it already. Task-number: QTBUG-115016 Task-number: QTBUG-118077 Change-Id: I54e8af6356226ca5f1b849ef323be9659b9db663 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Android: remove a11y methods from QtNative, call a11y delegate directAssam Boudjelthia2023-11-061-72/+1
| | | | | | | | | | | Remove yet another two layers of delegation, QtNative calling QtActivityDelegate and that in turn calls QtAccessibilityDelegate. Now from c++ native code, acquire the a11y delegate and use it to call a11y operations that live in QtAccessibilityDelegate. Task-number: QTBUG-118077 Change-Id: I9e84520c2caa281a6f786a687b0106d702f92a67 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: move display and screen management to new QtDisplayManagerAssam Boudjelthia2023-11-021-106/+2
| | | | | | | | | | Have all or most of Android code dealing with displays in QtDisplayManager. Also, simplify setApplicationDisplayMetrics() call and avoid caching any uneccessary members. Task-number: QTBUG-118077 Change-Id: I943069c24bb40ae3016db5896e553b501e700a6b Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: Move clipboard management to own classAssam Boudjelthia2023-10-301-173/+0
| | | | | | | | | | | | | | | Move all clipboard management logic outside of QtNative and to own QtClipboardManager class. Also, don't keep any keep Activity objects under it to avoid memory leaks, the native c++ clipboard manager should be responsible of passing a context when needed instead. As a pass-by, use newer JNI APIs for C++ QtAndroidClipboard code. Task-number: QTBUG-118077 Change-Id: I61726e84a75918d80329f753e9e1c6ebde179bf4 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: modularize and simplify QtLoader classesAssam Boudjelthia2023-10-271-138/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt loader is now expected to work in the following way: QtActivity.onCreate() --| QtActivityBase.onCreate() ----| Initiaze the delegate ----| Creates QtActivityLoader() ------| Creates QtLoader() --------| Initialize the class loader --------| Initialize static classes context --------| Initialize Context Info ------| Sets common environment variables and parameters from metadata ------| Setup style extraction ------| Sets Activity specific metadata --| Handles Activity themes --| Call QtLoader.loadQtLibraries() ----| Fetch and load Qt native libraries ----| Fetch and load the app's main library --| Start the Qt Native C++ app via the delegate Few things are done in patch to simplify the Qt loader mechanism: 1) Get rid of some unused methods, and move the loader instances to be local instead of global. 2) Split the awfully long methods in QtLoader into smaller methods for readability and as preparation for next simplifications. 3) Refactor Qt libraries loading code from the Delegate classes to the Loader classes where it makes more sense to be at. At the same time simplify some code into smaller logical blocks. 4) The same boilerplate code for loading (with System.load()) Qt libs and the main library was done twice between the Activity and Service loaders, that is now done directly under the QtLoader. Same story for initializing static Java classes with activity/service/context. With this change All relevant Qt library loading logic is now under QtLoader classes, and the latter have clear loader responsibilities reflected in the code. Task-number: QTBUG-115016 Change-Id: Ib76621d8beff4917c932456c5401ea4586942213 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: move input handling from QtActivityDelegate to separate classAssam Boudjelthia2023-10-181-270/+8
| | | | | | | | | | | | | | | | | | | | | | | | To further simplify the code and logic of the delegate, move keyboard input code to separate class. Make an input delegate available under the QtActivityDelegate to allow classes like QtNative and the Activity to access that. For now, it's okay to leave access from QtNative to that, but for future even that should be simplified and the Activity should be accessing that directly. For the case where the QtInputDelegate needs access to QtActivityDelegate, for now namely updateFullScreen(), a new Listener is implemented to be implemented under QtActivityDelegate. Along the way use newer JNI APIs under C++ QtAndroidInput. Don't make them static methods, so that it can be possible later to do various keyboard operations to specific activity and not a global one. Task-number: QTBUG-114593 Task-number: QTBUG-118077 Change-Id: I110b897f6f16d0ae5f5a645551b4a82e8ad3f2fb Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Android: extract various constants into one common classAssam Boudjelthia2023-10-121-1/+1
| | | | | | | | | | Various constant keys were duplicated in QtActivityDelegate, QtServiceDelegate and QtLoader classes, and this de-duplicates that. Task-number: QTBUG-115014 Task-number: QTBUG-114593 Change-Id: I3479fbb58293b26b7625f8653289c6b6d987a59f Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Handle ACTION_POINTER_UP with tablet eventsJuha Vuolle2023-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The ACTION_POINTER_UP is used when a non-primary pointer (touch, mouse stylus, eraser) goes up. Without handling this action in these cases, the table event remains in 'down' state (misses the QEvent::TabletRelease) and as a consequence when it is next put on the screen, eg. a line will be drawn to the new position (in case of a drawing application). In addition use getActionMasked() to get the action; non-masked events would contain the index of the pointer too, and wouldn't match with ACTION_POINTER_UP whose numeric value is 6. Rather the actions would be in the lines of: 261, // ACTION_POINTER_DOWN(1), 6 with getActionMasked() 517, // ACTION_POINTER_DOWN(2), 6 with getActionMasked() And so on. Pick-to: 6.6 6.5 Fixes: QTBUG-86297 Change-Id: I1b50ca4d19b611aec8a5c280ed0521e2f11797b0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Fix for checking clipboard text mime typeBartlomiej Moskal2023-07-121-2/+2
| | | | | | | | | | | | | | | | | | | | | Different mime types are widely used on mobile devices. For example all text copied from gmail is copied as text/html type. After 2937cf91c74b6562bf56e8872dfd2bfaafebb3cc commit there is a regression that makes it impossible to paste any text different than "text/plain". To fix it, any "text/*" mime type should be treat as it contains a text (not only "text/plain"). That will allow to paste different text mime types. During this work also tst_qclipboard testset was turned on for Android and new test (getTextFromHTMLMimeType) was added. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-113461 Change-Id: I3ef9476b8facdc3b61f144bd55222898390127c9 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: improve screen size and physical size calculationAssam Boudjelthia2023-06-101-0/+23
| | | | | | | | | | | | | | | | | | | Use new api calls for calculating pixel size and physical size of multi-display setups after some existing apis have been deprecated in Android API 30 and 31. Also, do the physical size calculation outside of the supported modes loop. As for the physical size, this patch still uses xdpi/ydpi for the calculation instead of densityDpi as suggested in [1] because from testing few scenarios, the results returned from xdpi/ydpi are more consistent with physical device specs. [1] https://issuetracker.google.com/issues/194120500 Pick-to: 6.6 6.5 Task-number: QTBUG-112742 Change-Id: I0c8ef5185c8b6463830b528374954c324a32d657 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: Add facilities to handle more content URIs operationsAssam Boudjelthia2022-12-141-206/+0
| | | | | | | | | | | | | | | | | | | | Use DocumentFile and DocumentsContract to support more operations on content URIs, such as: * listing files and subdirectories with usable content uris * mkdir, rmdir * creating non-existing files under a tree uri * remove And since dealing with content URIs require some level of user interation, manual tests were added to cover what's been implemented. Note: parts of the code were from from BogDan Vatra <bogdan@kdab.com>. Pick-to: 6.4 6.2 Task-number: QTBUG-98974 Task-number: QTBUG-104776 Change-Id: I3d64958ef26d0155210905b65daae2efa3db31c1 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Add handling of screen hotplugPiotr Mikolajczyk2022-12-131-0/+14
| | | | | | | | | | | When a display is connected to an Android device a notification is sent to the platform layer of the application. The QAndroidPlatformIntegration will create a platform screen and add it to QWindowSystem. Task-number: QAA-1257 Change-Id: Id2cf6b47363630c3b5c93c0bc778e2058d8372b3 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QGuiApplication on Android can now detect multiple displaysWojciech Błaszak2022-10-261-0/+15
| | | | | | | | | | | | | | - Extending QtNative.java with access to DisplayManager and get details about available displays - Extending Android Platform Integration with display's list handling - Change QAndroidPlatformScreen to initialize itself from QJniObject representation of an android Display object - Move initialization of Primary display from QAndroidPlatformScreen to QAndroidPlatformIntegration Change-Id: I3d8f97f5cf9f81bbecc8716c25ff323097e57a15 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix crash on access clipboard on AndroidSamuel Mira2022-10-261-2/+4
| | | | | | | | | | | | A case where the accessing the clipboard is done when the application does not have the input focus. Android does not allow access in this case and returns null on the getPrimaryClip. This happens on some examples like Analog Clock. Does not happen on autotests. Fix was adding a test for null. Fixes: QTBUG-107926 Change-Id: I685594545e5ae8102c257c033fffbcc4f20cef9a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Stop using getPrimaryClipDescriptionSamuel Mira2022-10-181-26/+18
| | | | | | | | | | | | | The function getPrimaryClipDescription was used to establish if the clipboard data had text, html and/or uris. Analysing QTBUG-106646 and tst_qquicktextedit showed inconsistent results, namely the description hasMimeType failed to find html mimetype on copy&paste. This patch changes it for searching it by hand instead of using hasMimeType function. Task-number: QTBUG-106646 Change-Id: I8918938e7a3fa6953eac95b72959fca85050e52f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: Light/dark modes detectionBartlomiej Moskal2022-09-051-0/+1
| | | | | | | | | | | After commit: 2248487c6ca9d5459c70a16868d5aeee07d96157 light/dark mode detection is supported by Windows and macOS. This commit add similar implementation on the Android side. Task-number: QTBUG-83185 Pick-to: 6.4 6.3 6.2 Change-Id: Id1ece98e91a31759b58d651ef62b3715ea25d85f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android A11Y: Notify android about scroll eventsJens Trillmann2022-08-291-0/+12
| | | | | | | | | | | | | | | | | | | | QtQuick Flickable has an issue that after a scroll the previously hidden items are not added to the A11Y hierarchy. That happens because Android has no ways to detect that something has changed. This patch uses the ScrollingEnd event to notify Android A11Y backend that the Flickable was scrolled, so that it could update the A11Y hierarchy and add the previously hidden nodes. The ScrollingEnd event generation is added to QQuickFlickable in a separate commit. Task-number: QTBUG-103513 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Ie6cd688d56343bcfe7ce9580c0b9244dd6d6c068 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Android A11Y: handle LocationChanged event only for focused elementIvan Solovev2022-05-161-2/+2
| | | | | | | | | | | | | | | | | | LocationChanged event unconditionally triggered invalidateVirtualViewId call. That call results in TYPE_WINDOW_CONTENT_CHANGED Android event, which causes a lot of background processing. That is not correct, because LocationChanged event is generated by every accessible element, not only the one that has A11Y focus. This patch checks event->uniqueId(), and processes only events that come from the focused accessible element. Done-with: Mike Achtelik <mike.achtelik@gmail.com> Task-number: QTBUG-102594 Pick-to: 6.3 6.2 5.15 Change-Id: I6b941733c9d215fed5ee5a7aeeb5be234add9ebe Reviewed-by: Mike Achtelik <mike.achtelik@gmail.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix restart QtActivitySamuel Mira2022-04-271-1/+11
| | | | | | | | | | | | | | | | | | Previously, a restart of QtActivity on Android would make the application fail with a blank screen. That happened because the QtActivity tried to reload the whole application and failed. With this patch, the QtActivity detects if the application is restarting by checking if QtNative and QtActivityDelegate are live and updates the connections on those objects accordingly. It allows the application to continue as before. In case that is not possible, the QtActivity will restart the application. Fixes: QTBUG-38971 Fixes: QTBUG-102298 Pick-to: 5.15 6.2 6.3 Change-Id: Id500d20b185d57b39d45d34eeaa99745a3c2b95b Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: use empty Intent to clear clipboard data on API < 28Ivan Solovev2022-03-181-3/+10
| | | | | | | | | | | | | | | | ClipboardManager didn't have any APIs to clear clipboard data before API level 28. As a workaround an empty Intent with MIMETYPE_UNKNOWN is created and inserted into the clipboard for lower API levels. This makes the QApplication::clipboard()->clear() method work more or less as expected. This allows to unblacklist tst_QPlainTextEdit::copyAvailable(). Task-number: QTBUG-87423 Task-number: QTBUG-89402 Pick-to: 6.3 6.2 Change-Id: I454376199cf3b8eed0fa2ecf2f85b87f40892280 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Fix issue in loading multimedia Android pluginSamuel Mira2022-03-021-3/+38
| | | | | | | | | | | | | | Qt projects on Android were failing to correctly load the plugin lib. The main reason is missing environment variables when the media integration starts. To make sure that the variables are loaded, I have change the setenv to be done in the java side instead of c++ side. Fixes: QTBUG-100299 Pick-to: 6.3 Change-Id: Iba0b6af40574be2d88824ebdcfb1626335cecf09 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android A11Y: handle valueChanged eventsIvan Solovev2022-02-151-0/+12
| | | | | | | | | | | | | | | | | | | | | Before this patch Android A11Y implementation was missing ValueChanged event handling. As a result, no update was given when the element's value was changed. Handling these events allows us to announce value changes on such objects like Slider, SpinBox, etc... This is a universal method of value-change announcement, so it supports all sorts of A11Y gestures. On the Java side a new function was introduced to announce the values, because we need to use the actual element's *value*, not its accessible name or description. Task-number: QTBUG-93396 Pick-to: 6.3 6.2 5.15 Change-Id: Ic44abd5f01b9b6f5468962131466edaf6a49d498 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: extract parentId for hidden object in advanceIvan Solovev2022-02-091-2/+2
| | | | | | | | | | | | | | | | | | This commit amends 850a7f1238e84b6960a84e12687e40cf939a44d9. We can't extract the parentId for the hidden object on Java side, because the Java call is executed in a separate thread, so the original hidden object can be destroyed somewhere in the middle of parentId() call. As a workaround, we get the parentId in advance, on C++ side, and pass it as a parameter to JNI function. Task-number: QTBUG-95764 Pick-to: 6.3 6.2 5.15 Change-Id: Ied2ab4ab39b947f3f582575cf77cc76fbac9e274 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* [Android]: Handle the screen name, modes and refreshRate properlyBogDan Vatra2022-01-281-39/+23
| | | | | | | | | Fixes: QTBUG-87136 Fixes: QTBUG-93823 Fixes: QTBUG-94959 Pick-to: 6.3 6.2 5.15 Change-Id: Id480e22611ec949b5e3ee780fc695fb502a5950c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: add methods to get the FileDescriptor for a UriAssam Boudjelthia2021-12-031-0/+32
| | | | | | | | | | | | | This can be useful for some cases when the Android APIs have calls that expects a FileDescriptor instead of a Uri or an int file descriptor (like a case in Qt Multimedia with MediaRecorder). Pick-to: 6.2 Task-number: QTBUG-96081 Task-number: QTBUG-96957 Change-Id: I0ab8d37a43b7cb94f6ebb5d48014e5a7903aadc7 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: simplifications to exception messages for content file handlingAssam Boudjelthia2021-12-031-76/+63
| | | | | | | | | | | | | | | | The method getUriWithValidPermission() now returns null only if the Uri couldn't be parsed, otherwise, returns the parsed Uri and fail later when used if it doesn't have permissions for example. Also, Don't use use hardcoded strings for method names, and print the exception message instead of the whole stack. Pick-to: 6.2 Task-number: QTBUG-96081 Task-number: QTBUG-96957 Change-Id: If7ba88265c9683e6660cb483cfee6c22016f2976 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: Treat ACTION_CANCEL as TouchCancelEventMike Achtelik2021-10-291-2/+9
| | | | | | | | | | | | | | | | | | | | Change 64d62c53c1e92a1cc07449a0ea3c71501592c1e7 started treating an ACTION_CANCEL as a TouchPointReleased. This leads to unintentional presses, if e.g. an edge swipe for the android back gesture starts on a MouseArea. When Android takes possession of the motion, an ACTION_CANCEL is delivered, which needs to be handled as such. It should not be treated as a normal up event that triggers a press. Otherwise, we get the above-mentioned issue, where an unintentional action is performed. So let's use QWindowSystemInterface::handleTouchCancelEvent to treat it as a canceled touch in Qt. Task-number: QTBUG-72110 Pick-to: 6.2 5.15 Change-Id: I68650a180130501568e5a1e9a7f20ea469461e97 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "Android: Place cursor correctly on screen when editing"Rami Potinkara2021-10-261-16/+1
| | | | | | | | | | | | | | | This reverts commit 5c6b10c3cee5737dbc041d0463220898c8120807. It caused a regression such that the main window no longer resized or panned when the VKB is shown, in spite of android:windowSoftInputMode being set. Pick-to: 6.2 5.15 Task-number: QTBUG-95300 Task-number: QTBUG-96117 Task-number: QTBUG-97503 Change-Id: If56e1113eea69a940f6760bdb2ad06a93a0759c1 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix access to content: URLs with transient read/write permissionsVolker Krause2021-08-231-17/+21
| | | | | | | | | | | | | | | | The current code assumed that the lack of persistent permissions means we cannot access the file at all. That however isn't the case for content: URLs we get e.g. via Intents, those are accessible perfectly fine via QFile, we just don't have (and can't obtain) persistent permissions for them. This is done by continuing in the case of not having persistent permissions and checking for SecurityExceptions that are thrown when accessing content: URLs we really have no permission for. Pick-to: 6.2 5.15 Change-Id: I39115a7730d717eb9517e4f1c1a57e40988001a5 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Add Android service check on quit appFabio Falsini2021-07-271-2/+2
| | | | | | | | | | | | | | When quitApp() delegates the quit action to runAction(), this function only checks if an activity exists. If the process is a service, rather than an activity, it has no activity, so the action is skipped and the service is not exited. Check in runAction() for a service as well as an activity. Pick-to: 6.2 Change-Id: Iec6f0550064506a780892d3d840f7488fc894569 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>