Commit 9998f37f authored by Thoren Paulson's avatar Thoren Paulson Committed by Commit Bot

Use default timezone on Chromecast linux.

ICU can't detect the system timezone on Chromecast's linux platform, so
we want to use the behavior used on CrOS of pushing the ICU's default
timezone (set by Cast already) to clients.

Bug: internal b/112498903
Test: repro
Change-Id: Idf39a01964d0a5813df3626b0bc33663b7ca3ea3
Reviewed-on: https://chromium-review.googlesource.com/1191123Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Commit-Queue: Thoren Paulson <thoren@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586411}
parent 6bef0044
...@@ -51,6 +51,10 @@ source_set("time_zone_monitor") { ...@@ -51,6 +51,10 @@ source_set("time_zone_monitor") {
if (is_fuchsia) { if (is_fuchsia) {
sources += [ "time_zone_monitor_fuchsia.cc" ] sources += [ "time_zone_monitor_fuchsia.cc" ]
} }
if (is_chromecast) {
defines = [ "IS_CHROMECAST" ]
}
} }
if (is_android) { if (is_android) {
......
...@@ -29,8 +29,8 @@ void TimeZoneMonitor::Bind(device::mojom::TimeZoneMonitorRequest request) { ...@@ -29,8 +29,8 @@ void TimeZoneMonitor::Bind(device::mojom::TimeZoneMonitorRequest request) {
void TimeZoneMonitor::NotifyClients() { void TimeZoneMonitor::NotifyClients() {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(IS_CHROMECAST))
// On CrOS, ICU's default tz is already set to a new zone. No // On CrOS (and Chromecast), ICU's default tz is already set to a new zone. No
// need to redetect it with detectHostTimeZone(). // need to redetect it with detectHostTimeZone().
std::unique_ptr<icu::TimeZone> new_zone(icu::TimeZone::createDefault()); std::unique_ptr<icu::TimeZone> new_zone(icu::TimeZone::createDefault());
#else #else
...@@ -41,7 +41,7 @@ void TimeZoneMonitor::NotifyClients() { ...@@ -41,7 +41,7 @@ void TimeZoneMonitor::NotifyClients() {
#else #else
std::unique_ptr<icu::TimeZone> new_zone(icu::TimeZone::detectHostTimeZone()); std::unique_ptr<icu::TimeZone> new_zone(icu::TimeZone::detectHostTimeZone());
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) && !defined(IS_CHROMECAST)
// We get here multiple times on Linux per a single tz change, but // We get here multiple times on Linux per a single tz change, but
// want to update the ICU default zone and notify renderer only once. // want to update the ICU default zone and notify renderer only once.
std::unique_ptr<icu::TimeZone> current_zone(icu::TimeZone::createDefault()); std::unique_ptr<icu::TimeZone> current_zone(icu::TimeZone::createDefault());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment