Remove visiblity selection menu as the latest mobile UX 42/87442/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 8 Sep 2016 04:41:56 +0000 (13:41 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 8 Sep 2016 04:41:56 +0000 (13:41 +0900)
During BT setting is running, BT visible mode is on. Otherwise BT
visible mode is off.

Change-Id: I0f1cb60da0264749dd6eeb496494801df3d5896e
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bt-main-ug.h
include/bt-main-view.h
include/bt-util.h
src/libraries/bt-callback.c
src/libraries/bt-util.c
src/ui/bt-main-ug.c
src/ui/bt-main-view.c

index 20a4232..3192b9d 100644 (file)
@@ -115,9 +115,6 @@ typedef struct {
        Evas_Object *rename_entry;
        Evas_Object *rename_button;
 
-       /* Visibility object */
-       Evas_Object *visibility_popup;
-
        /* Paired / Searched device list */
        Eina_List *paired_device;
        Eina_List *searched_device;
@@ -128,16 +125,13 @@ typedef struct {
        /* Button */
        Evas_Object *onoff_btn;
        Evas_Object *scan_btn;
-       Evas_Object *radio_main;
 
        /* Genlist Item class */
        Elm_Genlist_Item_Class *device_name_itc;
        Elm_Genlist_Item_Class *rename_entry_itc;
        Elm_Genlist_Item_Class *rename_desc_itc;
-       Elm_Genlist_Item_Class *visible_itc;
        Elm_Genlist_Item_Class *paired_title_itc;
        Elm_Genlist_Item_Class *searched_title_itc;
-       Elm_Genlist_Item_Class *timeout_value_itc;
        Elm_Genlist_Item_Class *searched_device_itc;
        Elm_Genlist_Item_Class *no_device_itc;
        Elm_Genlist_Item_Class *paired_device_itc;
@@ -147,7 +141,6 @@ typedef struct {
        /* Genlist Items */
        Elm_Object_Item *onoff_item;
        Elm_Object_Item *device_name_item;
-       Elm_Object_Item *visible_item;
        Elm_Object_Item *paired_title;
        Elm_Object_Item *searched_title;
        Elm_Object_Item *no_device_item;
@@ -183,14 +176,8 @@ typedef struct {
        bundle *popup_bundle;
        void *handle;
        char phone_name[BT_GLOBALIZATION_STR_LENGTH];
-       int selected_radio;
-       int remain_time;
-       time_t start_time;
-       bool visible;
-       bool visibility_changed_by_ug;
        int timeout_id;
        int popup_timer;
-       int visibility_timeout;
        bt_dev_t *pick_device;
        void *connection;
        bool is_popup_exist;
@@ -201,6 +188,7 @@ typedef struct {
        /* End key callback */
        bt_app_back_cb back_cb;
 
+       Ecore_Timer *timer;
        Ecore_Timer *network_timer;
        /*************************
        *           Profile  View Data
index 2648f3b..3eafd03 100644 (file)
@@ -129,8 +129,6 @@ void _bt_main_add_searched_title(bt_ug_data *ugd);
 
 void _bt_main_add_device_name_item(bt_ug_data *ugd, Evas_Object *genlist);
 
-void _bt_main_add_visible_item(bt_ug_data *ugd, Evas_Object *genlist);
-
 void _bt_update_device_list(bt_ug_data *ugd);
 
 Evas_Object * _bt_main_create_scan_button(bt_ug_data *ugd);
index 861fc2d..b220dea 100644 (file)
@@ -62,6 +62,8 @@ void _bt_util_launch_no_event(void *data, void *obj, void *event);
 
 void _bt_util_set_list_disabled(Evas_Object *genlist, Eina_Bool disable);
 
+void _bt_util_change_discoverable_mode(bt_ug_data *ugd, gboolean discoverable);
+
 gboolean _bt_util_is_profile_connected(int connected_type, unsigned char *addr);
 
 int _bt_util_check_any_profile_connected(bt_dev_t *dev);
@@ -103,6 +105,8 @@ gboolean _bt_util_is_space_str(const char *name_str);
 void _bt_util_max_len_reached_cb(void *data, Evas_Object *obj,
                                        void *event_info);
 
+Eina_Bool _bt_timer_change_discoverable_mode(void *data);
+
 #ifndef TIZEN_TV
 char *_bt_util_vcard_create_from_id(int id, bool my_profile, const char *working_dir);
 
index a973d58..d639872 100644 (file)
@@ -105,28 +105,18 @@ static void __bt_cb_enable(int result, void *data)
                BT_ERR("Fail to get the timeout value");
        }
 
-       if (timeout == BT_ALWAYS_ON) {
-               ugd->visible = TRUE;
-               ugd->remain_time = 0;
-               ugd->visibility_timeout = timeout;
-               ugd->selected_radio = _bt_util_get_timeout_index(timeout);
-       }
+       _bt_util_change_discoverable_mode(ugd, TRUE);
 
        _bt_util_set_phone_name();
 
        if(!ugd->device_name_item)
                _bt_main_add_device_name_item(ugd, ugd->main_genlist);
 
-       if(!ugd->visible_item)
-               _bt_main_add_visible_item(ugd, ugd->main_genlist);
-
        if (ugd->empty_status_item) {
                elm_object_item_del(ugd->empty_status_item);
                ugd->empty_status_item = NULL;
        }
 
-       _bt_update_genlist_item(ugd->visible_item);
-
        if (ugd->bt_launch_mode == BT_LAUNCH_ONOFF) {
                g_idle_add((GSourceFunc) _bt_idle_destroy_ug, ugd);
                return;
@@ -173,11 +163,6 @@ static void __bt_cb_disable(int result, void *data)
                ugd->popup = NULL;
        }
 
-       if (ugd->visibility_popup) {
-               evas_object_del(ugd->visibility_popup);
-               ugd->visibility_popup = NULL;
-       }
-
        if (ugd->rename_popup) {
                evas_object_del(ugd->rename_popup);
                ugd->rename_popup = NULL;
@@ -200,30 +185,12 @@ static void __bt_cb_disable(int result, void *data)
                }
 
                ugd->op_status = BT_DEACTIVATED;
-               ugd->visible = FALSE;
-               ugd->remain_time = 0;
-
-               if (ugd->visibility_timeout != BT_ALWAYS_ON) {
-                       ugd->visibility_timeout = 0;
-                       ugd->selected_radio = 1;
-               }
 
                evas_object_del(ugd->scan_btn);
                ugd->scan_btn = NULL;
                elm_genlist_item_item_class_update(ugd->onoff_item,
                                                ugd->off_itc);
 
-               if (ugd->visible_item && EINA_TRUE == elm_genlist_item_expanded_get(
-                                                       ugd->visible_item)) {
-                       elm_genlist_item_expanded_set(ugd->visible_item,
-                                                       EINA_FALSE);
-               }
-
-               if(ugd->visible_item) {
-                       elm_object_item_del(ugd->visible_item);
-                       ugd->visible_item = NULL;
-               }
-
                if(ugd->device_name_item) {
                        elm_object_item_del(ugd->device_name_item);
                        ugd->device_name_item = NULL;
@@ -245,7 +212,6 @@ static void __bt_cb_disable(int result, void *data)
        }
 
        _bt_update_genlist_item(ugd->onoff_item);
-       _bt_update_genlist_item(ugd->visible_item);
        _bt_update_genlist_item(ugd->paired_title);
        _bt_update_genlist_item(ugd->searched_title);
 
@@ -483,42 +449,6 @@ static void __bt_cb_new_device_found(bt_adapter_device_discovery_info_s *info,
        FN_END;
 }
 
-static gboolean __bt_cb_visible_timeout_cb(gpointer user_data)
-{
-       FN_START;
-
-       bt_ug_data *ugd = NULL;
-       time_t current_time;
-       int time_diff;
-
-       ugd = (bt_ug_data *)user_data;
-       /* Get the current time */
-       time(&current_time);
-
-       /* Calculate time elapsed from remain_time */
-       time_diff = difftime(current_time, ugd->start_time);
-       BT_DBG("Time difference in seconds %d", time_diff);
-
-       /* Update UI */
-       if (ugd->remain_time <= time_diff) {
-               g_source_remove(ugd->timeout_id);
-               ugd->timeout_id = 0;
-               ugd->visibility_timeout = 0;
-               ugd->remain_time = 0;
-               ugd->selected_radio = 1;
-
-               elm_genlist_realized_items_update(ugd->main_genlist);
-
-               return FALSE;
-       }
-
-       elm_genlist_item_fields_update(ugd->visible_item, "elm.text.multiline",
-                                      ELM_GENLIST_ITEM_FIELD_TEXT);
-
-       FN_END;
-       return TRUE;
-}
-
 static void __bt_retry_pairing_cb(void *data,
                                     Evas_Object *obj, void *event_info)
 {
@@ -598,80 +528,16 @@ void _bt_cb_visibility_mode_changed
        (int result, bt_adapter_visibility_mode_e visibility_mode, void *user_data)
 {
        FN_START;
+       bt_ug_data *ugd = NULL;
 
-       ret_if(user_data == NULL);
-       bt_ug_data *ugd = (bt_ug_data *)user_data;
-       bt_adapter_state_e bt_state = BT_ADAPTER_DISABLED;
-       bt_adapter_visibility_mode_e mode =
-           BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
-       int remain_time = 0;
-       int ret = 0;
-
-       if(ugd->visibility_changed_by_ug) {
-               ugd->visibility_changed_by_ug = FALSE;
-               FN_END;
-               return;
-       }
-BT_DBG("");
-       if (bt_adapter_get_state(&bt_state) != BT_ERROR_NONE) {
-               BT_ERR("bt_adapter_get_state() failed.");
-               return;
-       }
-
-       if (bt_state != BT_ADAPTER_DISABLED) {
-               if (bt_adapter_get_visibility(&mode, &remain_time) !=
-                       BT_ERROR_NONE) {
-                       BT_ERR("bt_adapter_get_visibility() failed.");
-                       return;
-               }
-       }
-
-       if (visibility_mode == BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE) {
-               ugd->visible = FALSE;
-               ugd->visibility_timeout = 0;
-               ugd->selected_radio = 1;
-       } else if (visibility_mode == BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE) {
-               ugd->visible = TRUE;
-               ugd->visibility_timeout = -1;
-               ugd->selected_radio = 5;
-       } else {
-               /* BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE */
-               /* Need to add the code for getting timeout */
-               ret = vconf_get_int(BT_FILE_VISIBLE_TIME, &ugd->visibility_timeout);
-               if (ret != 0) {
-                       BT_ERR("Failt to get the timeout value");
-               }
-BT_DBG("");
-
-               ugd->remain_time = remain_time;
-
-               if (ugd->remain_time > 0) {
-
-                       if (ugd->timeout_id) {
-                               g_source_remove(ugd->timeout_id);
-                               ugd->timeout_id = 0;
-                       }
-                       /* Set current time snapshot */
-                       time(&(ugd->start_time));
-                       ugd->timeout_id = g_timeout_add(BT_VISIBILITY_TIMEOUT,
-                                                       (GSourceFunc)
-                                                       __bt_cb_visible_timeout_cb,
-                                                       ugd);
-               } else {
-                       ugd->visibility_timeout = 0;
-               }
-       }
-
-
-       if(ugd->visible_item) {
-               elm_genlist_item_fields_update(ugd->visible_item,
-                                               "elm.text",
-                                               ELM_GENLIST_ITEM_FIELD_TEXT);
-               elm_genlist_item_fields_update(ugd->visible_item,
-                                               "elm.text.multiline",
-                                               ELM_GENLIST_ITEM_FIELD_TEXT);
+       ugd = (bt_ug_data *)user_data;
 
-               elm_radio_value_set(ugd->radio_main, ugd->selected_radio);
+       if (visibility_mode == BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE &&
+                       result == BT_ERROR_NONE &&
+                       ugd->ug_status != BT_UG_PAUSE &&
+                       ugd->ug_status != BT_UG_DESTORY) {
+                       BT_DBG("visibility is turned off. turn on again!");
+                       _bt_util_change_discoverable_mode(ugd, TRUE);
        }
        FN_END;
 }
index 082d963..7040c6a 100644 (file)
@@ -22,6 +22,7 @@
 */
 
 #include <bluetooth.h>
+#include <bluetooth_internal.h>
 #include <vconf.h>
 #include <aul.h>
 #include <notification.h>
@@ -594,6 +595,47 @@ void _bt_util_max_len_reached_cb(void *data, Evas_Object *obj,
        FN_END;
 }
 
+void _bt_util_change_discoverable_mode(bt_ug_data *ugd, gboolean discoverable)
+{
+       FN_START;
+
+       int ret = BT_ERROR_NONE;
+
+       ret_if(!ugd);
+
+       if (ugd->timer) {
+               ecore_timer_del(ugd->timer);
+               ugd->timer = NULL;
+       }
+
+       ret_if(ugd->op_status == BT_DEACTIVATED);
+
+       if (discoverable)
+               ret = bt_adapter_set_visibility(
+                       BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE, 0);
+       else
+               ret = bt_adapter_set_visibility(
+                       BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE, 0);
+
+       if (ret != BT_ERROR_NONE)
+               BT_ERR("bt_adapter_set_visibility fail! ret = %d", ret);
+
+       FN_END;
+       return;
+}
+
+Eina_Bool _bt_timer_change_discoverable_mode(void *data)
+{
+       FN_START;
+
+       bt_ug_data *ugd = data;
+       _bt_util_change_discoverable_mode(ugd, TRUE);
+       ugd->timer = NULL;
+
+       FN_END;
+       return EINA_FALSE;
+}
+
 int _bt_util_check_any_profile_connected(bt_dev_t *dev)
 {
        FN_START;
index 3eb3cff..aab2330 100644 (file)
@@ -145,16 +145,6 @@ static void __bt_ug_release_memory(bt_ug_data *ugd)
                ugd->rename_desc_itc = NULL;
        }
 
-       if (ugd->visible_itc) {
-               elm_genlist_item_class_free(ugd->visible_itc);
-               ugd->visible_itc = NULL;
-       }
-
-       if (ugd->timeout_value_itc) {
-               elm_genlist_item_class_free(ugd->timeout_value_itc);
-               ugd->timeout_value_itc = NULL;
-       }
-
        if (ugd->paired_title_itc) {
                elm_genlist_item_class_free(ugd->paired_title_itc);
                ugd->paired_title_itc = NULL;
@@ -730,7 +720,7 @@ static void __on_start(ui_gadget_h ug, app_control_h service, void *priv)
 
        if (!ecore_idler_add(__bt_launch_idler, ugd))
                BT_ERR("idler can not be added");
-
+       _bt_util_change_discoverable_mode(ugd, TRUE);
        ugd->ug_status = BT_UG_START;
        BT_DBG("UG_LAUNCH_PROFILING");
 
@@ -752,6 +742,8 @@ static void __on_pause(ui_gadget_h ug, app_control_h service, void *priv)
        if (ugd->op_status == BT_SEARCHING)
                bt_adapter_stop_device_discovery();
 
+       _bt_util_change_discoverable_mode(ugd, FALSE);
+
        ugd->ug_status = BT_UG_PAUSE;
 
        FN_END;
@@ -770,8 +762,13 @@ static void __on_resume(ui_gadget_h ug, app_control_h service, void *priv)
 
        ugd = (bt_ug_data *)priv;
 
+       if (ugd->timer) {
+               ecore_timer_del(ugd->timer);
+               ugd->timer = NULL;
+       }
+       ugd->timer = ecore_timer_add(2, _bt_timer_change_discoverable_mode, ugd);
+
        ugd->ug_status = BT_UG_RESUME;
-       _bt_update_genlist_item(ugd->visible_item);
 
        FN_END;
 }
@@ -790,6 +787,11 @@ static void __on_destroy(ui_gadget_h ug, app_control_h service, void *priv)
 
        ugd->ug_status = BT_UG_DESTORY;
 
+       if (ugd->timer) {
+               ecore_timer_del(ugd->timer);
+               ugd->timer = NULL;
+       }
+
        if (ugd->request_timer) {
                ecore_timer_del(ugd->request_timer);
                ugd->request_timer = NULL;
@@ -856,6 +858,8 @@ static void __on_destroy(ui_gadget_h ug, app_control_h service, void *priv)
        if (err != BT_ERROR_NONE)
                BT_ERR("bt_nap_unset_connection_state_changed_cb err=%d", err);
 
+       _bt_util_change_discoverable_mode(ugd, FALSE);
+
        err = bt_deinitialize();
        if (err != BT_ERROR_NONE)
                BT_ERR("bt_deinitialize failed: %d", err);
index f6dd9f4..a92d90b 100644 (file)
@@ -70,9 +70,6 @@ static void __bt_main_onoff_btn_cb(void *data, Evas_Object *obj, void *event_inf
 static app_control_h __bt_main_get_bt_onoff_result(bt_ug_data *ugd,
                                                gboolean result);
 
-static app_control_h __bt_main_get_visibility_result(bt_ug_data *ugd,
-                                                gboolean result);
-
 static app_control_h __bt_main_get_pick_result(bt_ug_data *ugd, gboolean result);
 
 static int __bt_main_request_to_send(bt_ug_data *ugd, bt_dev_t *dev);
@@ -264,167 +261,6 @@ char* __bt_convert_rgba_to_hex(int r, int g, int b, int a)
        return string;
 }
 
-static char *__bt_main_visible_label_get(void *data, Evas_Object *obj,
-                                        const char *part)
-{
-       FN_START;
-
-       char *buf = NULL;
-       char *text1 = NULL;
-       char *text2 = NULL;
-       char remain_time[BT_EXTRA_STR_LEN] = { 0 };
-       bt_ug_data *ugd = NULL;
-#ifdef KIRAN_ACCESSIBILITY
-       Evas_Object *ao = NULL;
-       Elm_Object_Item *item = NULL;
-       char *text_visibility = NULL;
-       Eina_Bool expanded = EINA_FALSE;
-       char acc_str[BT_STR_ACCES_INFO_MAX_LEN] = { 0 };
-       char formatted_time[BT_BUFFER_LEN] = { 0 };
-#endif
-
-       int r = 0, g = 0, b = 0, a = 0;
-
-       if (data == NULL)
-               return NULL;
-
-       ugd = (bt_ug_data *)data;
-
-       BT_DBG("%s", part);
-
-       if (!strcmp("elm.text", part)) {
-               buf = g_strdup(BT_STR_VISIBLE);
-       } else if (!strcmp("elm.text.multiline", part)) {
-               char *color_code = NULL;
-               if (ugd->visibility_timeout <= 0) {
-                       text1 = _bt_util_get_timeout_string(ugd->visibility_timeout);
-
-                       r = 20, g = 107, b = 147, a = 255;
-                       color_code = __bt_convert_rgba_to_hex(r, g, b, a);
-
-                       if (ugd->visibility_timeout == 0) {
-                               text2 = strdup(BT_STR_ONLY_VISIBLE_TO_PAIRED_DEVICES);
-                       } else {
-                               text2 = strdup(BT_STR_VISIBLE_TO_ALL_NEARBY);
-                       }
-
-                       buf = g_strdup_printf("<font_size=30><color=#%s>%s</color><br>%s</font_size>",
-                                       color_code, text1, text2);
-
-#ifdef KIRAN_ACCESSIBILITY
-                       text_visibility = g_strdup_printf("<color=#%s>%s</color>",
-                                       color_code, text1);
-#endif
-               } else {
-                       time_t current_time;
-                       int time_diff;
-                       int minute;
-                       int second;
-
-                       /* Get the current time */
-                       time(&current_time);
-
-                       /* Calculate time elapsed from remain_time */
-                       time_diff = difftime(current_time, ugd->start_time);
-
-                       /* Display remain timeout */
-#ifdef KIRAN_ACCESSIBILITY
-                       _bt_util_convert_time_to_string((ugd->remain_time -
-                                                       time_diff),
-                                                       remain_time, formatted_time,
-                                                       sizeof(remain_time), sizeof(formatted_time));
-#else
-                       _bt_util_convert_time_to_string((ugd->remain_time -
-                                                       time_diff),
-                                                       remain_time, NULL,
-                                                       sizeof(remain_time), 0);
-#endif
-                       /* Get seconds */
-                       second = (ugd->remain_time - time_diff) % 60;
-                       /* Get minutes */
-                       minute = (ugd->remain_time - time_diff) / 60;
-
-                       text1 = g_strdup_printf("%d:%02d", minute, second);
-
-                       r = 20, g = 107, b = 147, a = 255;
-                       color_code = __bt_convert_rgba_to_hex(r, g, b, a);
-
-                       text2 = strdup(BT_STR_VISIBLE_TO_ALL_NEARBY);
-
-                       buf = g_strdup_printf("<font_size=30><color=#%s>%s</color><br>%s</font_size>",
-                                       color_code, text1, text2);
-
-                       BT_DBG("buf : %s, rgba:%d,%d,%d,%d", buf,r,g,b,a);
-
-#ifdef KIRAN_ACCESSIBILITY
-                       text_visibility = g_strdup_printf(BT_STR_PS_REMAINING,
-                                                       formatted_time);
-#endif
-               }
-               g_free(color_code);
-
-#ifdef KIRAN_ACCESSIBILITY
-               item = ugd->visible_item;
-               if (item != NULL) {
-                       expanded = elm_genlist_item_expanded_get(item);
-
-                       ao = elm_object_item_access_object_get(item);
-                       if (expanded == EINA_TRUE) {
-                                       snprintf(acc_str, sizeof(acc_str), "%s, %s, %s", BT_STR_VISIBLE,
-                                                       text_visibility, BT_STR_EXP_LIST_CLOSE);
-                       } else {
-                               if (elm_object_item_disabled_get(item))
-                                       snprintf(acc_str, sizeof(acc_str), "%s, %s, %s, %s",
-                                                       BT_STR_VISIBLE, text_visibility,
-                                                       BT_STR_EXP_LIST_OPEN, BT_STR_UNAVAILABLE);
-                               else
-                                       snprintf(acc_str, sizeof(acc_str), "%s, %s, %s", BT_STR_VISIBLE,
-                                                       text_visibility, BT_STR_EXP_LIST_OPEN);
-                       }
-
-                       elm_access_info_set(ao, ELM_ACCESS_INFO, acc_str);
-               }
-#endif
-       } else {
-               BT_ERR("empty text for label");
-               return NULL;
-       }
-
-       g_free(text1);
-       g_free(text2);
-#ifdef KIRAN_ACCESSIBILITY
-       g_free(text_visibility);
-#endif
-       FN_END;
-       return buf;
-}
-
-static char *__bt_main_timeout_value_label_get(void *data, Evas_Object *obj,
-                                              const char *part)
-{
-       FN_START;
-
-       char *buf = NULL;
-       int timeout = 0;
-       bt_radio_item *item = NULL;
-
-       retv_if(data == NULL, NULL);
-
-       item = (bt_radio_item *)data;
-       retv_if(item->ugd == NULL, NULL);
-
-       if (!strcmp("elm.text", part)) {
-               timeout = _bt_util_get_timeout_value(item->index);
-               buf = _bt_util_get_timeout_string(timeout);
-       } else {
-               BT_ERR("empty text for label");
-               return NULL;
-       }
-
-       FN_END;
-       return buf;
-}
-
 int _bt_idle_destroy_ug(void *data)
 {
        FN_START;
@@ -434,9 +270,7 @@ int _bt_idle_destroy_ug(void *data)
 
        retv_if(ugd == NULL, BT_UG_FAIL);
 
-       if (ugd->bt_launch_mode == BT_LAUNCH_VISIBILITY)
-               service = __bt_main_get_visibility_result(ugd, TRUE);
-       else if (ugd->bt_launch_mode == BT_LAUNCH_PICK)
+       if (ugd->bt_launch_mode == BT_LAUNCH_PICK)
                service = __bt_main_get_pick_result(ugd, TRUE);
        else if (ugd->bt_launch_mode == BT_LAUNCH_ONOFF)
                service = __bt_main_get_bt_onoff_result(ugd, TRUE);
@@ -450,175 +284,6 @@ int _bt_idle_destroy_ug(void *data)
        return BT_UG_ERROR_NONE;
 }
 
-static gboolean __bt_main_visible_timeout_cb(gpointer user_data)
-{
-       FN_START;
-
-       bt_ug_data *ugd = NULL;
-       time_t current_time;
-       int time_diff;
-
-       ugd = (bt_ug_data *)user_data;
-       /* Get the current time */
-       time(&current_time);
-
-       /* Calculate time elapsed from remain_time */
-       time_diff = difftime(current_time, ugd->start_time);
-       BT_INFO("Time difference in seconds %d", time_diff);
-
-       /* Update UI */
-       if (ugd->remain_time <= time_diff) {
-               g_source_remove(ugd->timeout_id);
-               ugd->timeout_id = 0;
-               ugd->visibility_timeout = 0;
-               ugd->remain_time = 0;
-               ugd->selected_radio = 1;
-
-               elm_genlist_realized_items_update(ugd->main_genlist);
-
-               return FALSE;
-       }
-
-       elm_genlist_item_fields_update(ugd->visible_item, "elm.text.multiline",
-                                      ELM_GENLIST_ITEM_FIELD_TEXT);
-
-       FN_END;
-       return TRUE;
-}
-
-static void __bt_update_visibility_menu(bt_radio_item *item)
-{
-       FN_START;
-       bt_ug_data *ugd = NULL;
-       int ret;
-       int timeout;
-
-       ret_if(item == NULL);
-
-       ugd = (bt_ug_data *)item->ugd;
-       ret_if(item->ugd == NULL);
-
-       timeout = _bt_util_get_timeout_value(item->index);
-
-       if (timeout < 0) {
-               ret = bt_adapter_set_visibility(BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE, 0);
-
-               if (ugd->timeout_id) {
-                       g_source_remove(ugd->timeout_id);
-                       ugd->timeout_id = 0;
-               }
-       } else if (timeout == 0) {
-               ret = bt_adapter_set_visibility(BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE,
-                                               0);
-               if (ugd->timeout_id) {
-                       g_source_remove(ugd->timeout_id);
-                       ugd->timeout_id = 0;
-               }
-       } else {
-               ret = bt_adapter_set_visibility(BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE,
-                                               timeout);
-
-               if (ret == BT_ERROR_NONE) {
-                       if (ugd->timeout_id) {
-                               g_source_remove(ugd->timeout_id);
-                               ugd->timeout_id = 0;
-                       }
-                       /* Set current time snapshot */
-                       time(&(ugd->start_time));
-                       ugd->remain_time = timeout;
-                       ugd->timeout_id = g_timeout_add(BT_VISIBILITY_TIMEOUT,
-                                                       (GSourceFunc)
-                                                       __bt_main_visible_timeout_cb,
-                                                       ugd);
-               }
-       }
-
-       if (ret != BT_ERROR_NONE) {
-               BT_ERR("bt_adapter_set_visibility() failed");
-               return;
-       }
-
-       ugd->selected_radio = item->index;
-       ugd->visibility_timeout = timeout;
-
-       _bt_update_genlist_item(ugd->visible_item);
-       elm_radio_value_set(ugd->radio_main, ugd->selected_radio);
-
-       if (ugd->bt_launch_mode == BT_LAUNCH_VISIBILITY)
-               g_idle_add((GSourceFunc) _bt_idle_destroy_ug, ugd);
-
-       FN_END;
-}
-
-static void __bt_main_timeout_value_item_sel(void *data, Evas_Object *obj,
-                                            void *event_info)
-{
-       FN_START;
-
-       bt_radio_item *item = NULL;
-
-       ret_if(data == NULL);
-
-       item = (bt_radio_item *)data;
-
-       if(event_info)
-               elm_genlist_item_selected_set((Elm_Object_Item *)event_info,
-                                     EINA_FALSE);
-
-       __bt_update_visibility_menu(item);
-
-       bt_ug_data *ugd = (bt_ug_data *)item->ugd;
-       if (ugd && ugd->visibility_popup) {
-               evas_object_del(ugd->visibility_popup);
-               ugd->visibility_popup = NULL;
-       }
-
-       FN_END;
-       return;
-}
-
-static Evas_Object *__bt_main_timeout_value_icon_get(void *data,
-                                                    Evas_Object *obj,
-                                                    const char *part)
-{
-       FN_START;
-
-       bt_ug_data *ugd = NULL;
-       bt_radio_item *item = NULL;
-       Evas_Object *btn = NULL;
-       retv_if(data == NULL, NULL);
-
-       item = (bt_radio_item *)data;
-       retv_if(item->ugd == NULL, NULL);
-
-       ugd = (bt_ug_data *)item->ugd;
-
-       if (!strcmp("elm.swallow.end", part)) {
-               btn = elm_radio_add(obj);
-               elm_radio_state_value_set(btn, item->index);
-               elm_radio_group_add(btn, ugd->radio_main);
-
-               elm_radio_value_set(ugd->radio_main, ugd->selected_radio);
-#ifdef KIRAN_ACCESSIBILITY
-               elm_access_object_unregister(btn);
-#endif
-               evas_object_size_hint_min_set(btn, ELM_SCALE_SIZE(30), ELM_SCALE_SIZE(30));
-               evas_object_show(btn);
-       }
-       FN_END;
-       return btn;
-}
-static void __bt_main_timeout_value_del(void *data, Evas_Object *obj)
-{
-       FN_START;
-
-       bt_radio_item *item = (bt_radio_item *)data;
-       if (item)
-               free(item);
-
-       FN_END;
-}
-
 gboolean _bt_main_is_connectable_device(bt_dev_t *dev)
 {
        FN_START;
@@ -1284,98 +949,6 @@ static Evas_Object *__bt_main_searched_title_icon_get(void *data, Evas_Object *o
        return progressbar;
 }
 
-static void __bt_popup_visibility_delete_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       bt_ug_data *ugd = (bt_ug_data *)data;
-       ret_if(!ugd);
-       if (ugd->visibility_popup) {
-               evas_object_del(ugd->visibility_popup);
-               ugd->visibility_popup = NULL;
-       }
-}
-
-static void __bt_main_visible_item_sel(void *data, Evas_Object *obj,
-                                      void *event_info)
-{
-       FN_START;
-
-       ret_if(data == NULL);
-       ret_if(event_info == NULL);
-
-       bt_ug_data *ugd = (bt_ug_data *)data;
-       if(event_info)
-               elm_genlist_item_selected_set((Elm_Object_Item *)event_info,
-                                     EINA_FALSE);
-
-       ugd->visibility_changed_by_ug = TRUE;
-
-       Evas_Object *popup = NULL;
-       Evas_Object *box = NULL;
-       Evas_Object *genlist = NULL;
-       Elm_Object_Item *git = NULL;
-       bt_radio_item *item = NULL;
-       int i = 0;
-
-       popup = elm_popup_add(ugd->base);
-       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __bt_popup_visibility_delete_cb, ugd);
-       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_smart_callback_add(popup, "block,clicked", __bt_popup_visibility_delete_cb, ugd);
-
-       elm_object_part_text_set(popup, "title,text", BT_STR_VISIBLE);
-
-       /* box */
-       box = elm_box_add(popup);
-       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       /* genlist */
-       genlist = elm_genlist_add(box);
-       elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
-       elm_genlist_homogeneous_set(genlist, EINA_FALSE);
-       elm_genlist_block_count_set(genlist, 3);
-       evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
-       /* Set item class for timeout value */
-       ugd->timeout_value_itc = elm_genlist_item_class_new();
-       ret_if(ugd->timeout_value_itc == NULL);
-       ugd->timeout_value_itc->item_style = BT_GENLIST_1LINE_TEXT_ICON_STYLE;
-       ugd->timeout_value_itc->func.text_get =
-           __bt_main_timeout_value_label_get;
-       ugd->timeout_value_itc->func.content_get =
-           __bt_main_timeout_value_icon_get;
-       ugd->timeout_value_itc->func.state_get = NULL;
-       ugd->timeout_value_itc->func.del = __bt_main_timeout_value_del;
-
-       for (i = 1; i <= BT_MAX_TIMEOUT_ITEMS; i++) {
-               item = calloc(1, sizeof(bt_radio_item));
-               ret_if(item == NULL);
-
-               item->index = i;
-               item->ugd = ugd;
-
-               git = elm_genlist_item_append(genlist, ugd->timeout_value_itc,
-                                             (void *)item, NULL,
-                                             ELM_GENLIST_ITEM_NONE,
-                                             __bt_main_timeout_value_item_sel,
-                                             (void *)item);
-               if (!git)
-                       BT_DBG("git is NULL!");
-               item->it = git;
-               ugd->visible_exp_item[i] = git;
-       }
-
-       evas_object_show(genlist);
-
-       elm_box_pack_end(box, genlist);
-
-       evas_object_size_hint_min_set(box, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(240));
-       elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
-       elm_object_content_set(popup, box);
-       evas_object_show(popup);
-       ugd->visibility_popup = popup;
-       FN_END;
-}
-
 static app_control_h __bt_main_get_bt_onoff_result(bt_ug_data *ugd,
                                                        gboolean result)
 {
@@ -1415,66 +988,6 @@ static app_control_h __bt_main_get_bt_onoff_result(bt_ug_data *ugd,
        return service;
 }
 
-static app_control_h __bt_main_get_visibility_result(bt_ug_data *ugd,
-                                                gboolean result)
-{
-       app_control_h service = NULL;
-       char mode_str[BT_RESULT_STR_MAX] = { 0 };
-       const char *result_str;
-       int visibility = BT_VISIBLE_OFF;
-
-       retv_if(ugd == NULL, NULL);
-
-       app_control_create(&service);
-
-       retv_if(service == NULL, NULL);
-
-       if (result == TRUE)
-               result_str = BT_RESULT_SUCCESS;
-       else
-               result_str = BT_RESULT_FAIL;
-
-       if (app_control_add_extra_data(service, "result", result_str) < 0) {
-               BT_ERR("Fail to add extra data");
-       }
-
-       /* Original output fields will be removed */
-       snprintf(mode_str, BT_RESULT_STR_MAX, "%d", (int)ugd->selected_radio);
-
-       if (app_control_add_extra_data(service, "visibility",
-                                  (const char *)mode_str) < 0) {
-               BT_ERR("Fail to add extra data");
-       }
-
-       /* Convert the radio value to result */
-       switch (ugd->selected_radio) {
-       case 0:
-               visibility = BT_VISIBLE_OFF;
-               break;
-       case 1:
-       case 2:
-       case 3:
-               visibility = BT_VISIBLE_TIME_LIMITED;
-               break;
-       case 4:
-               visibility = BT_VISIBLE_ALWAYS;
-               break;
-       default:
-               visibility = BT_VISIBLE_OFF;
-               break;
-       }
-
-       memset(mode_str, 0x00, BT_RESULT_STR_MAX);
-       snprintf(mode_str, BT_RESULT_STR_MAX, "%d", visibility);
-
-       if (app_control_add_extra_data(service, BT_APPCONTROL_VISIBILITY,
-                                  (const char *)mode_str) < 0) {
-               BT_ERR("Fail to add extra data");
-       }
-
-       return service;
-}
-
 static app_control_h __bt_main_get_pick_result(bt_ug_data *ugd, gboolean result)
 {
        app_control_h service = NULL;
@@ -1613,24 +1126,7 @@ static Eina_Bool __bt_main_quit_btn_cb(void *data, Elm_Object_Item *it)
 
        retv_if(ugd == NULL, EINA_FALSE);
 
-       if (ugd->bt_launch_mode == BT_LAUNCH_VISIBILITY) {
-               service = __bt_main_get_visibility_result(ugd, FALSE);
-               app_control_create(&reply);
-               if (app_control_add_extra_data(reply, "result",
-                                               BT_RESULT_FAIL) < 0) {
-                       BT_ERR("Fail to add extra data");
-               }
-               BT_DBG("BT_LAUNCH_VISIBILITY reply to launch request");
-               app_control_reply_to_launch_request(reply, service,
-                                               APP_CONTROL_RESULT_FAILED);
-
-               _bt_ug_destroy(data, (void *)service);
-
-               if (service)
-                       app_control_destroy(service);
-               if (reply)
-                       app_control_destroy(reply);
-       } else if (ugd->bt_launch_mode == BT_LAUNCH_PICK) {
+       if (ugd->bt_launch_mode == BT_LAUNCH_PICK) {
                app_control_create(&service);
 
                if (service == NULL) {
@@ -2228,26 +1724,6 @@ void _bt_main_add_device_name_item(bt_ug_data *ugd, Evas_Object *genlist)
        FN_END;
 }
 
-void _bt_main_add_visible_item(bt_ug_data *ugd, Evas_Object *genlist)
-{
-       FN_START;
-       retm_if(ugd->op_status == BT_DEACTIVATED, "BT is turned off");
-
-       Elm_Object_Item *git = NULL;
-
-       if (ugd->bt_launch_mode == BT_LAUNCH_NORMAL ||
-            ugd->bt_launch_mode == BT_LAUNCH_HELP ||
-             ugd->bt_launch_mode == BT_LAUNCH_VISIBILITY) {
-               /* visibility */
-               git = elm_genlist_item_insert_after(genlist, ugd->visible_itc, ugd,
-                                             NULL, ugd->device_name_item,
-                                             ELM_GENLIST_ITEM_NONE,
-                                             __bt_main_visible_item_sel, ugd);
-               ugd->visible_item = git;
-       }
-       FN_END;
-}
-
 static Evas_Object *__bt_main_add_genlist_dialogue(Evas_Object *parent,
                                                   bt_ug_data *ugd)
 {
@@ -2271,13 +1747,6 @@ static Evas_Object *__bt_main_add_genlist_dialogue(Evas_Object *parent,
        evas_object_smart_callback_add(genlist, "unhighlighted",
                                       __bt_main_gl_unhighlighted, ugd);
 
-       ugd->radio_main = elm_radio_add(genlist);
-       elm_radio_state_value_set(ugd->radio_main, 0);
-       elm_radio_value_set(ugd->radio_main, 0);
-
-       ugd->selected_radio =
-           _bt_util_get_timeout_index(ugd->visibility_timeout);
-
        ugd->on_itc = elm_genlist_item_class_new();
        retv_if(ugd->on_itc == NULL, NULL);
 
@@ -2307,19 +1776,6 @@ static Evas_Object *__bt_main_add_genlist_dialogue(Evas_Object *parent,
        ugd->device_name_itc->func.state_get = NULL;
        ugd->device_name_itc->func.del = NULL;
 
-       if (ugd->bt_launch_mode == BT_LAUNCH_NORMAL ||
-               ugd->bt_launch_mode == BT_LAUNCH_HELP) {
-               /* Set item class for visibility */
-               ugd->visible_itc = elm_genlist_item_class_new();
-               retv_if(ugd->visible_itc == NULL, NULL);
-
-               ugd->visible_itc->item_style = BT_GENLIST_MULTILINE_TEXT_STYLE;
-               ugd->visible_itc->func.text_get = __bt_main_visible_label_get;
-               ugd->visible_itc->func.content_get = NULL;
-               ugd->visible_itc->func.state_get = NULL;
-               ugd->visible_itc->func.del = NULL;
-       }
-
        /* Set item class for paired dialogue title */
        ugd->paired_title_itc = elm_genlist_item_class_new();
        retv_if(ugd->paired_title_itc == NULL, NULL);
@@ -2370,18 +1826,6 @@ static Evas_Object *__bt_main_add_genlist_dialogue(Evas_Object *parent,
        ugd->no_device_itc->func.state_get = NULL;
        ugd->no_device_itc->func.del = NULL;
 
-       /* Set item class for timeout value */
-       ugd->timeout_value_itc = elm_genlist_item_class_new();
-       retv_if(ugd->timeout_value_itc == NULL, NULL);
-
-       ugd->timeout_value_itc->item_style = BT_GENLIST_1LINE_TEXT_ICON_STYLE;
-       ugd->timeout_value_itc->func.text_get =
-           __bt_main_timeout_value_label_get;
-       ugd->timeout_value_itc->func.content_get =
-           __bt_main_timeout_value_icon_get;
-       ugd->timeout_value_itc->func.state_get = NULL;
-       ugd->timeout_value_itc->func.del = __bt_main_timeout_value_del;
-
        if (ugd->op_status == BT_DEACTIVATED ||
                ugd->op_status == BT_ACTIVATING)
                git = elm_genlist_item_append(genlist, ugd->off_itc, ugd, NULL,
@@ -2398,7 +1842,6 @@ static Evas_Object *__bt_main_add_genlist_dialogue(Evas_Object *parent,
                elm_object_item_disabled_set(ugd->onoff_item, EINA_TRUE);
 
        _bt_main_add_device_name_item(ugd, genlist);
-       _bt_main_add_visible_item(ugd, genlist);
 
        evas_object_show(genlist);
 
@@ -2428,13 +1871,6 @@ static Evas_Object *__bt_main_add_visibility_dialogue(Evas_Object * parent,
        evas_object_smart_callback_add(genlist, "unhighlighted",
                                       __bt_main_gl_unhighlighted, ugd);
 
-       ugd->radio_main = elm_radio_add(genlist);
-       elm_radio_state_value_set(ugd->radio_main, 0);
-       elm_radio_value_set(ugd->radio_main, 0);
-
-       ugd->selected_radio =
-           _bt_util_get_timeout_index(ugd->visibility_timeout);
-
        ugd->on_itc = elm_genlist_item_class_new();
        retv_if(ugd->on_itc == NULL, NULL);
 
@@ -2464,29 +1900,6 @@ static Evas_Object *__bt_main_add_visibility_dialogue(Evas_Object * parent,
        ugd->device_name_itc->func.state_get = NULL;
        ugd->device_name_itc->func.del = NULL;
 
-       /* Set item class for visibility */
-       ugd->visible_itc = elm_genlist_item_class_new();
-       retv_if(ugd->visible_itc == NULL, NULL);
-
-       ugd->visible_itc->item_style = BT_GENLIST_MULTILINE_TEXT_STYLE;
-       ugd->visible_itc->func.text_get = __bt_main_visible_label_get;
-       ugd->visible_itc->func.content_get = NULL;
-       ugd->visible_itc->func.state_get = NULL;
-       ugd->visible_itc->func.del = NULL;
-
-       /* Set item class for timeout value */
-       ugd->timeout_value_itc = elm_genlist_item_class_new();
-       retv_if(ugd->timeout_value_itc == NULL, NULL);
-
-       ugd->timeout_value_itc->item_style = BT_GENLIST_1LINE_TEXT_ICON_STYLE;
-       ugd->timeout_value_itc->func.text_get =
-           __bt_main_timeout_value_label_get;
-       ugd->timeout_value_itc->func.content_get =
-           __bt_main_timeout_value_icon_get;
-       ugd->timeout_value_itc->func.state_get = NULL;
-       ugd->timeout_value_itc->func.del = __bt_main_timeout_value_del;
-
-
        if (ugd->op_status == BT_DEACTIVATED ||
                ugd->op_status == BT_ACTIVATING)
                git = elm_genlist_item_append(genlist, ugd->off_itc, ugd, NULL,
@@ -2499,7 +1912,6 @@ static Evas_Object *__bt_main_add_visibility_dialogue(Evas_Object * parent,
        ugd->onoff_item = git;
 
        _bt_main_add_device_name_item(ugd, genlist);
-       _bt_main_add_visible_item(ugd, genlist);
        evas_object_show(genlist);
 
        FN_END;
@@ -2910,11 +2322,6 @@ void _bt_main_popup_del_cb(void *data, Evas_Object *obj, void *event_info)
                g_free(ugd->popup_data.data);
        ugd->popup_data.data = NULL;
 
-       if (ugd->visibility_popup) {
-               evas_object_del(ugd->visibility_popup);
-               ugd->visibility_popup = NULL;
-       }
-
        ugd->back_cb = NULL;
 
        FN_END;
@@ -3630,12 +3037,6 @@ int _bt_main_draw_list_view(bt_ug_data *ugd)
 
        ugd->confirm_req = BT_NONE_REQ;
 
-       if (ugd->op_status == BT_ACTIVATED || ugd->op_status == BT_SEARCHING) {
-               if (ugd->visible_item)
-                       elm_object_item_disabled_set(ugd->visible_item,
-                                                    EINA_FALSE);
-       }
-
        FN_END;
        return BT_UG_ERROR_NONE;
 }
@@ -3668,9 +3069,6 @@ int _bt_main_draw_visibility_view(bt_ug_data *ugd)
        ugd->main_genlist = genlist;
        ugd->confirm_req = BT_NONE_REQ;
 
-       if (ugd->op_status == BT_ACTIVATED && ugd->visible_item)
-               elm_object_item_disabled_set(ugd->visible_item, EINA_FALSE);
-
        FN_END;
        return BT_UG_ERROR_NONE;
 }
@@ -4530,11 +3928,8 @@ void _bt_main_init_status(bt_ug_data *ugd, void *data)
 
        app_control_h service = NULL;
        int ret;
-       int remain_time = 0;
        bool status = false;
        bt_adapter_state_e bt_state = BT_ADAPTER_DISABLED;
-       bt_adapter_visibility_mode_e mode =
-           BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
        ret_if(ugd == NULL);
 
        service = data;
@@ -4563,7 +3958,6 @@ void _bt_main_init_status(bt_ug_data *ugd, void *data)
 
        if (bt_state == BT_ADAPTER_DISABLED) {
                ugd->op_status = BT_DEACTIVATED;
-               mode = BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
        } else {
                if (bt_adapter_is_discovering(&status) != BT_ERROR_NONE)
                BT_ERR("bt_adapter_is_discovering() failed");
@@ -4572,37 +3966,6 @@ void _bt_main_init_status(bt_ug_data *ugd, void *data)
                        bt_adapter_stop_device_discovery();
 
                ugd->op_status = BT_ACTIVATED;
-
-               if (bt_adapter_get_visibility(&mode, &remain_time) != BT_ERROR_NONE)
-                       BT_ERR("bt_adapter_get_visibility() failed");
-       }
-
-       if (mode == BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE) {
-               ugd->visible = FALSE;
-               ugd->visibility_timeout = 0;
-       } else if (mode == BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE) {
-               ugd->visible = TRUE;
-               ugd->visibility_timeout = -1;
-       } else {
-               /* BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE */
-               /* Need to add the code for getting timeout */
-               if (vconf_get_int(BT_FILE_VISIBLE_TIME,
-                                 &ugd->visibility_timeout)) {
-                       BT_DBG("Get the timeout value");
-               }
-
-               ugd->remain_time = remain_time;
-
-               if (ugd->remain_time > 0) {
-                       /* Set current time snapshot */
-                       time(&(ugd->start_time));
-                       ugd->timeout_id = g_timeout_add(BT_VISIBILITY_TIMEOUT,
-                                                       (GSourceFunc)
-                                                       __bt_main_visible_timeout_cb,
-                                                       ugd);
-               } else {
-                       ugd->visibility_timeout = 0;
-               }
        }
 
        FN_END;