Android: Fix handling unsuccessful AVD start

We do want to execute onSerialNumberDone, even when
startAvdRecipe finished with an error.

Amends d211208011

Change-Id: Iaa209c37bd05b0319a36541df6c8f06c21ab02ca
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Jarek Kobus
2024-10-30 08:40:14 +01:00
parent a6b2cb67db
commit e6c3c8c434

View File

@@ -362,10 +362,8 @@ GroupItem AndroidDeployQtStep::runRecipe()
{
const Storage<QString> serialNumberStorage;
const auto onSerialNumberGroupSetup = [this] {
return m_avdName.isEmpty() ? SetupResult::StopWithSuccess : SetupResult::Continue;
};
const auto onSerialNumberSync = [this, serialNumberStorage] {
const auto isAvdNameEmpty = [this] { return m_avdName.isEmpty(); };
const auto onSerialNumberDone = [this, serialNumberStorage] {
const QString serialNumber = *serialNumberStorage;
if (serialNumber.isEmpty()) {
reportWarningOrError(Tr::tr("The deployment AVD \"%1\" cannot be started.")
@@ -411,11 +409,10 @@ GroupItem AndroidDeployQtStep::runRecipe()
};
return Group {
Group {
If (!Sync(isAvdNameEmpty)) >> Then {
serialNumberStorage,
onGroupSetup(onSerialNumberGroupSetup),
AndroidAvdManager::startAvdRecipe(m_avdName, serialNumberStorage),
Sync(onSerialNumberSync)
onGroupDone(onSerialNumberDone)
},
deployRecipe(),
For (iterator) >> Do {