Android: switch qmlpreview to use new Android Device mechanism

Amends 261a39cbbd, after switching
Android plugin to use new device selection mechanism in
96255208a5.

Change-Id: I7b2dd1950055f3e6f1a449778f44d57c0c0a8758
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2021-09-21 21:11:00 +03:00
committed by Alessandro Portale
parent 261a39cbbd
commit 2695bcb167

View File

@@ -31,12 +31,16 @@
#include "androidqmlpreviewworker.h" #include "androidqmlpreviewworker.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <projectexplorer/buildsystem.h> #include <projectexplorer/buildsystem.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qmlprojectmanager/qmlprojectconstants.h> #include <qmlprojectmanager/qmlprojectconstants.h>
#include <qmlprojectmanager/qmlprojectmanagerconstants.h> #include <qmlprojectmanager/qmlprojectmanagerconstants.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
@@ -258,10 +262,11 @@ bool AndroidQmlPreviewWorker::ensureAvdIsRunning()
if (!avdMan.isAvdBooted(devSN)) { if (!avdMan.isAvdBooted(devSN)) {
m_devInfo = {}; m_devInfo = {};
int minTargetApi = AndroidManager::minimumSDK(m_rc->target()); int minTargetApi = AndroidManager::minimumSDK(m_rc->target()->kit());
AndroidDeviceInfo devInfoLocal = AndroidConfigurations::showDeviceDialog(m_rc->project(), using namespace ProjectExplorer;
minTargetApi, const IDevice *dev = DeviceKitAspect::device(m_rc->target()->kit()).data();
apkInfo()->abis); AndroidDeviceInfo devInfoLocal = AndroidDevice::androidDeviceInfoFromIDevice(dev);
if (devInfoLocal.isValid()) { if (devInfoLocal.isValid()) {
if (devInfoLocal.type == AndroidDeviceInfo::Emulator) { if (devInfoLocal.type == AndroidDeviceInfo::Emulator) {
appendMessage(tr("Launching AVD."), NormalMessageFormat); appendMessage(tr("Launching AVD."), NormalMessageFormat);