forked from qt-creator/qt-creator
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:
@@ -753,28 +753,6 @@ QString AndroidConfig::getAvdName(const QString &serialnumber)
|
||||
return QString::fromLatin1(name).trimmed();
|
||||
}
|
||||
|
||||
AndroidConfig::OpenGl AndroidConfig::getOpenGLEnabled(const QString &emulator) const
|
||||
{
|
||||
QDir dir = QDir::home();
|
||||
if (!dir.cd(QLatin1String(".android")))
|
||||
return OpenGl::Unknown;
|
||||
if (!dir.cd(QLatin1String("avd")))
|
||||
return OpenGl::Unknown;
|
||||
if (!dir.cd(emulator + QLatin1String(".avd")))
|
||||
return OpenGl::Unknown;
|
||||
QFile file(dir.filePath(QLatin1String("config.ini")));
|
||||
if (!file.exists())
|
||||
return OpenGl::Unknown;
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return OpenGl::Unknown;
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
if (line.contains("hw.gpu.enabled") && line.contains("yes"))
|
||||
return OpenGl::Enabled;
|
||||
}
|
||||
return OpenGl::Disabled;
|
||||
}
|
||||
|
||||
//!
|
||||
//! \brief AndroidConfigurations::getProductModel
|
||||
//! \param device serial number
|
||||
|
||||
Reference in New Issue
Block a user