Fix Duplicated TZ offset check bug 78/54678/1 accepted/tizen/ivi/20160218.024025 accepted/tizen/mobile/20151217.093704 accepted/tizen/tv/20151217.093640 accepted/tizen/wearable/20151217.093648 submit/tizen/20151217.075715 submit/tizen_common/20151229.142028 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000003
authorSuresh Kumar N <suresh.n@samsung.com>
Thu, 17 Dec 2015 06:45:08 +0000 (12:15 +0530)
committerSuresh Kumar N <suresh.n@samsung.com>
Thu, 17 Dec 2015 06:48:15 +0000 (12:18 +0530)
  - fix ISO country code save bug

Change-Id: I705dcc9ab1b8ed179f5dcaa45f92cc3a2e4dcb66

packaging/tel-plugin-nitz.spec
src/desc-nitz.c
src/time_update.c

index ef9a9e4..45c0ac5 100644 (file)
@@ -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
index 3d11c02..1312bd4 100644 (file)
@@ -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);
index 9e5c38c..f13c11c 100644 (file)
@@ -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;