summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorFabio Falsini <falsinsoft@gmail.com>2021-07-19 21:16:52 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-27 21:54:47 +0000
commitb17d6b270178523cd1071cc2472c9d4b9789a567 (patch)
tree1dc90fd11ae453c9211981f87fcf1f7cc0f20b5d /src/android
parentc9b5c7ff26618cb2e23c9805e724c32a1a01a238 (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. Change-Id: Iec6f0550064506a780892d3d840f7488fc894569 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 7d7f09d5561a6dec2cb20eb5b0956f11c942e2d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/android')
-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);
}
}