Commit Graph

7 Commits

Author SHA1 Message Date
Neil Fuller
e7fd120d8e Capitalize TZ display name strings
Capitalize Settings UI time zone display name strings for languanges
like Polish for standalone locations like summaries and lists. The
motivating example case is the string for "Coordinated Universal Time"
in Polish, which is not capitalized in CLDR, as they capitalize for the
middle of sentences by default. In English, Coordinated Universal Time
is already capitalized, but the Polish string is not.

With this commit all "display name"-like strings have been capitalized
(region names, exemplar locations, time zone names like
"Coordinated Universal Time" and "British Summer Time") for
completeness. For the Polish case, many are already capitalized, but
capitalizing the first letter is therefore a no-op. The
"GMT+xx:xx"-style strings have not been changed.

Bug: 190109975
Test: Visual inspection in English and Polish of UTC, United States,
Russia in the time zone picker and the date & time screen on mobile

Change-Id: I57d915ac1e30e22cc05e605fcb7d46b102fa8ce1
2022-04-05 15:51:05 +01:00
Victor Chang
fc4589448b Replace @CorePlatformApi APIs usages in TimeZoneInfoPreferenceControllerTest
The time zone transitions can be obtained via the public API
ZoneId.getRules() instead.

Bug: 119751170
Test: atest SettingsRoboTests
     com.android.settings.datetime.timezone.TimeZoneInfoPreferenceControllerTest passes
Change-Id: I2c7864580b2a36b725ee250253e97f6cc86d72a4
2021-09-20 15:57:42 +01:00
Neil Fuller
eafec7a244 Fix missing zone strings in some cases
ICU's TimeZoneNames requires a "canonical" zone ID, otherwise it will
return no data. Usually the ID being used is the same as the canonical
ID so there's no problem. TZDB version 2020a switched the ID of one of
Greenland's zones from America/Godthab to America/Nuuk, and ICU/CLDR
hold their translation data against America/Godthab in the current
version of ICU on Android.

Bug: 155167041
Test: Manual - viewed settings on a device with the tzdb 2020a update
Change-Id: Ia89c777a832f8b41c8d56d3327a9b7370ba44b52
2020-04-29 10:16:19 +01:00
Victor Chang
4da3a7b5a8 Remove dead code in time zone picker
The codes are unused due to the UX changes in b/73952488

Test: m RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.datetime.timezone
Bug: 72376227
Change-Id: I9562e97fe13a3c00f8c142f30af7ca350af10757
2018-03-29 19:01:26 +01:00
Victor Chang
77f97af8eb Fix incorrect GMT offset in display
- android.icu.impl.TimeZoneAdapter doesn't fully implement
java.util.TimeZone, e.g. does not override getOffset(long date).
TimeZoneAdapter isn't a public API in ICU/Android. It shouldn't be
used in the first place

Bug: 77223510
Test: m RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.datetime.timezone
Change-Id: Ic0d7794326948796dcc5cc0b268ef634a74803c4
2018-03-28 19:52:05 +01:00
Victor Chang
6c33caad4b Time Zone data loader
- Use CountryZonesFinder to provide time zone id and region-to-timezone
  mapping, where the underlying data is updatable through an unbundled time zone
  data app in some devices.

Bug: 73952488
Bug: 72144448
Test: m RunSettingsRoboTests
Change-Id: I2e01e167c48987ebb98d4881a1a528d16dd82944
2018-03-02 19:24:48 +00:00
Joachim Sauer
0bed37a086 Data loading component for new time zone picker.
Add new data loading classes for improved manual time zone picker.

These classes use existing sources mostly from ICU4J to construct the
list of regions and timezones to present to the user.

Test: SettingsRoboTests
Bug: 62255208
Change-Id: I244c391a41b0b53cd3f7857f9c0d1ef766a39b17
2018-01-11 12:18:54 +00:00