aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android/androiddeviceinfo.h
blob: 88b20126bd9c53ee8ce9c862817c70d9500fb8d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <QDebug>
#include <QMetaType>
#include <QString>
#include <QStringList>

#include <projectexplorer/devicesupport/idevice.h>

using namespace ProjectExplorer;

namespace Android {

class AndroidDeviceInfo
{
public:
    QString serialNumber;
    QString avdName;
    QStringList cpuAbi;
    int sdk = -1;
    IDevice::DeviceState state = IDevice::DeviceDisconnected;
    IDevice::MachineType type = IDevice::Emulator;
    Utils::FilePath avdPath;

    static QStringList adbSelector(const QString &serialNumber);

    bool isValid() const { return !serialNumber.isEmpty() || !avdName.isEmpty(); }
    bool operator<(const AndroidDeviceInfo &other) const;
    bool operator==(const AndroidDeviceInfo &other) const; // should be = default with C++20
    bool operator!=(const AndroidDeviceInfo &other) const { return !(*this == other); }
};
using AndroidDeviceInfoList = QList<AndroidDeviceInfo>;

QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device);

} // namespace Android

Q_DECLARE_METATYPE(Android::AndroidDeviceInfo)