summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroideventdispatcher.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Android: add logging for AndroidDeadlockProtectorAssam Boudjelthia2025-08-261-1/+4
| | | | | | | | | | | Have AndroidDeadlockProtector instance provide a string as an identifier of where it's going to be acquired so that when another code try to acquire we can have better logs of what can potentially go wrong. Pick-to: 6.10 Change-Id: I14abc0058831c5f23f2d96c6ce0231a6e0cc8f68 Reviewed-by: Ville Voutilainen <[email protected]>
* Android: move AndroidDeadlockProtector to QtAndroidPrivate namespaceAssam Boudjelthia2025-08-261-2/+1
| | | | | | | | | | This way it can be used by all Qt code and not only under the platform plugin and avoid cases where it's forgotten to manually release it when only using acquireAndroidDeadlockProtector(). Pick-to: 6.10 Change-Id: Ie7658b4057d499c470cf7d8706928870edabcf0e Reviewed-by: Ville Voutilainen <[email protected]>
* Android: fix deadlock protector locking in QAndroidEventDispatcherAssam Boudjelthia2025-08-261-1/+1
| | | | | | | | | | | | | | | | | The order of conditions in QAndroidEventDispatcher::processEvents() causes excessive and unnecessary locking for AndroidDeadlockProtector with every call to processEvents() and in the majority of the cases it's not needed at all. QAndroidEventDispatcher is mainly used when setting the app's state or when creating the window surface, for that reason we end up with calls first locking the deadlock protector and then check m_stopRequest that most of the time is false. To avoid any issues with trying to acquire same lock over and over and to be more effecient the check for m_stopRequest needs to comes first. Pick-to: 6.5 6.8 6.9 6.10 Fixes: QTBUG-132695 Change-Id: Iaa9a019ad666e2da073454d6473bba65c6c18418 Reviewed-by: Ville Voutilainen <[email protected]>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-3/+3
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <[email protected]>
* Apply Q_CONSTINIT where beneficialSona Kurazyan2022-09-011-1/+1
| | | | | | | | | | Applied Q_CONSTINIT to variables with static storage duration, but skipped the POD types with core constant initializers. Task-number: QTBUG-100486 Change-Id: Iaabf824e9cb0f29a405a149912200d4e4b3573c1 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-2/+2
| | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <[email protected]>
* Android: Fix data race in QAndroidEventDispatcherStopperVyacheslav Koscheev2017-02-071-4/+2
| | | | | Change-Id: If5f8406d7af2d91e267a0ba380e73287feabac9f Reviewed-by: BogDan Vatra <[email protected]>
* Android: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-04-251-3/+3
| | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I9158c507f9249a7322b11c982bfcab1e6ed4a38a Reviewed-by: Olivier Goffart (Woboq GmbH) <[email protected]>
* Updated license headersJani Heikkinen2016-01-151-13/+19
| | | | | | | | | | | 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 <[email protected]>
* QAndroidEventDispatcher: Remove dependency on select(2)Louai Al-Khanji2015-12-181-13/+5
| | | | | | Change-Id: I4c23816a3a665cf2fa40705efe721b6f43fa3146 Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: BogDan Vatra <[email protected]>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-4/+7
|\ | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| * Avoid deadlock on suspend/resumePaul Olav Tvete2015-03-161-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | On some devices, there is a possibility of getting a state change while we are locking the event loop for suspend. This is probably related to change 8c0ef140b3a7202c, but we should in any case use the existing deadlock protection mutex mechanism, just to make sure that there are not other cases which could trigger the same deadlock. Task-number: QTBUG-44339 Change-Id: I3e0b5fa2ddf4ef86e6b29cb1d67c4cccedd8242e Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* | Update copyright headersJani Heikkinen2015-02-111-6/+6
|/ | | | | | | | | | | | | | | | | | 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 <[email protected]>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <[email protected]>
* Android: Avoid deadlocks on suspendPaul Olav Tvete2014-09-031-8/+13
| | | | | | | | | | | | Get rid of the rendezvous at shutdown: the android thread does not need to wait for the GUI thread. Since the GUI thread frequently does blocking calls to the android thread, this fixes several known and potential deadlocks. Task-number: QTBUG-41072 Change-Id: Ia6fa8da026b1727e7352b22f4df4d72b63b8c847 Reviewed-by: BogDan Vatra <[email protected]> Reviewed-by: Christian Stromme <[email protected]>
* Android: Really suspend apps that are put in the backgroundBogDan Vatra2014-07-311-0/+149
The main event loop will be paused when an application is suspended, this is also the normal behavior of any Android application. When an application is suspended on Android all its Gl surfaces are destroyed and can't be used to render anymore. So, we need to pause the main event loop in order to pause all the timers which might trigger drawings. The event loop is resumed immediately after the application is foreground. AndroidManifest.xml contains more info about how to disable this behavior and what might happen if you do it. [ChangeLog][Android][Important Behavior Changes] The main event loop is now stopped when the app is suspended Task-number: QTBUG-36274 Change-Id: I4c0ba5df9d95f348bca67ea5c76865d6d20775e4 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Paul Olav Tvete <[email protected]>