forked from qt-creator/qt-creator
Android: Get rid of unused functions
They got replaced by the corresponding recipes. Change-Id: I1b42a9fb230869fde3daf03feb33ca2d1e89bb01 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -25,13 +25,6 @@ namespace Android::Internal::AndroidAvdManager {
|
||||
|
||||
static Q_LOGGING_CATEGORY(avdManagerLog, "qtc.android.avdManager", QtWarningMsg)
|
||||
|
||||
QString startAvd(const QString &name, const std::optional<QFuture<void>> &future)
|
||||
{
|
||||
if (!findAvd(name).isEmpty() || startAvdAsync(name))
|
||||
return waitForAvd(name, future);
|
||||
return {};
|
||||
}
|
||||
|
||||
// TODO: Make async and move out of startAvdImpl, make it a part of startAvdRecipe.
|
||||
static bool is32BitUserSpace()
|
||||
{
|
||||
@@ -198,37 +191,6 @@ ExecutableItem serialNumberRecipe(const QString &avdName, const Storage<QString>
|
||||
};
|
||||
}
|
||||
|
||||
static bool waitForBooted(const QString &serialNumber, const std::optional<QFuture<void>> &future)
|
||||
{
|
||||
// found a serial number, now wait until it's done booting...
|
||||
for (int i = 0; i < 60; ++i) {
|
||||
if (future && future->isCanceled())
|
||||
return false;
|
||||
if (isAvdBooted(serialNumber))
|
||||
return true;
|
||||
QThread::sleep(2);
|
||||
if (!AndroidConfig::isConnected(serialNumber)) // device was disconnected
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString waitForAvd(const QString &avdName, const std::optional<QFuture<void>> &future)
|
||||
{
|
||||
// we cannot use adb -e wait-for-device, since that doesn't work if a emulator is already running
|
||||
// 60 rounds of 2s sleeping, two minutes for the avd to start
|
||||
QString serialNumber;
|
||||
for (int i = 0; i < 60; ++i) {
|
||||
if (future && future->isCanceled())
|
||||
return {};
|
||||
serialNumber = findAvd(avdName);
|
||||
if (!serialNumber.isEmpty())
|
||||
return waitForBooted(serialNumber, future) ? serialNumber : QString();
|
||||
QThread::sleep(2);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static ExecutableItem isAvdBootedRecipe(const Storage<QString> &serialNumberStorage)
|
||||
{
|
||||
const auto onSetup = [serialNumberStorage](Process &process) {
|
||||
|
||||
@@ -2,18 +2,12 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
#pragma once
|
||||
|
||||
#include <QFuture>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include <solutions/tasking/tasktree.h>
|
||||
|
||||
namespace Android::Internal::AndroidAvdManager {
|
||||
|
||||
QString startAvd(const QString &name, const std::optional<QFuture<void>> &future = {});
|
||||
bool startAvdAsync(const QString &avdName);
|
||||
QString findAvd(const QString &avdName);
|
||||
QString waitForAvd(const QString &avdName, const std::optional<QFuture<void>> &future = {});
|
||||
bool isAvdBooted(const QString &device);
|
||||
|
||||
Tasking::ExecutableItem serialNumberRecipe(
|
||||
|
||||
Reference in New Issue
Block a user