summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2019-09-03 08:42:08 +0100
committerNeil Fuller <nfuller@google.com>2019-09-10 12:05:44 +0100
commit8d94e409e59ca1a561eefd54079f8b6732171c76 (patch)
tree6877307383425c676d65c366ff1055ece89909e3 /annotations/generate_annotated_java_files.py
parentbc29d69fd84458be0a0cd55877e3224ffca7262d (diff)
Combine two versions of lookupByOffsetWithBias()
Combine two versions of CountryTimeZones.lookupByOffsetWithBias() into a single method. This takes the one marked deprecated that takes a boolean and the one that takes an Integer and provides a single method that can replace both. Originally, the intent was to move callers from the boolean version to the Integer version but this is likely impossible: 1) The boolean version is used to provide a public API that takes a boolean. It is not reasonable to assume "is DST" means "add one hour" to create an Integer value. 2) The Integer version is not necessarily superior: it makes the matching more exact but NITZ signals aren't necessarily correct so using this may have a negative affect on time zone detection. Historically, telephony couldn't tell the difference between "NITZ data says the time zone is not using DST" and "NITZ data says nothing about DST". This changed a couple of years ago when the telephony NitzData class was written. The new method more closely models the tri-state of NITZ's states: "local time is DST", "local time is not DST" and "No DST info available" with a Boolean. It still provides the "DST offset is X" and "DST offset is unknown" that was previously available with the Integer version. The tests associated with the two methods have also been combined, extended and changed to use arrays to try to improve readability / reduce cruft. Bug: 139091367 Bug: 140712361 Test: atest libcore.libcore.timezone.CountryTimeZonesTest Change-Id: I3257ebcb599455438272b24a597a622ecbe099a5
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions