mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1881773 - Collect timezone. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D202598
This commit is contained in:
parent
2a054b5578
commit
54b9f6b7db
@ -318,3 +318,21 @@ characteristics:
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
timezone:
|
||||
type: string
|
||||
description: >
|
||||
The the current timezone of the system
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1881773
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1881773#c4
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "mozilla/RelativeLuminanceUtils.h"
|
||||
#include "mozilla/ServoStyleConsts.h"
|
||||
#include "mozilla/dom/ScreenBinding.h"
|
||||
#include "mozilla/intl/TimeZone.h"
|
||||
#include "mozilla/widget/ScreenManager.h"
|
||||
|
||||
#include "gfxPlatformFontList.h"
|
||||
@ -252,6 +253,16 @@ nsresult nsUserCharacteristics::PopulateData(bool aTesting /* = false */) {
|
||||
}
|
||||
mozilla::glean::characteristics::processor_count.Set(processorCount);
|
||||
|
||||
AutoTArray<char16_t, 128> tzBuffer;
|
||||
auto result = mozilla::intl::TimeZone::GetDefaultTimeZone(tzBuffer);
|
||||
if (result.isOk()) {
|
||||
NS_ConvertUTF16toUTF8 timeZone(
|
||||
nsDependentString(tzBuffer.Elements(), tzBuffer.Length()));
|
||||
mozilla::glean::characteristics::timezone.Set(timeZone);
|
||||
} else {
|
||||
mozilla::glean::characteristics::timezone.Set("<error>"_ns);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user