Disable Wi-fi / Tethering / Network menu in calling,disable 'Network' when flight...
[apps/core/preloaded/settings.git] / src / setting-main.c
index 0e43bdd..5c448af 100755 (executable)
 
 #include <tapi_common.h>
 #include <aul.h>
+#include <ail.h>
 #include <time.h>
 #include <setting-main.h>
 #include <setting-plugin.h>
 
+
+typedef struct DrawAppInfo DrawAppInfo;
+typedef struct DrawAppInfo
+{
+       int ncount;
+       //------------------------------------
+       void (*draw_app)(void* arg, char* name, char* pkgname);
+       void* data;
+};
+
 static int setting_main_create(void *cb);
 static int setting_main_destroy(void *cb);
 static int setting_main_update(void *cb);
@@ -399,28 +410,6 @@ static Setting_GenGroupItem_Data * __bluetooth_handler(void* data, char* keyStr,
        return ad->data_bt;
 }
 
-static Setting_GenGroupItem_Data * __mobileap_handler(void* data, char* keyStr, char* icon_path, char* ug_args, Evas_Object *genlist)
-{
-       setting_main_appdata *ad = (setting_main_appdata *)data;
-
-       ad->data_mobileApp = setting_create_Gendial_field_groupitem(genlist,
-                                                  &(ad->itc[GENDIAL_Type_1icon_2text]),
-                                                  NULL,
-                                                  setting_main_click_list_ex_ug_cb,
-                                                  ug_args,
-                                                  SWALLOW_Type_INVALID,
-                                                  icon_path,
-                                                  NULL,
-                                                  0,
-                                                  keyStr,
-                                                  get_Mobile_AP_on_off_str
-                                                  (),
-                                                  NULL);
-       __BACK_POINTER_SET(ad->data_mobileApp);
-
-       return ad->data_mobileApp;
-}
-
 static Setting_GenGroupItem_Data * __allshare_handler(void* data, char* keyStr, char* icon_path, char* ug_args, Evas_Object *genlist)
 {
        setting_main_appdata *ad = (setting_main_appdata *)data;
@@ -443,7 +432,7 @@ static Setting_GenGroupItem_Data * __network_handler(void* data, char* keyStr, c
 {
        setting_main_appdata *ad = (setting_main_appdata *)data;
 
-       Setting_GenGroupItem_Data * obj = setting_create_Gendial_field_groupitem(genlist,
+       ad->data_network = setting_create_Gendial_field_groupitem(genlist,
                                                                       &(ad->itc[GENDIAL_Type_1text_1icon_2]),
                                                                       NULL,
                                                                       setting_main_click_list_network_ug_cb,
@@ -455,18 +444,13 @@ static Setting_GenGroupItem_Data * __network_handler(void* data, char* keyStr, c
                                                                       NULL,
                                                                       NULL);
 
-       return obj;
+       return ad->data_network;
 }
 
 static Setting_GenGroupItem_Data * __nfc_handler(void* data, char* keyStr, char* icon_path, char* ug_args, Evas_Object *genlist)
 {
        setting_main_appdata *ad = (setting_main_appdata *)data;
 
-       int nfc_value = FALSE; //default
-       vconf_get_bool(VCONFKEY_NFC_FEATURE, &nfc_value);
-       //if (VCONFKEY_NFC_FEATURE_ON != nfc_value)
-       //      continue;
-
        ad->data_nfc = setting_create_Gendial_field_groupitem(genlist,
                                                   &(ad->itc[GENDIAL_Type_1icon_2text]),
                                                   NULL,
@@ -482,8 +466,10 @@ static Setting_GenGroupItem_Data * __nfc_handler(void* data, char* keyStr, char*
        __BACK_POINTER_SET(ad->data_nfc);
 
        setting_create_Gendial_field_def(genlist, &itc_multiline_text, NULL,
-                ad, SWALLOW_Type_LAYOUT_SPECIALIZTION,
+                ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
                 NULL, NULL, 0, SETTING_NFC_DESC, NULL, NULL);
+       elm_genlist_item_select_mode_set(elm_genlist_item_append(genlist, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL),
+                                        ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
 
        return ad->data_nfc;
 }
@@ -505,12 +491,10 @@ static Setting_GenGroupItem_Data * __default_handler(void* data, char* keyStr, c
 
        if (!safeStrCmp(KeyStr_WiFiDirect, keyStr)) {
                setting_create_Gendial_field_def(genlist, &itc_multiline_text, NULL,
-                        ad, SWALLOW_Type_LAYOUT_SPECIALIZTION,
+                        ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
                         NULL, NULL, 0, SETTING_WIFI_DIRECT_DESC, NULL, NULL);
-       } else if (!safeStrCmp(KeyStr_KeisOverWifi, keyStr)) {
-               setting_create_Gendial_field_def(genlist, &itc_multiline_text, NULL,
-                        ad, SWALLOW_Type_LAYOUT_SPECIALIZTION,
-                        NULL, NULL, 0, SETTING_KIES_VIA_WIFI_DESC, NULL, NULL);
+               elm_genlist_item_select_mode_set(elm_genlist_item_append(genlist, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL),
+                                                ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
        } else {
                /* do nothing */
        }
@@ -530,7 +514,6 @@ enum {
        MAINLIST_ENTRY_FLIGHT_MODE = 0,
        MAINLIST_ENTRY_WIFI,
        MAINLIST_ENTRY_BT,
-       MAINLIST_ENTRY_MOBILEAP,
        MAINLIST_ENTRY_ALLSHARE,
        MAINLIST_ENTRY_NETWORK,
        MAINLIST_ENTRY_NFC,
@@ -542,7 +525,6 @@ static mainlist_entry mainlist_table[] = {
                {KeyStr_FlightMode,     __flightmode_handler},                  // 0 --> NOT UG
                {KeyStr_WiFi,                   __wifi_handler},                                // 1 --> UG
                {KeyStr_Bluetooth,              __bluetooth_handler},                   // 1 --> UG
-               {KeyStr_MobileAP,               __mobileap_handler},                    // 1 --> UG
                {KeyStr_AllShare,               __allshare_handler},                    // NOT UG
                {KeyStr_Network,                __network_handler},                             // 1 --> UG
                {KeyStr_NFC,                    __nfc_handler},                                 // 1 --> UG
@@ -574,12 +556,16 @@ void __load_connectivity_menu_list(void *data, Cfg_Item_Position inputPos, Evas_
                                                     KeyStr_Connectivity, NULL);
        }
 
+       int idx_second_menu = 0;
+
        char *keyStr = NULL;
        char *icon_path = NULL;
        char *ug_args = NULL;
        Cfg_Item_Position tmpPos = Cfg_Item_Pos_Uninstall;
        int i, j;
 
+       bool is_emulator = isEmulBin();
+
        for (i = 0; i < setting_cfg_get_category_length(); i++) {
                if (safeStrCmp
                    (setting_cfg_get_category_name(i), KeyStr_Connectivity))
@@ -591,13 +577,39 @@ void __load_connectivity_menu_list(void *data, Cfg_Item_Position inputPos, Evas_
                        ug_args = setting_cfg_get_ug_args_idx(i, j);
                        icon_path = setting_cfg_get_icon_path_idx(i, j);
                        /* SETTING_TRACE_DEBUG("Got an item[keyStr:%s, ug_args:%s, pos:%d]", */
-                       /*                                                                         keyStr, ug_args, tmpPos); */
+                       /*                     keyStr, ug_args, tmpPos); */
+
+                       if (is_emulator) {
+                               if (!safeStrCmp(KeyStr_FlightMode, keyStr)) {
+                                       continue; /* hide Flight Mode in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_WiFi, keyStr)) {
+                                       continue; /* hide WIFI in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_WiFiDirect, keyStr)) {
+                                       continue; /* hide WiFiDirect in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_Network, keyStr)) {
+                                       continue; /* hide Network in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_Bluetooth, keyStr)) {
+                                       continue; /* hide Bluetooth in Emulator*/
+                               } else {
+                                       /* do nothing */
+                               }
+                       }
+
+                       if (idx_second_menu < MAX_MORE_MENU_NUM
+                           && Cfg_Item_Pos_Level1 == tmpPos
+                           && SETTING_VIEW_MAIN == ad->view_load
+                           && MAIN_PROFILE_PREFERRED == ad->profile_type) {
+
+                               if (is_ug_installed_by_ug_args(ug_args)) {
+                                       ad->more_connective_menus[idx_second_menu++] = keyStr;
+                               }
+                       }
+
                        if (Cfg_Item_Pos_Level_All == inputPos) {
                        } else if (inputPos != tmpPos) {        /* not in the inputPos level */
                                continue;
                        }
 
-
                        if (!safeStrCmp(KeyStr_FlightMode, keyStr)) {   /* load special radio */
                                // ug == NULL
                                mainlist_table[MAINLIST_ENTRY_FLIGHT_MODE].ui_handler(ad, keyStr, icon_path, ug_args, genlist);
@@ -614,18 +626,17 @@ void __load_connectivity_menu_list(void *data, Cfg_Item_Position inputPos, Evas_
 
                                mainlist_table[MAINLIST_ENTRY_BT].ui_handler(ad, keyStr, icon_path, ug_args, genlist);
 
-                       } else if (!safeStrCmp(KeyStr_MobileAP, keyStr) && is_ug_installed_by_ug_args(ug_args)) {       /* load special icon */
-
-                               mainlist_table[MAINLIST_ENTRY_MOBILEAP].ui_handler(ad, keyStr, icon_path, ug_args, genlist);
-
                        } else if (!safeStrCmp(KeyStr_Network, keyStr) && is_ug_installed_by_ug_args(ug_args)) {        /* load special UG */
 
                                mainlist_table[MAINLIST_ENTRY_NETWORK].ui_handler(ad, keyStr, icon_path, ug_args, genlist);
 
                        } else if (!safeStrCmp(KeyStr_NFC, keyStr) && is_ug_installed_by_ug_args(ug_args)) {    /* load special icon */
-
-                               mainlist_table[MAINLIST_ENTRY_NFC].ui_handler(ad, keyStr, icon_path, ug_args, genlist);
-
+                               int nfc_value = FALSE; //default
+                               vconf_get_bool(VCONFKEY_NFC_FEATURE, &nfc_value);
+                               if (VCONFKEY_NFC_FEATURE_ON == nfc_value)
+                               {
+                                       mainlist_table[MAINLIST_ENTRY_NFC].ui_handler(ad, keyStr, icon_path, ug_args, genlist);
+                               }
                        } else {        /* load other UGs */
                                if (is_ug_installed_by_ug_args(ug_args))
                                {
@@ -637,8 +648,20 @@ void __load_connectivity_menu_list(void *data, Cfg_Item_Position inputPos, Evas_
 
        //end group , only display in setting main view
 #if SUPPORT_MORE_ITEM_FUNCTION
-               if (SETTING_VIEW_MAIN == ad->view_load && MAIN_PROFILE_PREFERRED == ad->profile_type)
+               if (SETTING_VIEW_MAIN == ad->view_load && MAIN_PROFILE_PREFERRED == ad->profile_type && idx_second_menu > 0)
                {
+                       char sub_text[MAX_COMMON_BUFFER_LEN] = {0, };
+                       int idx = 0;
+                       while (idx < MAX_MORE_MENU_NUM && ad->more_connective_menus[idx])
+                       {
+                               if (idx != 0)
+                               {
+                                       safeStrNCat(sub_text, ", ", MAX_COMMON_BUFFER_LEN);
+                               }
+                               safeStrNCat(sub_text, _(ad->more_connective_menus[idx]), MAX_COMMON_BUFFER_LEN);
+                               idx++;
+                       }
+
                        ad->data_moreConnect =
                                setting_create_Gendial_field_groupitem(ad->main_genlist,
                                                                       &(ad->itc[GENDIAL_Type_2text_3]),
@@ -650,7 +673,7 @@ void __load_connectivity_menu_list(void *data, Cfg_Item_Position inputPos, Evas_
                                                                       NULL,
                                                                       0,
                                                                       KeyStr_MoreConnect,
-                                                                      _(MORE_CONNECT_STR),
+                                                                      sub_text,
                                                                       NULL);
                        __BACK_POINTER_SET(ad->data_moreConnect);
                }
@@ -684,6 +707,7 @@ void __load_system_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object
                                                     ELM_GENLIST_ITEM_NONE,
                                                     KeyStr_System, NULL);
        }
+       int idx_second_menu = 0;
 
        char *keyStr = NULL;
        char *icon_path = NULL;
@@ -694,6 +718,8 @@ void __load_system_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object
        int ncount = 0;
        int i, j;
 
+       bool is_emulator = isEmulBin();
+
        //SETTING_TRACE("setting_cfg_get_category_length() :: %d ", setting_cfg_get_category_length());
        for (i = 0; i < setting_cfg_get_category_length(); i++) {
                if (safeStrCmp(setting_cfg_get_category_name(i), KeyStr_System))
@@ -708,6 +734,33 @@ void __load_system_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object
                        ug_args = setting_cfg_get_ug_args_idx(i, j);
 
                        //SETTING_TRACE("KeyString :  %s , tmpPos : %d , inputPos : %d ", keyStr, tmpPos, inputPos );
+
+                       if (is_emulator) {
+                               if (!safeStrCmp(KeyStr_Security, keyStr)) {
+                                       continue; /* hide Security in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_Motions, keyStr)) {
+                                       continue; /* hide Motion in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_Accessibility, keyStr)) {
+                                       continue; /* hide Accessibility in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_Memory, keyStr)) {
+                                       continue; /* hide Memory in Emulator*/
+                               } else if (!safeStrCmp(KeyStr_Powersaving, keyStr)) {
+                                       continue; /* hide Powersaving in Emulator*/
+                               } else {
+                                       /* do nothing */
+                               }
+                       }
+
+                       if (idx_second_menu < MAX_MORE_MENU_NUM
+                           && Cfg_Item_Pos_Level1 == tmpPos
+                           && SETTING_VIEW_MAIN == ad->view_load
+                           && MAIN_PROFILE_PREFERRED == ad->profile_type) {
+
+                           if (is_ug_installed_by_ug_args(ug_args)) {
+                               ad->more_system_menus[idx_second_menu++] = keyStr;
+                           }
+                       }
+
                        if (Cfg_Item_Pos_Level_All == inputPos) {
                                // do nothing
                                //SETTING_TRACE("Cfg_Item_Pos_Level_All == inputPos ---> no draw --- WHY?? ");
@@ -778,8 +831,20 @@ void __load_system_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object
        }
        //end group, only display in setting main view
 #if SUPPORT_MORE_ITEM_FUNCTION
-               if (SETTING_VIEW_MAIN == ad->view_load && MAIN_PROFILE_PREFERRED == ad->profile_type)
+               if (SETTING_VIEW_MAIN == ad->view_load && MAIN_PROFILE_PREFERRED == ad->profile_type && idx_second_menu > 0)
                {
+                       char sub_text[MAX_COMMON_BUFFER_LEN] = {0, };
+                       int idx = 0;
+                       while (idx < MAX_MORE_MENU_NUM && ad->more_system_menus[idx])
+                       {
+                               if (idx != 0)
+                               {
+                                       safeStrNCat(sub_text, ", ", MAX_COMMON_BUFFER_LEN);
+                               }
+                               safeStrNCat(sub_text, _(ad->more_system_menus[idx]), MAX_COMMON_BUFFER_LEN);
+                               idx++;
+                       }
+
                        ad->data_moreSystem =
                                setting_create_Gendial_field_groupitem(ad->main_genlist,
                                                                       &(ad->itc[GENDIAL_Type_2text_3]),
@@ -791,7 +856,7 @@ void __load_system_menu_list(void *data, Cfg_Item_Position inputPos, Evas_Object
                                                                       NULL,
                                                                       0,
                                                                       KeyStr_MoreSystem,
-                                                                      _(MORE_SYSTEM_STR),
+                                                                      sub_text,
                                                                       NULL);
                        __BACK_POINTER_SET(ad->data_moreSystem);
                }
@@ -818,6 +883,8 @@ static void __load_applications_menu_list(void *data,
        SETTING_TRACE_DEBUG("pos :%d", inputPos);
        setting_main_appdata *ad = data;
 
+       bool is_emulator = isEmulBin();
+
        //group title
        setting_create_Gendial_field_group_titleItem(ad->main_genlist,
                                                     &(ad->itc[GENDIAL_Type_group_item]),
@@ -847,6 +914,15 @@ static void __load_applications_menu_list(void *data,
                                continue;
                        }
 
+                       if (is_emulator) {
+                                /* hide all except Email */
+                               if (safeStrCmp(KeyStr_Email, keyStr)) {
+                                       continue;
+                               } else {
+                                       /* do nothing */
+                               }
+                       }
+
                        setting_create_Gendial_field_groupitem(ad->main_genlist,
                                                               &(ad->itc[GENDIAL_Type_1text_1icon_2]),
                                                               NULL,
@@ -876,6 +952,174 @@ static void __load_applications_level_all_list(void *data)
        __load_applications_menu_list(ad, Cfg_Item_Pos_Level_All);
 }
 
+bool is_3rdapp_installed_setting_cfg(char* pkgname)
+{
+       SETTING_TRACE_BEGIN;
+       // /opt/apps/
+       char path[512];
+
+       if (snprintf(path, 512, "/opt/apps/%s/setting/setting.xml", pkgname) < 0)
+               return false;
+
+       struct stat st;
+       bool result_opt = false;
+
+       if(stat(path, &st) == 0) {
+               result_opt = true;
+       } else {
+               SETTING_TRACE_ERROR(" %s is *NOT* present\n", path);
+               result_opt = false;
+       }
+
+       return result_opt;
+}
+
+
+/**
+ * @param data
+ */
+static void draw_3rdapp(void* data, char* name, char* pkgname)
+{
+       SETTING_TRACE_BEGIN;
+       SETTING_TRACE(" name : %s", name);
+       SETTING_TRACE(" pkgname : %s", pkgname);
+
+       setting_main_appdata *ad = data;
+
+       //3rd cfg
+       char fullpath[512];
+
+       if (snprintf(fullpath, 512, "/opt/apps/%s/setting/setting.xml", pkgname) < 0)
+               return false;
+
+       SETTING_TRACE(" fullpath : %s", fullpath);
+
+       if (ad)
+       {
+               if (ad->plugin_path)
+               {
+                       free(ad->plugin_path);
+                       ad->plugin_path = NULL;
+               }
+               ad->plugin_path = strdup(fullpath);
+
+               setting_create_Gendial_field_groupitem(ad->main_genlist,
+                                                          &(ad->itc[GENDIAL_Type_1text_1icon_2]),
+                                                          NULL,
+                                                          setting_main_click_list_plugin_cb,
+                                                          ad,
+                                                          SWALLOW_Type_INVALID,
+                                                          IMG_DefaultIcon, NULL,
+                                                          0, name, NULL,
+                                                          NULL);
+       }
+       SETTING_TRACE_END;
+}
+
+/**
+ *
+ * ail code here
+ */
+static ail_cb_ret_e __download_apps_cb(ail_appinfo_h ai, void* data)
+{
+       DrawAppInfo* pinfo = (DrawAppInfo*)data;
+    char *id;
+
+       if (AIL_ERROR_OK == ail_appinfo_get_str(ai, AIL_PROP_PACKAGE_STR, &id))
+       {
+               //SETTING_TRACE(" 3rd party - app name : ----> %s ", id);
+       }
+
+    ail_appinfo_h handle;
+
+    char *name = NULL;
+    char *icon = NULL;
+    int installed_time;
+    bool nodisplay = false;
+    bool removable = true;
+
+    if (AIL_ERROR_OK == ail_package_get_appinfo(id, &handle))
+       {
+               if (AIL_ERROR_OK != ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &name))
+                       SETTING_TRACE("cannot get name");
+
+               if (AIL_ERROR_OK != ail_appinfo_get_str(handle, AIL_PROP_ICON_STR, &icon))
+                       SETTING_TRACE("cannot get icon");
+
+               if (AIL_ERROR_OK != ail_appinfo_get_bool(handle, AIL_PROP_NODISPLAY_BOOL, &nodisplay))
+                       SETTING_TRACE("cannot get nodisplay");
+
+               if (AIL_ERROR_OK != ail_appinfo_get_bool(handle, AIL_PROP_X_SLP_REMOVABLE_BOOL, &removable))
+                       SETTING_TRACE("cannot get removable");
+
+               if (AIL_ERROR_OK != ail_appinfo_get_int(handle, AIL_PROP_X_SLP_INSTALLEDTIME_INT, &installed_time))
+                       SETTING_TRACE("cannot get installed_time");
+
+               //SETTING_TRACE("installed_time = %d ", installed_time);
+               if (installed_time != 0 && is_3rdapp_installed_setting_cfg(id) == true )
+               {
+                       SETTING_TRACE(" 3rd party - app name : ----> id : %s --- name : %s ", id, name);
+                       SETTING_TRACE(" 3rd party - icon : ----> %s ", icon);
+                       SETTING_TRACE(" 3rd party - nodisplay :  ----> %d ", nodisplay);
+                       pinfo->ncount++;
+
+                       // draw code here
+                       if (pinfo->draw_app != NULL)
+                       {
+                               SETTING_TRACE(">>> pkg name --> %s ", id);
+                               pinfo->draw_app(pinfo->data, strdup(name)/* appname*/, strdup(id)/* pkg_name*/);
+                       }
+               }
+       }
+       SETTING_TRACE_END;
+    return AIL_CB_RET_CONTINUE;
+}
+
+
+/**
+ * get 3rd party applist from AIL & searching dir/file by the defined rule
+ * @param data ad
+ * if data is NULL --> just get how many items are there
+ * if data is NOT NULL --> draw UI code
+ */
+static int get_downloadapp_list(void* data)
+{
+       SETTING_TRACE_BEGIN;
+
+       setting_main_appdata *ad = data;
+
+       int ncount = 0;
+       ail_filter_h f;
+       ail_appinfo_h handle;
+
+       DrawAppInfo* pinfo = (DrawAppInfo*)malloc(sizeof(DrawAppInfo));
+       pinfo->ncount = 0;
+       pinfo->draw_app = draw_3rdapp;
+       pinfo->data = ad;
+
+       if (ail_filter_new(&f) == AIL_ERROR_OK)
+       {
+               if (ail_filter_add_bool(f, AIL_PROP_NODISPLAY_BOOL, false) != AIL_ERROR_OK)
+               {
+                       SETTING_TRACE("ail filter error");
+                       return;
+               }
+
+               ail_filter_list_appinfo_foreach(f, __download_apps_cb, pinfo);
+               //---------------------------------------------------------------
+               ail_filter_destroy(f);
+       }
+       ncount = pinfo->ncount;
+
+       if (pinfo) {
+               free(pinfo);
+               pinfo = NULL;
+       }
+
+       SETTING_TRACE_END;
+       return ncount;
+}
+
 static int __get_downloaded_apps_num(Cfg_Item_Position inputPos)
 {
        SETTING_TRACE_BEGIN;
@@ -899,28 +1143,16 @@ static int __get_downloaded_apps_num(Cfg_Item_Position inputPos)
                }
        }
 
+       // draw UI with AUL code
 #ifdef PLUGIN
-       //3rd cfg
-       DIR *dp = opendir (PLUGIN_CFG_DIR);
-       if (dp != NULL)
-       {
-               struct dirent *ep;
-               while (ep = readdir (dp))
-               {
-                               if (0 == safeStrCmp(".", ep->d_name)
-                                   || 0 == safeStrCmp("..", ep->d_name))
-                               {
-                                       continue;
-                               }
-                               downloaded_apps_num++;
-               }
-               (void) closedir (dp);
-       }
-#endif
+       downloaded_apps_num = get_downloadapp_list(NULL);
        SETTING_TRACE("Exit %s with return[%d]",__FUNCTION__, downloaded_apps_num);
+#endif
+
        return downloaded_apps_num;
 }
 
+
 static void __load_downloaded_apps_menu_list(void *data,
                                             Cfg_Item_Position inputPos)
 {
@@ -944,6 +1176,7 @@ static void __load_downloaded_apps_menu_list(void *data,
                                                     ELM_GENLIST_ITEM_NONE,
                                                     KeyStr_DownloadedAPPs,
                                                     NULL);
+#if DISABLED_CODE
        char *keyStr = NULL;
        char *icon_path = NULL;
        char *ug_args = NULL;
@@ -979,8 +1212,11 @@ static void __load_downloaded_apps_menu_list(void *data,
 
                }
        }
+#endif
 
-       #ifdef PLUGIN
+
+       //#ifdef PLUGIN
+       #if 0
        //3rd cfg
        DIR *dp = opendir (PLUGIN_CFG_DIR);
        if (dp != NULL)
@@ -1018,6 +1254,13 @@ static void __load_downloaded_apps_menu_list(void *data,
                }
                (void) closedir (dp);
        }
+       #else
+       // TODO: DRAW 3RD PARTY APPS LIST here with EFL code
+       int downloaded_apps_num = get_downloadapp_list(ad);
+
+       // loop condition : 0 ---> ncount
+       //
+
        #endif
        SETTING_TRACE_END;
 }
@@ -1472,8 +1715,10 @@ static void setting_main_tapi_event_cb(TapiHandle *handle, int result, void *dat
                                             FALSE, FALSE);
 
                        //It is need to rollback the status,
-                       ad->data_flight->chk_status = !ad->data_flight->chk_status;
-                       elm_check_state_set(ad->data_flight->eo_check, ad->data_flight->chk_status);
+                       if (ad->data_flight) {
+                               ad->data_flight->chk_status = !ad->data_flight->chk_status;
+                               elm_check_state_set(ad->data_flight->eo_check, ad->data_flight->chk_status);
+                       }
                        return;
                }
 
@@ -1489,8 +1734,10 @@ static void setting_main_tapi_event_cb(TapiHandle *handle, int result, void *dat
                                     NULL, POPUP_INTERVAL, FALSE, FALSE);
 
                //It is need to rollback the status,
-               ad->data_flight->chk_status = !ad->data_flight->chk_status;
-               elm_check_state_set(ad->data_flight->eo_check, ad->data_flight->chk_status);
+               if (ad->data_flight) {
+                       ad->data_flight->chk_status = !ad->data_flight->chk_status;
+                       elm_check_state_set(ad->data_flight->eo_check, ad->data_flight->chk_status);
+               }
                break;
        default:
                /* do nothing */
@@ -1505,6 +1752,22 @@ static int setting_main_refresh(void *data)
        setting_main_appdata *ad = (setting_main_appdata *) data;
        elm_genlist_clear(ad->main_genlist);    /* first to clear list */
 
+       if (is_ug_installed_by_ug_args("rcs-config"))
+       {
+               Elm_Object_Item *item = elm_genlist_item_append(ad->main_genlist, &itc_seperator, NULL, NULL,
+                                           ELM_GENLIST_ITEM_NONE, NULL, NULL);
+               elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+               setting_create_Gendial_field_groupitem(ad->main_genlist,
+                                                      &(ad->itc[GENDIAL_Type_1text_1icon_2]),
+                                                      NULL,
+                                                      setting_main_click_list_ex_ug_cb,
+                                                      "rcs-config",
+                                                      SWALLOW_Type_INVALID,
+                                                      IMG_Joyn, NULL,
+                                                      0, KeyStr_Joyn, NULL,
+                                                      NULL);
+       }
+
        int i;
        for(i = Func_Type_Connectivity; i < Func_Type_MAX; i++)
                (ad->load_fns[i]) (ad);
@@ -1543,7 +1806,8 @@ static int setting_main_create(void *cb)
        setting_create_Gendial_itc("dialogue/2text.3", &(ad->itc[GENDIAL_Type_2text_3]));
 
        ad->view_type = SETTING_VIEW_MAIN;
-       __setting_create_main_view(ad);
+       bool ret = __setting_create_main_view(ad);
+       SETTING_TRACE(" >>>> ret = %d ", ret);
        setting_view_main.is_create = 1;
 
        return SETTING_RETURN_SUCCESS;
@@ -1589,6 +1853,14 @@ static int setting_main_destroy(void *cb)
                evas_object_del(ad->flight_popup);
                ad->flight_popup = NULL;
        }
+
+#if 0
+       if (ad->plugin_node)
+       {
+               setting_plugin_destroy(ad->plugin_node);
+       }
+#endif
+
        setting_view_main.is_create = 0;
        SETTING_TRACE_END;
        return SETTING_RETURN_SUCCESS;
@@ -1657,10 +1929,6 @@ void setting_update_gl_item(void* data)
                                item_to_update = ad->data_nfc;
                                bGlUpdate = EINA_TRUE;
                                break;
-                       case GL_ITEM_MAP:
-                               item_to_update = ad->data_mobileApp;
-                               bGlUpdate = EINA_TRUE;
-                               break;
                        case GL_ITEM_FLIGHT:
                                item_to_update = ad->data_flight;
                                bGlUpdate = EINA_FALSE;
@@ -1673,13 +1941,16 @@ void setting_update_gl_item(void* data)
                                continue;
                        }
 
-                       if(bGlUpdate) {
-                               SETTING_TRACE("gl update:%d", nDx);
-                               elm_object_item_data_set(item_to_update->item, item_to_update);
-                               elm_genlist_item_update(item_to_update->item);
-                       } else {
-                               SETTING_TRACE("chk update:%d", nDx);
-                               elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
+                       if (item_to_update) {
+                               SETTING_TRACE("gl update [%s], bGlUpdate:%d", _(item_to_update->keyStr), bGlUpdate);
+                               if(bGlUpdate) {
+                                       SETTING_TRACE("gl update:%d", nDx);
+                                       elm_object_item_data_set(item_to_update->item, item_to_update);
+                                       elm_genlist_item_update(item_to_update->item);
+                               } else {
+                                       SETTING_TRACE("chk update:%d", nDx);
+                                       elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
+                               }
                        }
 
                        ad->updateItems[nDx] = EINA_FALSE;
@@ -1812,40 +2083,6 @@ setting_main_click_list_default_ug_cb(void *data, Evas_Object *obj,
                                          NO_UG_FOUND_MSG);
 }
 
-void
-setting_main_click_list_usb_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       SETTING_TRACE_BEGIN;
-       retm_if(event_info == NULL, "Invalid argument: event info is NULL");
-
-       int err;
-       int value = -1;
-       char *str_text = USB_NEED_OFF;
-
-       Elm_Object_Item *item = (Elm_Object_Item *) event_info;
-
-       setting_get_int_slp_key(INT_SLP_SETTING_MOBILE_AP_STATUS, &value, &err);
-       if (err != 0)
-       {
-               SETTING_TRACE_ERROR("FAIL: VCONFKEY_MOBILE_HOTSPOT_MODE may not exist\n");
-               setting_main_click_list_ex_ug_cb(data, obj, item);
-               return;
-       }
-
-       /* If mobile hotspot is on, going USB utilties is blocked by a popup*/
-       if (value & VCONFKEY_MOBILE_HOTSPOT_MODE_USB)
-       {
-               elm_genlist_item_selected_set(item, EINA_FALSE);
-               setting_create_simple_popup(g_main_ad, g_main_ad->win_main, NULL, (str_text));
-       }
-       else
-       {
-               setting_main_click_list_ex_ug_cb(data, obj, item);
-       }
-
-       SETTING_TRACE_END;
-}
-
 void setting_main_click_list_more_cb(void *data, Evas_Object *obj, void *event_info)
 {
        SETTING_TRACE_BEGIN;
@@ -1944,8 +2181,26 @@ setting_main_click_list_plugin_cb(void *data, Evas_Object *obj,
        retm_if(event_info == NULL, "Invalid argument: event info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *) event_info;
        elm_genlist_item_selected_set(item, EINA_FALSE);
+
+       setting_main_appdata *ad = data;
 #ifdef PLUGIN
-       setting_plugin_load((const char *)data);
+       if (ad->plugin_path)
+       {
+               PluginNode* plugin_node = setting_plugin_create();
+
+               plugin_node->plugin_path = strdup(ad->plugin_path);
+
+               setting_plugin_load(plugin_node, (const char *)ad->plugin_path);
+               ad->plugin_node = (void*)plugin_node;
+
+               #if 0
+               if(ad->plugin_path)
+               {
+                       free(ad->plugin_path);
+                       ad->plugin_path = NULL;
+               }
+               #endif
+       }
 #endif
 }