Android: rename m_quitApp to m_retainNonConfigurationInstance

Rename m_quitApp to m_retainNonConfigurationInstance and keep it
inside QtActivityBase since it's only used there based on whether
onRetainNonConfigurationInstance() is called, in wish case,
onDestroy() would skip the Qt specific app destruction/exit logic.

Task-number: QTBUG-118077
Change-Id: I1cf03bd6f5266a9283660db7943d053a9dba889c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
Assam Boudjelthia 2023-11-22 01:11:21 +02:00
parent 9a58062a73
commit c0eca51570
2 changed files with 3 additions and 16 deletions

View File

@ -23,6 +23,7 @@ public class QtActivityBase extends Activity
{
private String m_applicationParams = null;
private boolean m_isCustomThemeSet = false;
private boolean m_retainNonConfigurationInstance = false;
private QtActivityDelegate m_delegate;
@ -143,7 +144,7 @@ public class QtActivityBase extends Activity
protected void onDestroy()
{
super.onDestroy();
if (m_delegate.isQuitApp()) {
if (!m_retainNonConfigurationInstance) {
QtNative.terminateQt();
QtNative.setActivity(null);
QtNative.m_qtThread.exit();
@ -258,9 +259,8 @@ public class QtActivityBase extends Activity
public Object onRetainNonConfigurationInstance()
{
super.onRetainNonConfigurationInstance();
m_delegate.setQuitApp(false);
m_retainNonConfigurationInstance = true;
return true;
}
@Override

View File

@ -40,7 +40,6 @@ public class QtActivityDelegate
private Activity m_activity;
private boolean m_started = false;
private boolean m_quitApp = true;
private boolean m_isPluginRunning = false;
private HashMap<Integer, QtSurface> m_surfaces = null;
@ -119,16 +118,6 @@ public class QtActivityDelegate
return m_started;
}
void setQuitApp(boolean quitApp)
{
m_quitApp = quitApp;
}
boolean isQuitApp()
{
return m_quitApp;
}
boolean isPluginRunning()
{
return m_isPluginRunning;
@ -189,8 +178,6 @@ public class QtActivityDelegate
private void initMembers(Runnable startApplicationRunnable)
{
m_quitApp = true;
m_layout = new QtLayout(m_activity, startApplicationRunnable);
m_displayManager.registerDisplayListener(m_activity, m_layout);