From 9091a058bc61e297abea03edca322edcd658cc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 28 Mar 2017 15:53:42 +0200 Subject: Android: Fix application state tracking - Make sure we don't process state changes before the platform plugin is completely created and registered. - Protect shared data with mutexes. - Don't update the application state from different threads. This was causing issues when testing run-time permission checks, when the application quickly switches state due to permission dialog being shown. In this case the states would be incorrectly delivered when the application was made active again. Change-Id: I3446eab9414ee5437cd788c27d65f808d1314aa5 Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/qandroidplatformintegration.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/android/qandroidplatformintegration.h') diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h index 2337801250..208bb705b7 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/qandroidplatformintegration.h @@ -65,6 +65,9 @@ class QAndroidPlatformNativeInterface: public QPlatformNativeInterface public: void *nativeResourceForIntegration(const QByteArray &resource) override; std::shared_ptr m_androidStyle; + +protected: + void customEvent(QEvent *event) override; }; class QAndroidPlatformIntegration : public QPlatformIntegration @@ -121,7 +124,6 @@ public: QTouchDevice *touchDevice() const { return m_touchDevice; } void setTouchDevice(QTouchDevice *touchDevice) { m_touchDevice = touchDevice; } - static void setDefaultApplicationState(Qt::ApplicationState applicationState) { m_defaultApplicationState = applicationState; } private: EGLDisplay m_eglDisplay; @@ -140,9 +142,6 @@ private: static Qt::ScreenOrientation m_orientation; static Qt::ScreenOrientation m_nativeOrientation; - - static Qt::ApplicationState m_defaultApplicationState; - static bool m_showPasswordEnabled; QPlatformFontDatabase *m_androidFDB; -- cgit v1.2.3