Android: Implement portsgatherer

This seems to make Qml profiling work again.

Change-Id: I3169e9dcfc30b72e520afca8fd24ddc59562bf5a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2024-10-28 18:32:46 +01:00
parent b63dd3e6db
commit 1ac403bacb
2 changed files with 17 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/guard.h> #include <utils/guard.h>
#include <utils/port.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <utils/url.h> #include <utils/url.h>
@@ -624,6 +625,21 @@ DeviceProcessSignalOperation::Ptr AndroidDevice::signalOperation() const
return DeviceProcessSignalOperation::Ptr(new AndroidSignalOperation()); return DeviceProcessSignalOperation::Ptr(new AndroidSignalOperation());
} }
PortsGatheringMethod AndroidDevice::portsGatheringMethod() const
{
return {
// Triggered for QmlProfiler
[this](QAbstractSocket::NetworkLayerProtocol protocol) -> CommandLine {
Q_UNUSED(protocol);
return {AndroidConfig::adbToolPath(), {
AndroidDeviceInfo::adbSelector(serialNumber()),
"shell" , "netstat", "-a", "-n"
}};
},
&Port::parseFromCommandOutput
};
}
QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const
{ {
QUrl url; QUrl url;

View File

@@ -59,6 +59,7 @@ private:
ProjectExplorer::IDeviceWidget *createWidget() override; ProjectExplorer::IDeviceWidget *createWidget() override;
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override;
QUrl toolControlChannel(const ControlChannelHint &) const override; QUrl toolControlChannel(const ControlChannelHint &) const override;
ProjectExplorer::PortsGatheringMethod portsGatheringMethod() const override;
QSettings *avdSettings() const; QSettings *avdSettings() const;
void initAvdSettings(); void initAvdSettings();