Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.0 FF
-
None
-
-
2023wkXXFOQtforAndroid
Description
I've figured out that if I want to check the permissions directly from the main() function of the Android Service, it gets stuck. The same approach works well for the normal Activity.
Some investigation shows that there might be a deadlock in QtNative.java.
A QCoreApplication::checkPermission() call results in a call to checkSelfPermission() in QtNative.java. It attempts to lock the m_mainActivityMutex, which seems to be still locked by a call to startApplication().
The straightforward solution is to run the QCoreApplication::checkPermission() from a QTimer::singleShot(), that will put it on the event loop.
I'm attaching a small example that reproduces the problem.
Attachments
Issue Links
- relates to
-
QTBUG-89483 Background mode support on Android
- In Progress
- resulted from
-
QTBUG-71396 QGeoPositionInfoSource does not work from Android service
- Closed