DeviceManager: Add more telemetry points

Change-Id: Iaae2fe210a025102524ecd2d27a496b460438076
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Burak Hancerli
2025-03-18 10:30:03 +01:00
parent a1fe7c6891
commit b09ab5f0fd
2 changed files with 26 additions and 0 deletions

View File

@@ -16,6 +16,7 @@
#include <coreplugin/icore.h>
#include <projectexplorer/kitaspect.h>
#include <projectexplorer/target.h>
#include <qmldesigner/qmldesignerconstants.h>
#include <qmldesigner/qmldesignerplugin.h>
#include <qtsupport/qtkitaspect.h>
@@ -198,6 +199,9 @@ std::optional<bool> DeviceManager::deviceIsConnected(const QString &deviceId) co
void DeviceManager::setDeviceAlias(const QString &deviceId, const QString &alias)
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_SET_ALIAS);
auto device = findDevice(deviceId);
if (!device)
return;
@@ -216,6 +220,8 @@ void DeviceManager::setDeviceAlias(const QString &deviceId, const QString &alias
void DeviceManager::setDeviceActive(const QString &deviceId, const bool active)
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_SET_ACTIVE);
auto device = findDevice(deviceId);
if (!device)
return;
@@ -233,6 +239,8 @@ void DeviceManager::setDeviceActive(const QString &deviceId, const bool active)
void DeviceManager::setDeviceIP(const QString &deviceId, const QString &ip)
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_SET_DEVICE_IP);
auto device = findDevice(deviceId);
if (!device)
return;
@@ -259,6 +267,8 @@ QString DeviceManager::generateDeviceAlias() const
bool DeviceManager::addDevice(const QString &ip)
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_ADD_DEVICE);
if (ip.isEmpty())
return false;
@@ -354,6 +364,8 @@ void DeviceManager::deviceInfoReceived(const QString &deviceId)
void DeviceManager::removeDevice(const QString &deviceId)
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_REMOVE_DEVICE);
auto device = findDevice(deviceId);
if (!device)
return;
@@ -407,6 +419,8 @@ void DeviceManager::handleError(const ErrTypes &errType, const QString &deviceId
void DeviceManager::runProject(const QString &deviceId)
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_RUN_PROJECT);
auto device = findDevice(deviceId);
if (!device) {
handleError(ErrTypes::InternalError, deviceId, "Device not found");
@@ -473,6 +487,8 @@ void DeviceManager::projectPacked(const Utils::FilePath &filePath)
void DeviceManager::stopProject()
{
QmlDesigner::QmlDesignerPlugin::emitUsageStatistics(
QmlDesigner::Constants::EVENT_DEVICE_MANAGER_ANDROID_STOP_PROJECT);
auto device = findDevice(m_currentDeviceId);
if (!device) {
handleError(ErrTypes::InternalError, m_currentDeviceId, "Device not found");

View File

@@ -154,6 +154,16 @@ inline constexpr char EVENT_DESIGNVIEWER_PROJECT_THUMBNAIL_DELETED[]
= "DesignViewerProjectThumbnailDeleted";
inline constexpr char EVENT_DESIGNVIEWER_PROJECT_THUMBNAIL_DOWNLOADED[]
= "DesignViewerProjectThumbnailDownloaded";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_SET_ALIAS[] = "DeviceManagerAndroidSetAlias";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_SET_ACTIVE[] = "DeviceManagerAndroidSetActive";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_SET_DEVICE_IP[]
= "DeviceManagerAndroidSetDeviceIP";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_ADD_DEVICE[] = "DeviceManagerAndroidAddDevice";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_REMOVE_DEVICE[]
= "DeviceManagerAndroidRemoveDevice";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_RUN_PROJECT[] = "DeviceManagerAndroidRunProject";
inline constexpr char EVENT_DEVICE_MANAGER_ANDROID_STOP_PROJECT[]
= "DeviceManagerAndroidStopProject";
inline constexpr char PROPERTY_EDITOR_CLASSNAME_PROPERTY[] = "__classNamePrivateInternal";