summaryrefslogtreecommitdiffstats
path: root/src/android/jar
diff options
context:
space:
mode:
authorFabio Falsini <falsinsoft@gmail.com>2021-07-19 21:16:52 +0200
committerFabio Falsini <falsinsoft@gmail.com>2021-07-27 22:45:57 +0200
commit7d7f09d5561a6dec2cb20eb5b0956f11c942e2d8 (patch)
treea82800dfaeabe3e9a28df61a09d94bf35f5ea248 /src/android/jar
parent8f75ab231fafc136fef4b973f1241b9b2db30312 (diff)
Add Android service check on quit app
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>
Diffstat (limited to 'src/android/jar')
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtNative.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/QtNative.java
index fcc14783db..c7e6c3b873 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java
@@ -559,8 +559,8 @@ public class QtNative
synchronized (m_mainActivityMutex) {
final Looper mainLooper = Looper.getMainLooper();
final Handler handler = new Handler(mainLooper);
- final boolean actionIsQueued = !m_activityPaused && m_activity != null && mainLooper != null && handler.post(action);
- if (!actionIsQueued)
+ final boolean active = (m_activity != null && !m_activityPaused) || m_service != null;
+ if (!active || mainLooper == null || !handler.post(action))
m_lostActions.add(action);
}
}