Commit fd746e99 authored by Michael Kaply's avatar Michael Kaply
Browse files

Bug 1429153 - Add policy for disabling telemetry. r=Felipe

MozReview-Commit-ID: 6fGGuJzZUhU

--HG--
extra : rebase_source : bdbcd6837879231a85b9e87ef694032a3bf89c2a
parent 057d5407
......@@ -233,6 +233,15 @@ var Policies = {
}
},
"DisableTelemetry": {
onBeforeAddons(manager, param) {
if (param) {
setAndLockPref("datareporting.healthreport.uploadEnabled", false);
setAndLockPref("datareporting.policy.dataSubmissionEnabled", false);
}
}
},
"DisplayBookmarksToolbar": {
onBeforeUIStartup(manager, param) {
let value = (!param).toString();
......
......@@ -185,6 +185,14 @@
"type": "boolean"
},
"DisableTelemetry": {
"description": "Turns off telemetry.",
"first_available": "60.0",
"enterprise_only": true,
"type": "boolean"
},
"DisplayBookmarksToolbar": {
"description": "Causes the bookmarks toolbar to be displayed by default.",
"first_available": "60.0",
......
......@@ -34,6 +34,7 @@ support-files =
[browser_policy_disable_privatebrowsing.js]
[browser_policy_disable_safemode.js]
[browser_policy_disable_shield.js]
[browser_policy_disable_telemetry.js]
[browser_policy_display_bookmarks.js]
[browser_policy_display_menu.js]
[browser_policy_extensions.js]
......
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function test_policy_disable_telemetry() {
const { TelemetryReportingPolicy } = ChromeUtils.import("resource://gre/modules/TelemetryReportingPolicy.jsm", {});
ok(TelemetryReportingPolicy, "TelemetryReportingPolicy exists");
is(TelemetryReportingPolicy.canUpload(), true, "Telemetry is enabled");
await setupPolicyEngineWithJson({
"policies": {
"DisableTelemetry": true
}
});
is(TelemetryReportingPolicy.canUpload(), false, "Telemetry is disabled");
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment