forked from qt-creator/qt-creator
Android: Remove unused functions from AndroidConfig
Change-Id: Ie2a0801eec65a97cc5b67994a6f9b2b07242137f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -41,7 +41,6 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QHostAddress>
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
@@ -49,8 +48,6 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QStringList>
|
|
||||||
#include <QTcpSocket>
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -285,33 +282,6 @@ static FilePath ndkSubPathFromQtVersion(const QtVersion &version)
|
|||||||
// AndroidConfig
|
// AndroidConfig
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
|
|
||||||
QString getAvdName(const QString &serialnumber)
|
|
||||||
{
|
|
||||||
const int index = serialnumber.indexOf(QLatin1String("-"));
|
|
||||||
if (index == -1)
|
|
||||||
return {};
|
|
||||||
bool ok;
|
|
||||||
const int port = serialnumber.mid(index + 1).toInt(&ok);
|
|
||||||
if (!ok)
|
|
||||||
return {};
|
|
||||||
|
|
||||||
QTcpSocket tcpSocket;
|
|
||||||
tcpSocket.connectToHost(QHostAddress(QHostAddress::LocalHost), port);
|
|
||||||
if (!tcpSocket.waitForConnected(100)) // Don't wait more than 100ms for a local connection
|
|
||||||
return {};
|
|
||||||
|
|
||||||
tcpSocket.write("avd name\nexit\n");
|
|
||||||
tcpSocket.waitForDisconnected(500);
|
|
||||||
|
|
||||||
const QByteArrayList response = tcpSocket.readAll().split('\n');
|
|
||||||
// The input "avd name" might not be echoed as-is, but contain ASCII control sequences.
|
|
||||||
for (int i = response.size() - 1; i > 1; --i) {
|
|
||||||
if (response.at(i).startsWith("OK"))
|
|
||||||
return QString::fromLatin1(response.at(i - 1)).trimmed();
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
QLatin1String displayName(const Abi &abi)
|
QLatin1String displayName(const Abi &abi)
|
||||||
{
|
{
|
||||||
switch (abi.architecture()) {
|
switch (abi.architecture()) {
|
||||||
@@ -699,17 +669,6 @@ ExecutableItem devicesCommandOutputRecipe(const Storage<QStringList> &outputStor
|
|||||||
return ProcessTask(onSetup, onDone);
|
return ProcessTask(onSetup, onDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isConnected(const QString &serialNumber)
|
|
||||||
{
|
|
||||||
const QStringList lines = devicesCommandOutput();
|
|
||||||
for (const QString &line : lines) {
|
|
||||||
// skip the daemon logs
|
|
||||||
if (!line.startsWith("* daemon") && line.left(line.indexOf('\t')).trimmed() == serialNumber)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool sdkFullyConfigured() { return config().m_sdkFullyConfigured; }
|
bool sdkFullyConfigured() { return config().m_sdkFullyConfigured; }
|
||||||
|
|
||||||
void setSdkFullyConfigured(bool allEssentialsInstalled)
|
void setSdkFullyConfigured(bool allEssentialsInstalled)
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
#include <QHash>
|
|
||||||
#include <QMap>
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
@@ -40,7 +38,6 @@ public:
|
|||||||
|
|
||||||
namespace AndroidConfig {
|
namespace AndroidConfig {
|
||||||
|
|
||||||
QString getAvdName(const QString &serialnumber);
|
|
||||||
QStringList apiLevelNamesFor(const SdkPlatformList &platforms);
|
QStringList apiLevelNamesFor(const SdkPlatformList &platforms);
|
||||||
QString apiLevelNameFor(const SdkPlatform *platform);
|
QString apiLevelNameFor(const SdkPlatform *platform);
|
||||||
|
|
||||||
@@ -99,7 +96,6 @@ QString bestNdkPlatformMatch(int target, const QtSupport::QtVersion *qtVersion);
|
|||||||
QLatin1String displayName(const ProjectExplorer::Abi &abi);
|
QLatin1String displayName(const ProjectExplorer::Abi &abi);
|
||||||
|
|
||||||
QString getProductModel(const QString &device);
|
QString getProductModel(const QString &device);
|
||||||
bool isConnected(const QString &serialNumber);
|
|
||||||
|
|
||||||
bool sdkFullyConfigured();
|
bool sdkFullyConfigured();
|
||||||
void setSdkFullyConfigured(bool allEssentialsInstalled);
|
void setSdkFullyConfigured(bool allEssentialsInstalled);
|
||||||
|
|||||||
Reference in New Issue
Block a user