Android: Get rid of the avd info fields in AndroidDeviceInfo

The AVD specific fields don't need to be carried out by QtC settings,
these can be read from the AVD's config file when they are needed.

This also is good because those values can change at any time,
either manually or by some other IDE like Android Studio, and thus
we don't really need to manage them ourselves.

The fields in question are: skin name, target name, sdcard size,
openGL status.

Change-Id: I86163500ec2fed035e32ec02ed17e182778db4a7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2021-10-13 21:16:47 +03:00
parent 3f0c8b2149
commit e5ce9e9e76
10 changed files with 85 additions and 130 deletions

View File

@@ -46,10 +46,6 @@ const char avdInfoPathKey[] = "Path:";
const char avdInfoAbiKey[] = "abi.type";
const char avdInfoTargetKey[] = "target";
const char avdInfoErrorKey[] = "Error:";
const char avdInfoSdcardKey[] = "Sdcard";
const char avdInfoTargetTypeKey[] = "Target";
const char avdInfoDeviceKey[] = "Device";
const char avdInfoSkinKey[] = "Skin";
namespace Android {
namespace Internal {
@@ -81,6 +77,7 @@ static Utils::optional<AndroidDeviceInfo> parseAvd(const QStringList &deviceInfo
avd.avdname = value;
} else if (valueForKey(avdInfoPathKey, line, &value)) {
const Utils::FilePath avdPath = Utils::FilePath::fromUserInput(value);
avd.avdPath = avdPath;
if (avdPath.exists()) {
// Get ABI.
const Utils::FilePath configFile = avdPath.pathAppended("config.ini");
@@ -103,14 +100,6 @@ static Utils::optional<AndroidDeviceInfo> parseAvd(const QStringList &deviceInfo
qCDebug(avdOutputParserLog)
<< "Avd Parsing: Cannot find sdk API:" << avdInfoFile.toString();
}
} else if (valueForKey(avdInfoDeviceKey, line, &value)) {
avd.avdDevice = value.remove(0, 2);
} else if (valueForKey(avdInfoTargetTypeKey, line, &value)) {
avd.avdTarget = value.remove(0, 2);
} else if (valueForKey(avdInfoSkinKey, line, &value)) {
avd.avdSkin = value.remove(0, 2);
} else if (valueForKey(avdInfoSdcardKey, line, &value)) {
avd.avdSdcardSize = value.remove(0, 2);
}
}
if (avd != AndroidDeviceInfo())