4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.tizenopensource.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include <ui-gadget-module.h>
23 #include <bundle_internal.h>
24 #include <efl_extension.h>
28 #include "common_utils.h"
29 #include "i18nmanager.h"
31 #define SUPPLICANT_SERVICE "fi.w1.wpa_supplicant1"
32 #define SUPPLICANT_SERVICE_INTERFACE SUPPLICANT_SERVICE ".Interface"
33 #define COLOR_TABLE "/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_ChangeableColorTable.xml"
34 #define FONT_TABLE "/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_FontInfoTable.xml"
39 } two_line_disp_data_t;
41 struct managed_idle_data {
47 struct gdbus_connection_data {
48 GDBusConnection *connection;
49 guint subscribe_id_supplicant;
52 static __thread struct gdbus_connection_data gdbus_conn = { NULL, 0 };
53 static GSList *managed_idler_list = NULL;
54 static int (*rotate_cb)(enum appcore_rm, void*, Eina_Bool, Eina_Bool) = NULL;
55 static void *rotate_cb_data = NULL;
56 static Eina_Bool is_wps = EINA_FALSE;
57 static Eina_Bool is_setting = EINA_FALSE;
58 static Eina_Bool is_portrait_mode = EINA_TRUE;
59 static Ecore_Timer *scan_update_timer = NULL;
61 static char *__common_utils_2line_text_get(void *data, Evas_Object *obj, const char *part)
63 two_line_disp_data_t *item_data = (two_line_disp_data_t *)data;
64 if (!g_strcmp0(part, "elm.text.sub.left.bottom")) {
65 return g_strdup(item_data->info_str);
66 } else if (!g_strcmp0(part, "elm.text.main.left.top")) {
67 return g_strdup(item_data->title_str);
72 static void __common_utils_2line_text_del(void *data, Evas_Object *obj)
74 two_line_disp_data_t *item_data = (two_line_disp_data_t *)data;
76 g_free(item_data->info_str);
77 g_free(item_data->title_str);
82 static void __common_utils_separator_del(void *data, Evas_Object *obj)
84 elm_genlist_item_class_free(data);
88 Eina_Bool common_utils_is_portrait_mode(void)
90 return is_portrait_mode;
93 static void __common_utils_set_portrait_mode(Eina_Bool on)
95 is_portrait_mode = on;
98 void common_utils_set_rotate_cb(int (*func)(enum appcore_rm, void*, Eina_Bool, Eina_Bool),
99 void *data, Eina_Bool wps_value, Eina_Bool setting_value)
102 rotate_cb_data = data;
104 is_setting = setting_value;
107 static void __common_utils_rotate_popup(enum appcore_rm rotmode)
110 rotate_cb(rotmode, rotate_cb_data, is_wps, is_setting);
114 void common_utils_contents_rotation_adjust(int event)
116 if (event == UG_EVENT_ROTATE_PORTRAIT ||
117 event == UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN) {
118 __common_utils_rotate_popup(APPCORE_RM_PORTRAIT_NORMAL);
119 __common_utils_set_portrait_mode(EINA_TRUE);
121 __common_utils_rotate_popup(APPCORE_RM_LANDSCAPE_NORMAL);
122 __common_utils_set_portrait_mode(EINA_FALSE);
126 Elm_Object_Item* common_utils_add_dialogue_separator(Evas_Object* genlist, const char *separator_style)
128 assertm_if(NULL == genlist, "NULL!!");
130 static Elm_Genlist_Item_Class *separator_itc;
131 separator_itc = elm_genlist_item_class_new();
132 separator_itc->item_style = separator_style;
133 separator_itc->func.text_get = NULL;
134 separator_itc->func.content_get = NULL;
135 separator_itc->func.state_get = NULL;
136 separator_itc->func.del = __common_utils_separator_del;
138 Elm_Object_Item* sep = elm_genlist_item_append(
143 ELM_GENLIST_ITEM_GROUP,
147 assertm_if(NULL == sep, "NULL!!");
149 elm_genlist_item_select_mode_set(sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
154 char *common_utils_get_ap_security_type_info_txt(const char *pkg_name,
155 wifi_device_info_t *device_info, bool check_fav)
157 bool favorite = false;
159 char *status_txt = NULL;
161 /* TODO: temporary disabled */
163 wifi_connection_state_e state;
164 wifi_connection_error_e error;
166 wifi_ap_get_connection_state(device_info->ap, &state);
167 if (state == WIFI_CONNECTION_STATE_FAILURE) {
168 error = wlan_manager_get_connection_error_state(device_info->ap);
170 if (error == WIFI_CONNECTION_ERROR_INVALID_KEY)
171 return g_strdup(sc(pkg_name,
172 I18N_TYPE_WIFI_AUTHENTICATION_ERROR_OCCURRED));
174 if (error == WIFI_CONNECTION_ERROR_DHCP_FAILED)
175 return g_strdup(sc(pkg_name,
176 I18N_TYPE_WIFI_FAILED_TO_OBTAIN_IP_ADDRESS));
180 switch (device_info->security_mode) {
181 case WLAN_SEC_MODE_NONE: /** Security disabled */
182 status_txt = g_strdup(sc(pkg_name, I18N_TYPE_Open));
184 case WLAN_SEC_MODE_IEEE8021X: /** EAP */
185 status_txt = g_strdup_printf("%s (%s)", sc(pkg_name, I18N_TYPE_Secured),
186 sc(pkg_name, I18N_TYPE_EAP));
188 case WLAN_SEC_MODE_WEP: /** WEP */
189 case WLAN_SEC_MODE_WPA_PSK: /** WPA-PSK */
190 case WLAN_SEC_MODE_WPA2_PSK: /** WPA2-PSK */
191 if (TRUE == device_info->wps_mode) {
192 status_txt = g_strdup_printf("%s (%s)", sc(pkg_name,
193 I18N_TYPE_Secured), sc(pkg_name, I18N_TYPE_WPS_Available));
195 status_txt = g_strdup(sc(pkg_name, I18N_TYPE_Secured));
198 default: /** Unknown */
199 status_txt = g_strdup(sc(pkg_name, I18N_TYPE_Unknown));
203 if (true == check_fav) {
204 wifi_ap_is_favorite(device_info->ap, &favorite);
205 if (true == favorite) {
207 status_txt = g_strdup_printf("%s, %s",
208 sc(pkg_name, I18N_TYPE_Saved), temp);
216 void common_utils_get_device_icon(wifi_device_info_t *device_info, char **icon_path)
218 char buf[MAX_DEVICE_ICON_PATH_STR_LEN] = {'\0', };
220 g_strlcat(buf, "A01-3_icon", sizeof(buf));
222 if (device_info->security_mode != WLAN_SEC_MODE_NONE) {
223 g_strlcat(buf, "_lock", sizeof(buf));
226 switch (wlan_manager_get_signal_strength(device_info->rssi)) {
227 case SIGNAL_STRENGTH_TYPE_EXCELLENT:
228 g_strlcat(buf, "_03", sizeof(buf));
230 case SIGNAL_STRENGTH_TYPE_GOOD:
231 g_strlcat(buf, "_02", sizeof(buf));
233 case SIGNAL_STRENGTH_TYPE_WEAK:
234 g_strlcat(buf, "_01", sizeof(buf));
236 case SIGNAL_STRENGTH_TYPE_VERY_WEAK:
237 case SIGNAL_STRENGTH_TYPE_NULL:
239 g_strlcat(buf, "_00", sizeof(buf));
244 *icon_path = g_strdup_printf("%s", buf);
248 char *common_utils_get_rssi_text(const char *str_pkg_name, int rssi)
250 switch (wlan_manager_get_signal_strength(rssi)) {
251 case SIGNAL_STRENGTH_TYPE_EXCELLENT:
252 return g_strdup(sc(str_pkg_name, I18N_TYPE_Excellent));
253 case SIGNAL_STRENGTH_TYPE_GOOD:
254 return g_strdup(sc(str_pkg_name, I18N_TYPE_Good));
256 return g_strdup(sc(str_pkg_name, I18N_TYPE_Weak));
260 void common_utils_set_edit_box_imf_panel_evnt_cb(Elm_Object_Item *item,
261 imf_ctxt_panel_cb_t input_panel_cb, void *user_data)
263 __COMMON_FUNC_ENTER__;
264 common_utils_entry_info_t *entry_info;
265 entry_info = elm_object_item_data_get(item);
270 entry_info->input_panel_cb = input_panel_cb;
271 entry_info->input_panel_cb_data = user_data;
273 Evas_Object *entry = elm_object_item_part_content_get(item, "elm.icon.entry");
274 Ecore_IMF_Context *imf_ctxt = elm_entry_imf_context_get(entry);
275 if (imf_ctxt && entry_info->input_panel_cb) {
276 /* Deleting the previously attached callback */
277 ecore_imf_context_input_panel_event_callback_del(imf_ctxt,
278 ECORE_IMF_INPUT_PANEL_STATE_EVENT,
279 entry_info->input_panel_cb);
280 ecore_imf_context_input_panel_event_callback_add(imf_ctxt,
281 ECORE_IMF_INPUT_PANEL_STATE_EVENT,
282 entry_info->input_panel_cb,
283 entry_info->input_panel_cb_data);
284 DEBUG_LOG(UG_NAME_NORMAL, "set the imf ctxt cbs");
287 __COMMON_FUNC_EXIT__;
291 void common_utils_edit_box_focus_set(Elm_Object_Item *item, Eina_Bool focus_set)
293 __COMMON_FUNC_ENTER__;
298 Evas_Object *entry = elm_object_item_part_content_get(item, "elm.icon.entry");
301 elm_object_focus_set(entry, focus_set);
302 elm_object_focus_allow_set(entry, focus_set);
305 __COMMON_FUNC_EXIT__;
309 void common_utils_edit_box_allow_focus_set(Elm_Object_Item *item,
312 __COMMON_FUNC_ENTER__;
317 Evas_Object *entry = elm_object_item_part_content_get(item, "elm.icon.entry");
318 elm_object_focus_allow_set(entry, focus_set);
320 __COMMON_FUNC_EXIT__;
324 Elm_Object_Item *common_utils_add_2_line_txt_disabled_item(
325 Evas_Object* view_list, const char *style_name,
326 const char *line1_txt, const char *line2_txt)
328 static Elm_Genlist_Item_Class two_line_display_itc;
329 two_line_disp_data_t *two_line_data = NULL;
330 Elm_Object_Item *item = NULL;
332 two_line_display_itc.item_style = style_name;
333 two_line_display_itc.func.text_get = __common_utils_2line_text_get;
334 two_line_display_itc.func.content_get = NULL;
335 two_line_display_itc.func.state_get = NULL;
336 two_line_display_itc.func.del = __common_utils_2line_text_del;
338 two_line_data = g_new0(two_line_disp_data_t, 1);
339 two_line_data->title_str = g_strdup(line1_txt);
340 two_line_data->info_str = g_strdup(line2_txt);
341 SECURE_INFO_LOG(UG_NAME_NORMAL, "title_str = %s info_str = %s",
342 two_line_data->title_str, two_line_data->info_str);
344 item = elm_genlist_item_append(view_list, &two_line_display_itc,
345 two_line_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
346 elm_object_item_disabled_set(item, TRUE);
351 char *common_utils_get_list_item_entry_txt(Elm_Object_Item *entry_item)
353 common_utils_entry_info_t *entry_info =
354 (common_utils_entry_info_t *)elm_object_item_data_get(entry_item);
355 if (entry_info == NULL) {
359 DEBUG_LOG(UG_NAME_NORMAL, "entry_info: 0x%x", entry_info);
361 return g_strdup(entry_info->entry_txt);
364 Evas_Object *common_utils_create_layout(Evas_Object *navi_frame)
367 layout = elm_layout_add(navi_frame);
368 elm_layout_theme_set(layout, "layout", "application", "noindicator");
369 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
371 Evas_Object* bg = elm_bg_add(layout);
372 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
373 elm_object_style_set(bg, "group_list");
374 elm_object_part_content_set(layout, "elm.swallow.bg", bg);
376 evas_object_show(layout);
381 static void __common_utils_del_popup(void *data, Evas_Object *obj, void *event_info)
383 Evas_Object *popup = (Evas_Object *)data;
384 evas_object_del(popup);
387 Evas_Object *common_utils_show_info_popup(Evas_Object *parent,
388 popup_btn_info_t *popup_data)
390 __COMMON_FUNC_ENTER__;
392 Evas_Object *popup = elm_popup_add(parent);
396 ERROR_LOG(UG_NAME_ERR, "Could not add popup");
400 elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
401 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
403 if (popup_data->title_txt) {
404 txt = evas_textblock_text_utf8_to_markup(NULL, popup_data->title_txt);
405 elm_object_domain_translatable_part_text_set(popup,
406 "title,text", PACKAGE, txt);
410 if (popup_data->info_txt) {
411 elm_object_domain_translatable_text_set(popup, PACKAGE,
412 popup_data->info_txt);
415 if (popup_data->btn1_txt) {
416 Evas_Object *btn_1 = elm_button_add(popup);
417 elm_object_style_set(btn_1, "popup");
418 elm_object_domain_translatable_text_set(btn_1, PACKAGE ,
419 popup_data->btn1_txt );
420 elm_object_part_content_set(popup, "button1", btn_1);
421 if (popup_data->btn1_cb) {
422 evas_object_smart_callback_add(btn_1, "clicked",
423 popup_data->btn1_cb, popup_data->btn1_data);
424 eext_object_event_callback_add(popup, EA_CALLBACK_BACK,
425 popup_data->btn1_cb, popup_data->btn1_data);
427 evas_object_smart_callback_add(btn_1, "clicked",
428 __common_utils_del_popup, popup);
429 eext_object_event_callback_add(popup, EA_CALLBACK_BACK,
430 __common_utils_del_popup, popup);
434 if (popup_data->btn2_txt) {
435 Evas_Object *btn_2 = elm_button_add(popup);
436 elm_object_style_set(btn_2, "popup");
437 /* This button reference used in case of hidden AP case */
438 popup_data->btn = btn_2;
439 elm_object_domain_translatable_text_set(btn_2, PACKAGE,
440 popup_data->btn2_txt);
441 elm_object_part_content_set(popup, "button2", btn_2);
442 //evas_object_smart_callback_add(btn_2, "clicked", popup_data->btn2_cb, NULL);
443 evas_object_show(popup);
444 if (popup_data->btn2_cb) {
445 evas_object_smart_callback_add(btn_2, "clicked",
446 popup_data->btn2_cb, popup_data->btn2_data);
448 evas_object_smart_callback_add(btn_2, "clicked",
449 __common_utils_del_popup, popup);
453 evas_object_show(popup);
454 elm_object_focus_set(popup, EINA_TRUE);
459 Evas_Object *common_utils_show_info_ok_popup(Evas_Object *win,
460 const char *str_pkg_name, const char *info_txt,
461 Evas_Smart_Cb ok_cb, void *cb_data)
463 popup_btn_info_t popup_data;
465 memset(&popup_data, 0, sizeof(popup_data));
466 popup_data.info_txt = (char *)info_txt;
467 popup_data.btn1_txt = sc(str_pkg_name, I18N_TYPE_Ok);
468 popup_data.btn1_cb = ok_cb;
469 popup_data.btn1_data = cb_data;
471 return common_utils_show_info_popup(win, &popup_data);
474 Evas_Object *common_utils_show_info_timeout_popup(Evas_Object *win,
475 const char* info_text, const double timeout)
477 Evas_Object *popup = elm_popup_add(win);
479 elm_object_text_set(popup, info_text);
480 elm_popup_timeout_set(popup, timeout);
481 evas_object_smart_callback_add(popup, "timeout",
482 __common_utils_del_popup, popup);
483 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
484 elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
485 evas_object_show(popup);
490 int common_utils_get_rotate_angle(enum appcore_rm rotate_mode)
493 if (APPCORE_RM_UNKNOWN == rotate_mode) {
494 appcore_get_rotation_state(&rotate_mode);
497 DEBUG_LOG(SP_NAME_NORMAL, "rotate_mode = %d", rotate_mode);
499 switch (rotate_mode) {
500 case APPCORE_RM_PORTRAIT_NORMAL: /**< Portrait mode */
501 DEBUG_LOG(SP_NAME_NORMAL, "rotate mode is APPCORE_RM_PORTRAIT_NORMAL");
505 case APPCORE_RM_PORTRAIT_REVERSE: /**< Portrait upside down mode */
506 DEBUG_LOG(SP_NAME_NORMAL, "rotate mode is APPCORE_RM_PORTRAIT_REVERSE");
510 case APPCORE_RM_LANDSCAPE_NORMAL: /**< Left handed landscape mode */
511 DEBUG_LOG(SP_NAME_NORMAL, "rotate mode is APPCORE_RM_LANDSCAPE_NORMAL");
515 case APPCORE_RM_LANDSCAPE_REVERSE: /**< Right handed landscape mode */
516 DEBUG_LOG(SP_NAME_NORMAL, "rotate mode is APPCORE_RM_LANDSCAPE_REVERSE");
521 ERROR_LOG(SP_NAME_ERR, "Invalid rotate mode. The default value (0) is set to 'rotate_angle'.");
529 wlan_security_mode_type_t common_utils_get_sec_mode(wifi_security_type_e sec_type)
532 case WIFI_SECURITY_TYPE_NONE:
533 return WLAN_SEC_MODE_NONE;
534 case WIFI_SECURITY_TYPE_WEP:
535 return WLAN_SEC_MODE_WEP;
536 case WIFI_SECURITY_TYPE_WPA_PSK:
537 return WLAN_SEC_MODE_WPA_PSK;
538 case WIFI_SECURITY_TYPE_WPA2_PSK:
539 return WLAN_SEC_MODE_WPA_PSK;
540 case WIFI_SECURITY_TYPE_EAP:
541 return WLAN_SEC_MODE_IEEE8021X;
543 return WLAN_SEC_MODE_NONE;
546 return WLAN_SEC_MODE_NONE;
549 int common_utils_send_message_to_net_popup(const char *title,
550 const char *content, const char *type, const char *ssid)
553 bundle *b = bundle_create();
555 bundle_add(b, "_SYSPOPUP_TITLE_", title);
556 bundle_add(b, "_SYSPOPUP_CONTENT_", content);
557 bundle_add(b, "_SYSPOPUP_TYPE_", type);
558 bundle_add(b, "_AP_NAME_", ssid);
560 ret = aul_launch_app("net.netpopup", b);
567 int common_util_set_system_registry(const char *key, int value)
569 __COMMON_FUNC_ENTER__;
571 if (vconf_set_int(key, value) < 0) {
572 ERROR_LOG(UG_NAME_NORMAL, "Failed to set vconf");
574 __COMMON_FUNC_EXIT__;
578 __COMMON_FUNC_EXIT__;
582 int common_util_get_system_registry(const char *key)
584 __COMMON_FUNC_ENTER__;
588 if (vconf_get_int(key, &value) < 0) {
589 ERROR_LOG(UG_NAME_NORMAL, "Failed to get vconf");
591 __COMMON_FUNC_EXIT__;
595 __COMMON_FUNC_EXIT__;
599 static void __common_util_managed_idle_destroy_cb(gpointer data)
605 managed_idler_list = g_slist_remove(managed_idler_list, data);
609 static gboolean __common_util_managed_idle_cb(gpointer user_data)
611 struct managed_idle_data *data = (struct managed_idle_data *)user_data;
617 return data->func(data->user_data);
620 guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data)
623 struct managed_idle_data *data;
629 data = g_try_new0(struct managed_idle_data, 1);
635 data->user_data = user_data;
637 id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, __common_util_managed_idle_cb,
638 data, __common_util_managed_idle_destroy_cb);
646 managed_idler_list = g_slist_append(managed_idler_list, data);
651 void common_util_managed_idle_cleanup(void)
653 if (managed_idler_list == NULL) {
657 GSList *cur = managed_idler_list;
659 struct managed_idle_data *data;
662 GSList *next = cur->next;
663 data = (struct managed_idle_data *)cur->data;
665 src = g_main_context_find_source_by_id(g_main_context_default(), data->id);
667 g_source_destroy(src);
668 cur = managed_idler_list;
674 g_slist_free(managed_idler_list);
675 managed_idler_list = NULL;
678 void common_util_managed_ecore_scan_update_timer_add(double interval,
679 common_util_scan_update_cb callback, void *data)
681 if (callback == NULL)
684 common_util_managed_ecore_scan_update_timer_del();
686 scan_update_timer = ecore_timer_add(interval, callback, data);
689 void common_util_managed_ecore_scan_update_timer_del(void)
691 if (scan_update_timer != NULL) {
692 ecore_timer_del(scan_update_timer);
693 scan_update_timer = NULL;
697 void common_util_manager_ecore_scan_update_timer_reset(void)
699 scan_update_timer = NULL;
702 static GDBusConnection *common_util_get_gdbus_conn(void)
704 GError *error = NULL;
706 if (gdbus_conn.connection != NULL)
707 return gdbus_conn.connection;
709 #if !GLIB_CHECK_VERSION(2,36,0)
713 gdbus_conn.connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
714 if (gdbus_conn.connection == NULL) {
715 ERROR_LOG(UG_NAME_NORMAL,
716 "Failed to connect to the D-BUS daemon: [%s]\n", error->message);
721 return gdbus_conn.connection;
724 gboolean common_util_subscribe_scanning_signal(GDBusSignalCallback callback)
726 GDBusConnection *connection;
728 connection = common_util_get_gdbus_conn();
729 if (connection == NULL) {
730 ERROR_LOG(UG_NAME_NORMAL, "failed to get gdbus_conn");
734 /* Create supplicant service connection */
735 gdbus_conn.subscribe_id_supplicant = g_dbus_connection_signal_subscribe(
738 SUPPLICANT_SERVICE_INTERFACE,
742 G_DBUS_SIGNAL_FLAGS_NONE,
747 if (gdbus_conn.subscribe_id_supplicant == 0) {
748 ERROR_LOG(UG_NAME_NORMAL, "Failed register signals "
750 gdbus_conn.subscribe_id_supplicant);
757 gboolean common_util_unsubscribe_scanning_signal(void)
759 GDBusConnection *connection;
761 connection = common_util_get_gdbus_conn();
762 if (connection == NULL) {
763 ERROR_LOG(UG_NAME_NORMAL, "failed to get gdbus_conn");
767 g_dbus_connection_signal_unsubscribe(connection,
768 gdbus_conn.subscribe_id_supplicant);
770 g_object_unref(gdbus_conn.connection);
771 gdbus_conn.connection = NULL;
776 int common_utils_get_sim_state(void)
778 int value = VCONFKEY_TELEPHONY_SIM_UNKNOWN;
781 value = common_util_get_system_registry(VCONFKEY_TELEPHONY_SIM_SLOT);
782 INFO_LOG(UG_NAME_NORMAL, "SIM slot 1 state : %d", value);
783 if (value == VCONFKEY_TELEPHONY_SIM_INSERTED) {
787 sim_count = common_util_get_system_registry(
788 VCONFKEY_TELEPHONY_SIM_SLOT_COUNT);
792 value = common_util_get_system_registry(VCONFKEY_TELEPHONY_SIM_SLOT2);
793 INFO_LOG(UG_NAME_NORMAL, "SIM slot 2 state : %d", value);