Android: Do Thread.sleep before loading Qt libraries in Debug Mode
Amends 269187bfa2 which added the sleep
but just loading the main library.
This commit moves the delay before any library is being loaded. Also log
the fact the thread is sleeping and advertise how to use the env
QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS variable.
Fixes: QTCREATORBUG-30425
Pick-to: 6.7 6.7.0
Change-Id: Ic1370e0b9fcce8c6074f768e5d94e5aa4a0a7824
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
bb10
parent
e68c3f025e
commit
0804109d68
|
|
@ -136,7 +136,7 @@ class QtActivityLoader extends QtLoader {
|
|||
appendApplicationParameters(getDecodedUtfString(extraAppParams));
|
||||
}
|
||||
|
||||
m_debuggerSleepMs = 1000;
|
||||
m_debuggerSleepMs = 3000;
|
||||
if (Os.getenv("QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS") != null) {
|
||||
try {
|
||||
m_debuggerSleepMs = Integer.parseInt(Os.getenv("QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS"));
|
||||
|
|
|
|||
|
|
@ -435,6 +435,13 @@ abstract class QtLoader {
|
|||
ArrayList<String> nativeLibraries = getQtLibrariesList();
|
||||
nativeLibraries.addAll(getLocalLibrariesList());
|
||||
|
||||
if (m_debuggerSleepMs > 0) {
|
||||
Log.i(QtTAG, "Sleeping for " + m_debuggerSleepMs +
|
||||
"ms, helping the native debugger to settle. " +
|
||||
"Use the env QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS variable to change this value.");
|
||||
QtNative.getQtThread().sleep(m_debuggerSleepMs);
|
||||
}
|
||||
|
||||
if (!loadLibraries(nativeLibraries)) {
|
||||
Log.e(QtTAG, "Loading Qt native libraries failed");
|
||||
finish();
|
||||
|
|
@ -511,9 +518,6 @@ abstract class QtLoader {
|
|||
String mainLibPath = getLibrariesFullPaths(oneEntryArray).get(0);
|
||||
final boolean[] success = {true};
|
||||
QtNative.getQtThread().run(() -> {
|
||||
if (m_debuggerSleepMs > 0)
|
||||
QtNative.getQtThread().sleep(m_debuggerSleepMs);
|
||||
|
||||
m_mainLibPath = loadLibraryHelper(mainLibPath);
|
||||
if (m_mainLibPath == null)
|
||||
success[0] = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue