Bug 1923028 - Migrate scalars to use Glean APIs for os.environment.*, r=chutten,mconley.

Differential Revision: https://phabricator.services.mozilla.com/D225985
This commit is contained in:
Florian Quèze
2024-10-18 20:24:29 +00:00
parent 5f7b9fff6e
commit 444cfaad1b
8 changed files with 210 additions and 46 deletions

View File

@@ -2624,8 +2624,7 @@ BrowserGlue.prototype = {
);
try {
Services.telemetry.scalarSet(
"os.environment.is_taskbar_pinned",
Glean.osEnvironment.isTaskbarPinned.set(
await shellService.isCurrentAppPinnedToTaskbarAsync(
winTaskbar.defaultGroupId
)
@@ -2637,8 +2636,7 @@ BrowserGlue.prototype = {
AppConstants.platform === "win" &&
!Services.sysinfo.getProperty("hasWinPackageId")
) {
Services.telemetry.scalarSet(
"os.environment.is_taskbar_pinned_private",
Glean.osEnvironment.isTaskbarPinnedPrivate.set(
await shellService.isCurrentAppPinnedToTaskbarAsync(
winTaskbar.defaultPrivateGroupId
)
@@ -2671,10 +2669,7 @@ BrowserGlue.prototype = {
if (gThisInstanceIsTaskbarTab) {
classification = "TaskbarTab";
}
Services.telemetry.scalarSet(
"os.environment.launch_method",
classification
);
Glean.osEnvironment.launchMethod.set(classification);
},
},
@@ -2808,9 +2803,7 @@ BrowserGlue.prototype = {
condition: AppConstants.platform == "win",
task: () => {
[".pdf", "mailto"].every(x => {
Services.telemetry.keyedScalarSet(
"os.environment.is_default_handler",
x,
Glean.osEnvironment.isDefaultHandler[x].set(
lazy.ShellService.isDefaultHandlerFor(x)
);
return true;
@@ -2851,8 +2844,7 @@ BrowserGlue.prototype = {
condition: AppConstants.platform == "macosx",
task: () => {
try {
Services.telemetry.scalarSet(
"os.environment.is_kept_in_dock",
Glean.osEnvironment.isKeptInDock.set(
Cc["@mozilla.org/widget/macdocksupport;1"].getService(
Ci.nsIMacDockSupport
).isAppInDock