Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 03f9352

Browse files
committed
Bug 1943698 - Remove Legacy Environment fields that never report a value r=TravisLong,florian
Also audit existing collections and account in the counts for which are already covered by Glean collections. 8 were removed: settings.telemetryEnabled, system.device.{model,manufacturer,hardware,isTablet}, system.os.kernelVersion, system.gfx.embeddedInFirefoxReality, system.gfx.DWriteVersion 2 were missed in the original count and so were added back in: system.os.distro, system.os.distroVersion 1 was accidentally counted but wasn't present in the code, so was taken back out: addons.activePlugins 9 are accounted for by Glean already: experiments, build.applicationId, (okay, this one's not accounted for, but it's a constant UUID) build.applicationName, build.buildId, build.version, (analysts prefer display_version) build.vendor, build.displayVersion, build.platformVersion, (analysts prefer display_version) settings.locale, Also remove test_TelemetryAndroidEnvironment.js since the Telemetry Environment hasn't be available on Android for years. Differential Revision: https://phabricator.services.mozilla.com/D236054
1 parent 560764e commit 03f9352

File tree

5 files changed

+8
-113
lines changed

5 files changed

+8
-113
lines changed

toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { UpdateUtils } from "resource://gre/modules/UpdateUtils.sys.mjs";
1212
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
1313

1414
const Utils = TelemetryUtils;
15-
const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
1615

1716
import {
1817
AddonManager,
@@ -82,6 +81,10 @@ export var Policy = {
8281
// startup.
8382
var gActiveExperimentStartupBuffer = new Map();
8483

84+
// For Powering arewegleanyet.com (See bug 1944592)
85+
// Legacy Count: 120
86+
// Glean Count: 9
87+
8588
var gGlobalEnvironment;
8689
function getGlobal() {
8790
if (!gGlobalEnvironment) {
@@ -1633,8 +1636,6 @@ EnvironmentCache.prototype = {
16331636
e10sEnabled: Services.appinfo.browserTabsRemoteAutostart,
16341637
e10sMultiProcesses: Services.appinfo.maxWebProcessCount,
16351638
fissionEnabled: Services.appinfo.fissionAutostart,
1636-
telemetryEnabled:
1637-
Services.prefs.getBoolPref(PREF_TELEMETRY_ENABLED, false) === true,
16381639
locale: getBrowserLocale(),
16391640
// We need to wait for browser-delayed-startup-finished to ensure that the locales
16401641
// have settled, once that's happened we can get the intl data directly.
@@ -1919,24 +1920,6 @@ EnvironmentCache.prototype = {
19191920
return {};
19201921
},
19211922

1922-
/**
1923-
* Get the device information, if we are on a portable device.
1924-
* @return Object containing the device information data, or null if
1925-
* not a portable device.
1926-
*/
1927-
_getDeviceData() {
1928-
if (AppConstants.platform !== "android") {
1929-
return null;
1930-
}
1931-
1932-
return {
1933-
model: getSysinfoProperty("device", null),
1934-
manufacturer: getSysinfoProperty("manufacturer", null),
1935-
hardware: getSysinfoProperty("hardware", null),
1936-
isTablet: getSysinfoProperty("tablet", null),
1937-
};
1938-
},
1939-
19401923
_osData: null,
19411924
/**
19421925
* Get the OS information.
@@ -2042,13 +2025,9 @@ EnvironmentCache.prototype = {
20422025
DWriteEnabled: getGfxField("DWriteEnabled", null),
20432026
ContentBackend: getGfxField("ContentBackend", null),
20442027
Headless: getGfxField("isHeadless", null),
2045-
EmbeddedInFirefoxReality: getGfxField("EmbeddedInFirefoxReality", null),
20462028
TargetFrameRate: getGfxField("TargetFrameRate", null),
20472029
textScaleFactor: getGfxField("textScaleFactor", null),
20482030

2049-
// The following line is disabled due to main thread jank and will be enabled
2050-
// again as part of bug 1154500.
2051-
// DWriteVersion: getGfxField("DWriteVersion", null),
20522031
adapters: [],
20532032
monitors: [],
20542033
features: {},
@@ -2130,8 +2109,6 @@ EnvironmentCache.prototype = {
21302109
}
21312110
data = { ...this._getProcessData(), ...data };
21322111
data.sec = this._getSecurityAppData();
2133-
} else if (AppConstants.platform == "android") {
2134-
data.device = this._getDeviceData();
21352112
}
21362113

21372114
return data;

toolkit/components/telemetry/docs/data/environment.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Structure:
5353
e10sEnabled: <bool>, // whether e10s is on, i.e. browser tabs open by default in a different process
5454
e10sMultiProcesses: <integer>, // Maximum number of processes that will be launched for regular web content
5555
fissionEnabled: <bool>, // whether fission is enabled this session, and subframes can load in a different process
56-
telemetryEnabled: <bool>, // false on failure
5756
locale: <string>, // e.g. "it", null on failure
5857
intl: {
5958
requestedLocales: [ <string>, ... ], // The locales that are being requested.
@@ -144,16 +143,9 @@ Structure:
144143
// "hasAES", "hasEDSP", "hasARMv6", "hasARMv7", "hasNEON"
145144
],
146145
},
147-
device: { // This section is only available on mobile devices.
148-
model: <string>, // the "device" from FHR, null on failure
149-
manufacturer: <string>, // null on failure
150-
hardware: <string>, // null on failure
151-
isTablet: <bool>, // null on failure
152-
},
153146
os: {
154147
name: <string>, // "Windows_NT" or null on failure
155148
version: <string>, // e.g. "6.1", null on failure
156-
kernelVersion: <string>, // android only or null on failure
157149
servicePackMajor: <number>, // windows only or null on failure
158150
servicePackMinor: <number>, // windows only or null on failure
159151
windowsBuildNumber: <number>, // windows only or null on failure
@@ -188,7 +180,6 @@ Structure:
188180
ContentBackend: <string> // One of "Cairo", "Skia", or "Direct2D 1.1"
189181
Headless: <bool>, // null on failure
190182
TargetFrameRate: <number>, // frame rate in Hz, typically 60 or more
191-
//DWriteVersion: <string>, // temporarily removed, pending bug 1154500
192183
adapters: [
193184
{
194185
description: <string>, // e.g. "Intel(R) HD Graphics 4600", null on failure
@@ -577,7 +568,6 @@ This object contains operating system information.
577568

578569
- ``name``: the name of the OS.
579570
- ``version``: a string representing the OS version.
580-
- ``kernelVersion``: an Android only string representing the kernel version.
581571
- ``servicePackMajor``: the Windows only major version number for the installed service pack.
582572
- ``servicePackMinor``: the Windows only minor version number for the installed service pack.
583573
- ``windowsBuildNumber``: the Windows build number.
@@ -618,6 +608,10 @@ Note that this list includes other types of deliveries, including Normandy rollo
618608
Version History
619609
---------------
620610

611+
- Firefox 137:
612+
613+
- Removed unused and Android-only fields as part of Glean mirroring support. (`bug 1943698 <https://bugzilla.mozilla.org/show_bug.cgi?id=1943698>`_)
614+
621615
- Firefox 88:
622616

623617
- Removed ``addons.activePlugins`` as part of removing NPAPI plugin support. (`bug 1682030 <https://bugzilla.mozilla.org/show_bug.cgi?id=1682030>`_)

toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ export var TelemetryEnvironmentTesting = {
263263
fissionEnabled: "boolean",
264264
intl: "object",
265265
locale: "string",
266-
telemetryEnabled: "boolean",
267266
update: "object",
268267
userPrefs: "object",
269268
};
@@ -621,8 +620,6 @@ export var TelemetryEnvironmentTesting = {
621620
"windowsUBR must be null or a number."
622621
);
623622
}
624-
} else if (gIsAndroid) {
625-
lazy.Assert.ok(this.checkNullOrString(osData.kernelVersion));
626623
} else if (gIsLinux) {
627624
lazy.Assert.ok(this.checkNullOrString(osData.distro));
628625
lazy.Assert.ok(this.checkNullOrString(osData.distroVersion));
@@ -640,17 +637,10 @@ export var TelemetryEnvironmentTesting = {
640637
lazy.Assert.ok("Headless" in gfxData);
641638
lazy.Assert.ok("TargetFrameRate" in gfxData);
642639
lazy.Assert.equal(typeof gfxData.TargetFrameRate, "number");
643-
lazy.Assert.ok("EmbeddedInFirefoxReality" in gfxData);
644640
lazy.Assert.ok("textScaleFactor" in gfxData);
645-
// DWriteVersion is disabled due to main thread jank and will be enabled
646-
// again as part of bug 1154500.
647-
// Assert.ok("DWriteVersion" in gfxData);
648641
if (gIsWindows) {
649642
lazy.Assert.equal(typeof gfxData.D2DEnabled, "boolean");
650643
lazy.Assert.equal(typeof gfxData.DWriteEnabled, "boolean");
651-
lazy.Assert.equal(typeof gfxData.EmbeddedInFirefoxReality, "boolean");
652-
// As above, will be enabled again as part of bug 1154500.
653-
// Assert.ok(this.checkString(gfxData.DWriteVersion));
654644
}
655645

656646
lazy.Assert.ok("adapters" in gfxData);

toolkit/components/telemetry/tests/unit/test_TelemetryAndroidEnvironment.js

Lines changed: 0 additions & 64 deletions
This file was deleted.

toolkit/components/telemetry/tests/unit/xpcshell.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ tags = "addons"
6464
["test_SyncPingIntegration.js"]
6565
skip-if = ["os == 'android'"]
6666

67-
["test_TelemetryAndroidEnvironment.js"]
68-
6967
["test_TelemetryClientID_reset.js"]
7068
skip-if = ["os == 'android'"] # Disabled as Android/GeckoView doesn't run TelemetryController
7169

0 commit comments

Comments
 (0)