2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2017-04-03 11:11:17 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "androidconfigurations.h"
|
|
|
|
|
|
2023-03-09 12:04:09 +01:00
|
|
|
#include <QFuture>
|
|
|
|
|
|
|
|
|
|
#include <optional>
|
2017-04-03 11:11:17 +02:00
|
|
|
|
2022-09-27 10:48:30 +02:00
|
|
|
namespace Android::Internal {
|
2017-04-03 11:11:17 +02:00
|
|
|
|
|
|
|
|
class AndroidAvdManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
AndroidAvdManager(const AndroidConfig& config = AndroidConfigurations::currentConfig());
|
|
|
|
|
~AndroidAvdManager();
|
|
|
|
|
|
2017-08-18 08:22:34 +02:00
|
|
|
QFuture<CreateAvdInfo> createAvd(CreateAvdInfo info) const;
|
2017-04-03 11:11:17 +02:00
|
|
|
bool removeAvd(const QString &name) const;
|
|
|
|
|
QFuture<AndroidDeviceInfoList> avdList() const;
|
|
|
|
|
|
|
|
|
|
QString startAvd(const QString &name) const;
|
|
|
|
|
bool startAvdAsync(const QString &avdName) const;
|
|
|
|
|
QString findAvd(const QString &avdName) const;
|
2023-03-09 12:04:09 +01:00
|
|
|
QString waitForAvd(const QString &avdName, const std::optional<QFuture<void>> &future = {}) const;
|
2017-04-03 11:11:17 +02:00
|
|
|
bool isAvdBooted(const QString &device) const;
|
2020-02-10 16:02:24 +02:00
|
|
|
static bool avdManagerCommand(const AndroidConfig &config,
|
2020-01-08 14:55:16 +02:00
|
|
|
const QStringList &args,
|
|
|
|
|
QString *output);
|
2017-04-03 11:11:17 +02:00
|
|
|
|
|
|
|
|
private:
|
2023-03-09 12:04:09 +01:00
|
|
|
bool waitForBooted(const QString &serialNumber, const std::optional<QFuture<void>> &future = {}) const;
|
2017-04-03 11:11:17 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
const AndroidConfig &m_config;
|
|
|
|
|
};
|
|
|
|
|
|
2022-09-27 10:48:30 +02:00
|
|
|
} // Android::Internal
|