From 20604cedd84fdf04f5b030c60c04cc1043b3cb7d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 10 May 2021 12:08:56 +0200 Subject: [PATCH] Android: Lower the time-out for license checks An issue in SynchronousProcess causes a time-out when the process output is not terminated with a \n or \r. This workaround lowers the timeout from 600 to 4 so that the unterminated output gets consumed nevertheless, and the user needs to wait only 4 seconds for that. Task-number: QTCREATORBUG-25667 Change-Id: I40f3053c7c4948c27003e9ec73d00a9d660024a4 Reviewed-by: Assam Boudjelthia --- src/plugins/android/androidsdkmanager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index ca66e26576f..c0001e7a39f 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -1014,10 +1014,12 @@ void AndroidSdkManagerPrivate::checkPendingLicense(SdkCmdFutureInterface &fi) AndroidSdkManager::OperationOutput result; result.type = AndroidSdkManager::LicenseCheck; const QStringList args = {"--licenses", sdkRootArg(m_config)}; - if (!fi.isCanceled()) - sdkManagerCommand(m_config, args, m_sdkManager, fi, result, 100.0); - else + if (!fi.isCanceled()) { + const int timeOutS = 4; // Short timeout as workaround for QTCREATORBUG-25667 + sdkManagerCommand(m_config, args, m_sdkManager, fi, result, 100.0, true, timeOutS); + } else { qCDebug(sdkManagerLog) << "Update: Operation cancelled before start"; + } fi.reportResult(result); fi.setProgressValue(100);