Functions | |
int | mcc_tz_is_tz_name_in_country_tz_list (const char *tz_name) |
void | mcc_tz_guess_tz_for_country_by_dst_and_offset (struct tm *utc_tm, int dst, int gmtoff, char **tz_name) |
void | mcc_tz_setup_timezone_from_mcc_if_required (void) |
void | mcc_tz_handle_registration_status_reply (struct DBusMessage *msg) |
int | mcc_tz_utils_init (struct DBusConnection *server_system_bus, GetAutosyncEnabled server_get_autosync_enabled, HandleCsdNetTimeChange server_handle_csd_net_time_change, SetOperatorTz server_set_operator_tz) |
void | mcc_tz_utils_quit (void) |
int mcc_tz_is_tz_name_in_country_tz_list | ( | const char * | tz_name | ) |
Checks if given timezone name is in timezone list for currnt country
tz_name | timezone name for searching |
Referenced by handle_csd_net_time_change().
void mcc_tz_guess_tz_for_country_by_dst_and_offset | ( | struct tm * | utc_tm, | |
int | dst, | |||
int | gmtoff, | |||
char ** | tz_name | |||
) |
Guesses named timezone for current country which has the same DST and GMT offset as requested in given UTC time. Returns first found name in tz_name or NULL if not found.
utc_tm | UTC time to search in | |
dst | DST for searching timezone in given UTC time | |
gmtoff | GMT offset for searching timezone in given UTC time | |
tz_name | name of found timezone for requested parameters or NULL if not found It shall not be freed since it is pointer to string contained in country_tz_name_list Also the user must dup this string if it is needed in next mainloop cycle since the list might be updated in-between. |
Referenced by handle_csd_net_time_change().
void mcc_tz_setup_timezone_from_mcc_if_required | ( | void | ) |
If autoupdate is on, it sends get registration status request to CSD. It launches procedure to update time if device is registered in network.
Also the method asks D-Bus to notify about registration status change signal if time autoupdate is on and remove this tracking if time autoupdate is off. The signal is handled by server_filter (refer to mcc_tz_init also).
If autoupdate is on, it sends get registration status request to CSD. It launches procedure to update time if device is registered in network. Reply is catched by mcc_tz_registration_status_reply_dbus_cb callback.
Also the method asks D-Bus to notify about registration status change signal if time autoupdate is on and remove this tracking if time autoupdate is off. The signal is handled by server_filter (refer to mcc_tz_init also).
Referenced by mcc_tz_utils_init(), and server_set_autosync_cb().
void mcc_tz_handle_registration_status_reply | ( | DBusMessage * | msg | ) |
Handle reply on get registration status request to CSD. If registered in home or roaming network and received MCC is not equal to cached one, launch network time update attempt, since country (and timezone probably) is changed.
msg | D-Bus reply on get registration status request to CSD |
Referenced by mcc_tz_registration_status_reply_dbus_cb(), and server_filter().
int mcc_tz_utils_init | ( | DBusConnection * | server_system_bus, | |
GetAutosyncEnabled | server_get_autosync_enabled, | |||
HandleCsdNetTimeChange | server_handle_csd_net_time_change, | |||
SetOperatorTz | server_set_operator_tz | |||
) |
Fuction to init mcc_tz module
server_system_bus | pointer to system DBUS | |
server_get_autosync_enabled | pointer to function to get autosync_enabled value | |
server_handle_csd_net_time_change | pointer to function to handle time info message from csd | |
server_set_operator_tz | pointer to function to set operator timezone |
Referenced by server_init().
void mcc_tz_utils_quit | ( | void | ) |
Fuction to free resources allocated by mcc_tz module
Referenced by server_quit().