Android: Pass pending state to ResumePauseListener
It can happen that updateApplicationState() is called before m_androidPlatformIntegration is set. In such case, new applicationState will be remembered and propagated later. Before this change, pending application state was passed only to QWindowSystemInterface. ResumePauseListeners that are subscribed for changes to ApplicationActive/ApplicationInactive state also should be informed about new application state. Fixes: QTBUG-84737 Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 2eb77139a2deeb88c4d517dd5131f3e45d6acc1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b8f9c649df
commit
136cbafad5
@ -135,8 +135,13 @@ namespace QtAndroid
|
||||
m_androidPlatformIntegration = androidPlatformIntegration;
|
||||
|
||||
// flush the pending state if necessary.
|
||||
if (m_androidPlatformIntegration && (m_pendingApplicationState != -1))
|
||||
if (m_androidPlatformIntegration && (m_pendingApplicationState != -1)) {
|
||||
if (m_pendingApplicationState == Qt::ApplicationActive)
|
||||
QtAndroidPrivate::handleResume();
|
||||
else if (m_pendingApplicationState == Qt::ApplicationInactive)
|
||||
QtAndroidPrivate::handlePause();
|
||||
QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState(m_pendingApplicationState));
|
||||
}
|
||||
|
||||
m_pendingApplicationState = -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user