Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow system administrators to suppress telemetry by policy #1204

Merged
merged 10 commits into from
Sep 29, 2021

Conversation

DaveTryon
Copy link
Contributor

@DaveTryon DaveTryon commented Sep 29, 2021

Details

Create a registry-based policy to disable telemetry from a computer. The suppression is system-wide and persists across uninstall/reinstall. The suppression is added by creating the following registry value:

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Accessibility Insights for Windows
Value (DWORD): DisableTelemetry = 1

In terms of a reg file, it looks like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Accessibility Insights for Windows]
"DisableTelemetry"=dword:00000001

If this value exists and is set to 1, then the initial telemetry prompt is skipped. Inside the settings dialog, the standard telemetry block is also changed, as shown here:

Key not set (default) Key set (with this change)
image image

The key is read when the app starts up, and changes to the key will be ignored until after the app is restarted.

Motivation

Addresses #1182

Context

I also walked through this extended scenario:

  1. Disable telemetry via registry
  2. Start without configuration files
  3. Telemetry dialog is skipped (user can't enable it)
  4. Close app
  5. Enable telemetry via registry
  6. Start app (with or without configuration files)
  7. Telemetry dialog displays

This works because the ShowTelemetryDialog flag defaults to true, then never gets set to false. When the registry override is removed, we display the telemetry dialog, as expected.

Pull request checklist

Note: After the PR has been created, certain checks will be kicked off. All of these checks must pass before a merge.

@DaveTryon DaveTryon requested a review from jalkire September 29, 2021 00:51
@DaveTryon DaveTryon requested a review from a team as a code owner September 29, 2021 00:51
/// <summary>
/// Whether or not telemetry toggle button is enabled in the settings.
/// </summary>
bool IsTelemetryAllowed { get; set; }
bool HasUserOptedIntoTelemetry { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a rename to better distinguish which level of enabling we are setting

@@ -55,9 +55,9 @@ private void btnExit_Click(object sender, RoutedEventArgs e)
DialogResult = ckbxAgreeToHelp.IsChecked ?? false;

if (DialogResult)
TelemetryController.EnableTelemetry();
TelemetryController.OptIntoTelemetry();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a rename to better distinguish which level of enabling we are setting

else
TelemetryController.DisableTelemetry();
TelemetryController.OptOutOfTelemetry();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a rename to better distinguish which level of enabling we are setting

@@ -631,7 +631,7 @@ public static ConfigurationModel GetDefaultConfigurationModel(FixedConfigSetting
FontSize = FontSize.Standard,
HighlighterMode = HighlighterMode.HighlighterBeakerTooltip,
ShowAncestry = true,
EnableTelemetry = true,
EnableTelemetry = false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't strictly necessary but better reflects what the default value should be

@DaveTryon DaveTryon requested a review from dbjorge September 29, 2021 19:41
@DaveTryon DaveTryon merged commit 4f3488b into microsoft:main Sep 29, 2021
@DaveTryon DaveTryon deleted the suppress-telemetry branch September 30, 2021 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants