AndroidDeviceManager: Execute avd removal in main thread

Instead of executing it blocking in a separate thread.

Change-Id: I0d847f22917edc9782467f173728c13287844acb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-10-05 11:50:59 +02:00
parent 162f9f59d7
commit fbe23282fc
4 changed files with 23 additions and 40 deletions

View File

@@ -141,18 +141,6 @@ QFuture<CreateAvdInfo> AndroidAvdManager::createAvd(CreateAvdInfo info) const
return Utils::asyncRun(&createAvdCommand, m_config, info);
}
bool AndroidAvdManager::removeAvd(const QString &name) const
{
const CommandLine command(m_config.avdManagerToolPath(), {"delete", "avd", "-n", name});
qCDebug(avdManagerLog).noquote() << "Running command (removeAvd):" << command.toUserOutput();
Process proc;
proc.setTimeoutS(5);
proc.setEnvironment(m_config.toolsEnvironment());
proc.setCommand(command);
proc.runBlocking();
return proc.result() == ProcessResult::FinishedWithSuccess;
}
static void avdConfigEditManufacturerTag(const FilePath &avdPath, bool recoverMode = false)
{
if (!avdPath.exists())