mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[General]Add an option for telemetry opt-in and visualization(#34078)
* Data diagnostics opt-in
* [c++] Drop DROP_PII flag
* Bump telemtry package to 2.0.2
* Drop DropPii from custom actions
* Cleanup
* Do not start manually C# EtwTrace. FZ engine exit event.
* ImageResizer, PowerRename, FileLocksmith prev handlers
* Revert C# handlers exe logging
* Revert "Revert C# handlers exe logging"
This reverts commit 4c75a3953b.
* Do not recreate EtwTrace
* consume package
* xaml formatting
* Fix deps.json audit
* Update telem package paths
* Address PR comments
* Fix AdvancedPaste close on PT close
* Override etl file name for explorer loaded dlls
Start/stop tracer when needed for explorer loaded dlls to prevent explorer overload
* Fix setting desc
* Fix missing events
* Add infobar to restart when enable data viewing
* Flush on timer every 30s
* [Settings] Update View Data diagnostic description text
[New+] Add tracer
* Show Restart info bar for both enable/disable data viewer
* Fix newplus
* Fix stuck on restart and terminate AdvPaste exe on destroy()
* [Installer] Add tracer
* Address PR comment
* Add missing tracers
* Exclude etw dir from BugReport
* Fix bad merge
* [Hosts] Proper exit on initial dialog
* [OOBE] Make Data diagnostic setting visible without scroll
* [OOBE] Add hiperlynk to open general settings
* Disable data view on disabling data diagnostics
* Don't disable View data button
* Fix disabling data viewing
* Add missing dot
* Revert formatting
This commit is contained in:
@@ -67,6 +67,8 @@ private:
|
||||
// Handle to event used to invoke ColorPicker
|
||||
HANDLE m_hInvokeEvent;
|
||||
|
||||
HANDLE m_hAppTerminateEvent;
|
||||
|
||||
void parse_hotkey(PowerToysSettings::PowerToyValues& settings)
|
||||
{
|
||||
auto settingsObject = settings.get_raw_json();
|
||||
@@ -158,6 +160,7 @@ public:
|
||||
LoggerHelpers::init_logger(app_key, L"ModuleInterface", "ColorPicker");
|
||||
send_telemetry_event = CreateDefaultEvent(CommonSharedConstants::COLOR_PICKER_SEND_SETTINGS_TELEMETRY_EVENT);
|
||||
m_hInvokeEvent = CreateDefaultEvent(CommonSharedConstants::SHOW_COLOR_PICKER_SHARED_EVENT);
|
||||
m_hAppTerminateEvent = CreateDefaultEvent(CommonSharedConstants::TERMINATE_COLOR_PICKER_SHARED_EVENT);
|
||||
init_settings();
|
||||
}
|
||||
|
||||
@@ -249,6 +252,10 @@ public:
|
||||
{
|
||||
ResetEvent(send_telemetry_event);
|
||||
ResetEvent(m_hInvokeEvent);
|
||||
|
||||
SetEvent(m_hAppTerminateEvent);
|
||||
WaitForSingleObject(m_hProcess, 1500);
|
||||
|
||||
TerminateProcess(m_hProcess, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
#include <windows.h>
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
#include <ProjectTelemetry.h>
|
||||
#include <shellapi.h>
|
||||
#include <Shlwapi.h>
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "pch.h"
|
||||
#include "trace.h"
|
||||
|
||||
#include <common/Telemetry/TraceBase.h>
|
||||
|
||||
TRACELOGGING_DEFINE_PROVIDER(
|
||||
g_hProvider,
|
||||
"Microsoft.PowerToys",
|
||||
@@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER(
|
||||
(0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
|
||||
TraceLoggingOptionProjectTelemetry());
|
||||
|
||||
void Trace::RegisterProvider()
|
||||
{
|
||||
TraceLoggingRegister(g_hProvider);
|
||||
}
|
||||
|
||||
void Trace::UnregisterProvider()
|
||||
{
|
||||
TraceLoggingUnregister(g_hProvider);
|
||||
}
|
||||
|
||||
// Log if ColorPicker is enabled or disabled
|
||||
void Trace::EnableColorPicker(const bool enabled) noexcept
|
||||
{
|
||||
TraceLoggingWrite(
|
||||
TraceLoggingWriteWrapper(
|
||||
g_hProvider,
|
||||
"ColorPicker_EnableColorPicker",
|
||||
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
class Trace
|
||||
|
||||
#include <common/Telemetry/TraceBase.h>
|
||||
|
||||
class Trace : public telemetry::TraceBase
|
||||
{
|
||||
public:
|
||||
static void RegisterProvider();
|
||||
static void UnregisterProvider();
|
||||
|
||||
// Log if ColorPicker is enabled or disabled
|
||||
static void EnableColorPicker(const bool enabled) noexcept;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Windows;
|
||||
|
||||
using ColorPicker.Mouse;
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
|
||||
namespace ColorPickerUI
|
||||
{
|
||||
@@ -18,6 +19,8 @@ namespace ColorPickerUI
|
||||
/// </summary>
|
||||
public partial class App : Application, IDisposable
|
||||
{
|
||||
public ETWTrace EtwTrace { get; private set; } = new ETWTrace();
|
||||
|
||||
private Mutex _instanceMutex;
|
||||
private static string[] _args;
|
||||
private int _powerToysRunnerPid;
|
||||
@@ -96,6 +99,7 @@ namespace ColorPickerUI
|
||||
if (disposing)
|
||||
{
|
||||
_instanceMutex?.Dispose();
|
||||
EtwTrace?.Dispose();
|
||||
}
|
||||
|
||||
disposedValue = true;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
using ColorPicker.Helpers;
|
||||
using Common.UI;
|
||||
|
||||
@@ -57,6 +57,12 @@ namespace ColorPicker.ViewModels
|
||||
_userSettings = userSettings;
|
||||
_keyboardMonitor = keyboardMonitor;
|
||||
|
||||
NativeEventWaiter.WaitForEventLoop(
|
||||
Constants.TerminateColorPickerSharedEvent(),
|
||||
Application.Current.Shutdown,
|
||||
Application.Current.Dispatcher,
|
||||
exitToken);
|
||||
|
||||
NativeEventWaiter.WaitForEventLoop(
|
||||
Constants.ShowColorPickerSharedEvent(),
|
||||
_appStateHandler.StartUserSession,
|
||||
|
||||
Reference in New Issue
Block a user