Bug 1829140 - Avoid collecting some telemetry when MOZ_TELEMETRY_REPORTING is not set. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D176060
This commit is contained in:
cypherpunks1 2023-05-11 12:28:12 +00:00
Родитель b094c87c74
Коммит e465259451
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -1175,8 +1175,15 @@ let BrowserUsageTelemetry = {
// Reports the number of Firefox profiles on this machine to telemetry.
async reportProfileCount() {
if (AppConstants.platform != "win") {
if (
AppConstants.platform != "win" ||
!AppConstants.MOZ_TELEMETRY_REPORTING
) {
// This is currently a windows-only feature.
// Also, this function writes directly to disk, without using the usual
// telemetry recording functions. So we excplicitly check if telemetry
// reporting was disabled at compile time, and we do not do anything in
// case.
return;
}

Просмотреть файл

@ -2695,7 +2695,11 @@ static ReturnAbortOnError ProfileLockedDialog(nsIFile* aProfileDir,
rv = xpcom.Initialize();
NS_ENSURE_SUCCESS(rv, rv);
#if defined(MOZ_TELEMETRY_REPORTING)
// We cannot check if telemetry has been disabled by the user, yet.
// So, rely on the build time settings, instead.
mozilla::Telemetry::WriteFailedProfileLock(aProfileDir);
#endif
rv = xpcom.SetWindowCreator(aNative);
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);