diff options
author | Drew Parsons <dparsons@emerall.com> | 2014-06-23 15:37:05 +1000 |
---|---|---|
committer | Drew Parsons <dparsons@emerall.com> | 2014-11-26 01:43:10 +0100 |
commit | 9a565f8fe47f09b3275d7cb425b62117e26be4e9 (patch) | |
tree | c1ad95f0074e085accc4aa59cd9e4ce7375e3a23 /util/unicode | |
parent | 1611adc17eda0f4a85aea8d9cb4c5d01be0eda41 (diff) |
provide Android timezones in QTimeZone
QTimeZone on a unix-based system expects IANA (Olson) timezones to be
provided in /usr/share/zoneinfo or /usr/lib/zoneinfo. But on an
Android system the timezone datafiles at this location are incomplete
(Android instead uses the java class java.util.TimeZone). QTimeZone on
Android therefore would only return the default UTC timezones, not the
full set of IANA timezones.
This patch invokes JNI on an Android system to make the full set of
java timezones known to QTimeZone.
The implementation adds a new QAndroidTimeZonePrivate class, invoked
by the private implementation of QTimeZone in place of
QTzTimeZonePrivate. QAndroidTimeZonePrivate contains adds a new
QJNIObjectPrivate [java.util.TimeZone] androidTimeZone property which
is used to access the java timezone API.
Android limitations:
1) the java class java.util.TimeZone does not provide transitions
(see http://developer.android.com/reference/java/util/TimeZone.html).
2) abbreviation( ) is provided using Java TimeZone::getDisplayName( )
with the java SHORT style. This sometimes generates a GMT reference
instead of a three-letter code, e.g. America/Sao_Paulo returns
"GMT-03:00" instead of "BRT"
3) hasDaylightTime() is handled using Java
TimeZone::useDaylightTime(), which according to java (Android)
documentation only tests for future transitions, not past transitions.
This might conflict with the Qt documentation for this function (which
is intended to test also for past transitions).
[ChangeLog][Platform Specific Changes][Android][QtCore][QTimeZone]
Android timezones are now available in QTimeZone.
Change-Id: I165a39b7d4cb30b68f2da8556d85fc5b4480da4b
Task-number: QTBUG-35908
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'util/unicode')
0 files changed, 0 insertions, 0 deletions