forked from qt-creator/qt-creator
Android: Use avdmanager tool
android tool is deprecated since sdk tools version 25.3.0. Use the new avdmanager tool Task-number: QTCREATORBUG-17814 Change-Id: Id6f495f14e12d0069df08164cac1929b76d9e932 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "androiddevicedialog.h"
|
||||
#include "androidmanager.h"
|
||||
#include "androidavdmanager.h"
|
||||
#include "ui_androiddevicedialog.h"
|
||||
|
||||
#include <utils/environment.h>
|
||||
@@ -424,7 +425,7 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, Andro
|
||||
m_apiLevel(apiLevel),
|
||||
m_abi(abi),
|
||||
m_defaultDevice(serialNumber),
|
||||
m_androidToolManager(new AndroidToolManager(AndroidConfigurations::currentConfig()))
|
||||
m_avdManager(new AndroidAvdManager)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->deviceView->setModel(m_model);
|
||||
@@ -516,7 +517,7 @@ void AndroidDeviceDialog::refreshDeviceList()
|
||||
m_ui->refreshDevicesButton->setEnabled(false);
|
||||
m_progressIndicator->show();
|
||||
m_connectedDevices = AndroidConfig::connectedDevices(AndroidConfigurations::currentConfig().adbToolPath().toString());
|
||||
m_futureWatcherRefreshDevices.setFuture(m_androidToolManager->androidVirtualDevicesFuture());
|
||||
m_futureWatcherRefreshDevices.setFuture(m_avdManager->avdList());
|
||||
}
|
||||
|
||||
void AndroidDeviceDialog::devicesRefreshed()
|
||||
@@ -531,7 +532,7 @@ void AndroidDeviceDialog::devicesRefreshed()
|
||||
serialNumber = deviceType == AndroidDeviceInfo::Hardware ? info.serialNumber : info.avdname;
|
||||
}
|
||||
|
||||
QVector<AndroidDeviceInfo> devices = m_futureWatcherRefreshDevices.result();
|
||||
AndroidDeviceInfoList devices = m_futureWatcherRefreshDevices.result();
|
||||
QSet<QString> startedAvds = Utils::transform<QSet>(m_connectedDevices,
|
||||
[] (const AndroidDeviceInfo &info) {
|
||||
return info.avdname;
|
||||
@@ -584,12 +585,12 @@ void AndroidDeviceDialog::createAvd()
|
||||
m_ui->createAVDButton->setEnabled(false);
|
||||
AndroidConfig::CreateAvdInfo info = AndroidConfigurations::currentConfig().gatherCreateAVDInfo(this, m_apiLevel, m_abi);
|
||||
|
||||
if (info.target.isEmpty()) {
|
||||
if (!info.target.isValid()) {
|
||||
m_ui->createAVDButton->setEnabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
m_futureWatcherAddDevice.setFuture(m_androidToolManager->createAvd(info));
|
||||
m_futureWatcherAddDevice.setFuture(m_avdManager->createAvd(info));
|
||||
}
|
||||
|
||||
void AndroidDeviceDialog::avdAdded()
|
||||
|
||||
Reference in New Issue
Block a user