glib: Update gtimezone.c patch after review

This commit is contained in:
Fredrik Fornwall 2017-12-21 13:42:24 +01:00
parent 87da5b98dc
commit 1f277e186d
1 changed files with 19 additions and 18 deletions

View File

@ -18,20 +18,21 @@ diff -u -r ../glib-2.54.2/glib/gtimezone.c ./glib/gtimezone.c
/** /**
* SECTION:timezone * SECTION:timezone
* @title: GTimeZone * @title: GTimeZone
@@ -392,7 +399,116 @@ @@ -392,7 +399,117 @@
gtz->transitions = NULL; gtz->transitions = NULL;
} }
-#ifdef G_OS_UNIX -#ifdef G_OS_UNIX
+#ifdef __ANDROID__ +#ifdef __ANDROID__
+/* Android uses a 'persist.sys.timezone' system property for the +/* Android uses a 'persist.sys.timezone' system property for the
+ current timezone instead of a /etc/localtime file: + * current timezone instead of a /etc/localtime file:
+ https://android.googlesource.com/platform/ndk/+/android-2.2_r1/docs/system/libc/OVERVIEW.TXT#67 + * https://android.googlesource.com/platform/ndk/+/android-2.2_r1/docs/system/libc/OVERVIEW.TXT#67
+ + *
+ There are no files under /usr/share/zoneinfo - instead a single + * There are no files under /usr/share/zoneinfo - instead a single
+ /system/usr/share/zoneinfo/tzdata file is used which contains all + * /system/usr/share/zoneinfo/tzdata file is used which contains all
+ files compiled together with the following tool: + * files compiled together with the following tool:
+ https://android.googlesource.com/platform/system/timezone/+/master/zone_compactor/main/java/ZoneCompactor.java */ + * https://android.googlesource.com/platform/system/timezone/+/master/zone_compactor/main/java/ZoneCompactor.java
+ */
+static GBytes * +static GBytes *
+zone_info_android (const gchar *identifier) +zone_info_android (const gchar *identifier)
+{ +{