diff options
author | Bartlomiej Moskal <[email protected]> | 2025-04-18 09:28:50 +0200 |
---|---|---|
committer | Bartlomiej Moskal <[email protected]> | 2025-05-29 08:01:13 +0000 |
commit | 393c294e102bcd733141539552fda2f148e8b51b (patch) | |
tree | 2b67f515c954870bf56094b693fdf4eb4cea578c /src | |
parent | d446df75990d4ec03ff8b29a11a515f3f982e995 (diff) |
Android: Avoid lazy initialization of QAndroidPlatformServices
In commit ff51ea5418d131248b07e327513b41dad1231f37, lazy initialization
was introduced for QPlatformServices, including
QAndroidPlatformServices. However, this approach causes a regression.
When QAndroidPlatformServices is lazily initialized, the intent listener
registration is delayed. As a result, handling custom URL schemes is
affected - especially those coming from external applications.
To address this issue, this commit removes lazy initialization for
QAndroidPlatformServices.
Fixes: QTBUG-135489
Pick-to: 6.9 6.8 6.5
Change-Id: I24becdf4ac573e7a2ca101cfbc27560d1eb4adef
Reviewed-by: Assam Boudjelthia <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformintegration.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformintegration.h | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index be7fcddf6ee..749871dec4f 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -216,6 +216,7 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_mainThread = QThread::currentThread(); m_androidFDB = new QAndroidPlatformFontDatabase(); + m_androidPlatformServices.reset(new QAndroidPlatformServices); #ifndef QT_NO_CLIPBOARD m_androidPlatformClipboard = new QAndroidPlatformClipboard(); @@ -452,9 +453,6 @@ QPlatformNativeInterface *QAndroidPlatformIntegration::nativeInterface() const QPlatformServices *QAndroidPlatformIntegration::services() const { - if (m_androidPlatformServices.isNull()) - m_androidPlatformServices.reset(new QAndroidPlatformServices); - return m_androidPlatformServices.data(); } diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h index 22f2a6e672b..e050de62540 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/qandroidplatformintegration.h @@ -123,7 +123,7 @@ private: QPlatformFontDatabase *m_androidFDB; QAndroidPlatformNativeInterface *m_androidPlatformNativeInterface; - mutable QScopedPointer<QAndroidPlatformServices> m_androidPlatformServices; + QScopedPointer<QAndroidPlatformServices> m_androidPlatformServices; // Handling the multiple screens connected. Every display is identified // with an unique (autoincremented) displayID. The values of this ID will |