blob: 355c798fee99ae5e191c5eac5d7808b45f52114c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From 6a53bc605a3d987f8f9337716eaef6c52eeb9df8 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 4 May 2025 00:51:18 +0200
Subject: [PATCH 20/25] Allow keeping Android app in background with
QtQuickView
Do not terminate Qt as this would stop the main Qt thread which is not
desirable when the app is supposed to keep running in the background (and
still supposed to process events via the Qt event loop, e.g. to process
network traffic and update a notification accordingly). This change also
makes sure that the absence of an activity or service is treated as if the
app is not a "full" Qt application as we're still just using QtQuickView
here.
Change-Id: I18e2c2a054b19bdbdbe03d189f9a36dcdbe1e204
---
.../jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java | 1 -
src/plugins/platforms/android/androidjnimain.cpp | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java
index fbfe71dd1a8..31cc04fa5fe 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java
@@ -75,7 +75,6 @@ class QtEmbeddedDelegate extends QtActivityDelegateBase
m_activity.getApplication().unregisterActivityLifecycleCallbacks(this);
QtNative.unregisterAppStateListener(QtEmbeddedDelegate.this);
QtEmbeddedViewInterfaceFactory.remove(m_activity);
- QtNative.quitQt();
QtNative.setActivity(null);
}
}
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 131edc5b7a8..ec5a64dd675 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -195,7 +195,7 @@ namespace QtAndroid
return env->IsInstanceOf(QtAndroidPrivate::service().object(), m_qtServiceClass);
// return true as default as Qt application is our default use case.
// famous last words: we should not end up here
- return true;
+ return false;
}
#if QT_CONFIG(accessibility)
--
2.51.0
|