diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index e36fdd7fa6fa..fb612b8857a6 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -1691,8 +1691,14 @@ BrowserGlue.prototype = { }, _updateAutoplayPref() { - let blocked = Services.prefs.getIntPref("media.autoplay.default", 1); - Services.telemetry.scalarSet("media.autoplay_default_blocked", blocked); + const blocked = Services.prefs.getIntPref("media.autoplay.default", 1); + const telemetry = Services.telemetry.getHistogramById( + "AUTOPLAY_DEFAULT_SETTING_CHANGE" + ); + const labels = { 0: "allow", 1: "blockAudible", 5: "blockAll" }; + if (blocked in labels) { + telemetry.add(labels[blocked]); + } }, _setPrefExpectations() { diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index ec064609b9fb..0f97bb5a90a6 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -15360,6 +15360,20 @@ "description": "How long the AudioContext would become audible since it was created, time unit is seconds.", "releaseChannelCollection": "opt-out" }, + "AUTOPLAY_DEFAULT_SETTING_CHANGE": { + "record_in_processes": ["main", "content"], + "products": ["firefox", "fennec", "geckoview"], + "alert_emails": [ + "alwu@mozilla.com", + "nohlmeier@mozilla.com" + ], + "expires_in_version": "74", + "kind": "categorical", + "labels": ["allow", "blockAudible", "blockAll"], + "bug_numbers": [1567302], + "description": "counts the number of times a user changed the default autoplay behavior to each setting during a subsession.", + "releaseChannelCollection": "opt-out" + }, "WEB_AUDIO_AUTOPLAY": { "record_in_processes": ["main", "content"], "products": ["firefox", "fennec", "geckoview"],