From 5e014444ac04d469fc0731c251bf2d8227d4dcdf Mon Sep 17 00:00:00 2001 From: Suresh Kumar N Date: Thu, 17 Dec 2015 12:15:08 +0530 Subject: [PATCH] Fix Duplicated TZ offset check bug - fix ISO country code save bug Change-Id: I705dcc9ab1b8ed179f5dcaa45f92cc3a2e4dcb66 --- packaging/tel-plugin-nitz.spec | 2 +- src/desc-nitz.c | 2 +- src/time_update.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packaging/tel-plugin-nitz.spec b/packaging/tel-plugin-nitz.spec index ef9a9e4..45c0ac5 100644 --- a/packaging/tel-plugin-nitz.spec +++ b/packaging/tel-plugin-nitz.spec @@ -3,7 +3,7 @@ %define major 0 %define minor 1 -%define patchlevel 71 +%define patchlevel 72 Name: tel-plugin-nitz Summary: nitz plugin for telephony diff --git a/src/desc-nitz.c b/src/desc-nitz.c index 3d11c02..1312bd4 100644 --- a/src/desc-nitz.c +++ b/src/desc-nitz.c @@ -309,6 +309,7 @@ static void _check_fix_time_zone(struct nitz_custom_data *custom_data) nitz_apply_tzfile (timezone_name); _stop_nitz_waiting(custom_data); } + nitz_set_iso(iso); } else { info("Same Area. Do not change timezone now"); } @@ -332,7 +333,6 @@ static void _check_fix_time_zone(struct nitz_custom_data *custom_data) if (mcc >= 0) { info("Cannot find. Timezone for mcc:[%d]. Ask to user", mcc); _wait_nitz_and_timezone_select_by_user(custom_data); - nitz_set_iso(iso); } EXIT: g_list_free_full(tz_list, g_free); diff --git a/src/time_update.c b/src/time_update.c index 9e5c38c..f13c11c 100644 --- a/src/time_update.c +++ b/src/time_update.c @@ -315,7 +315,7 @@ GList * nitz_get_tzlist(char *iso) GList *tz_list = NULL; UCalendar *cal = NULL; unsigned int offset_hash = 0; - gboolean dup_check[48][2]; // offset*2, dst + gboolean dup_check[52][2]; /* [offset*2][dst], offset max : GMT+13 */ enum_tz = ucal_openTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL, iso, NULL, &ec); memset(dup_check, FALSE, sizeof(dup_check)); @@ -334,9 +334,8 @@ GList * nitz_get_tzlist(char *iso) offset_hash = (offset/1800000) + 24; ucal_close(cal); - dbg("TZ DST:[%d] TZ offset:[%d] offset_hash:[%d]", in_dst, offset, offset_hash); if (dup_check[offset_hash][in_dst] == TRUE) { - dbg("Ignore Duplicated"); + info("Ignore Duplicated! OFFSET:[%d] DST:[%d] Hash:[%d]", offset, in_dst, offset_hash); continue; } dup_check[offset_hash][in_dst] = TRUE; @@ -344,7 +343,7 @@ GList * nitz_get_tzlist(char *iso) timezone_name = (char *)g_malloc0(NITZ_TIMEZONE_MAX_LEN); u_UCharsToChars(timezone_id, timezone_name, NITZ_TIMEZONE_MAX_LEN); tz_list = g_list_append(tz_list, timezone_name); - info("[TIMESTAMP] ISO:[%s] offset:[%d], Available TZ:[%s]", iso, offset, timezone_name); + info("[TIMESTAMP] ISO:[%s] OFFSET:[%d] DST:[%d] TZ:[%s] Hash:[%d]", iso, offset, in_dst, timezone_name, offset_hash); } uenum_close(enum_tz); return tz_list; -- 2.7.4