modify app_launcher code in settings, including worldclock 16/75216/3 accepted/tizen/mobile/20160623.121124 submit/tizen/20160622.045519
authorMyoungJune Park <mj2004.park@samsung.com>
Fri, 17 Jun 2016 05:35:01 +0000 (14:35 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Tue, 21 Jun 2016 07:16:53 +0000 (16:16 +0900)
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
Conflicts:
setting-common/src/setting-common-general-func.c

Change-Id: I85b0a0e671c1de8cbcf9ae6ca9b66401c4ec9aad

16 files changed:
setting-about/src/setting-about-main.c
setting-applications/src/setting-applications-defaultapp.c
setting-applications/src/setting-applications-main.c
setting-common/include/setting-common-general-func.h
setting-common/src/setting-common-general-func.c
setting-connectivity/src/setting-connectivity-usb.c
setting-display/src/setting-display-main.c
setting-moreconnections/src/setting-moreconnections-main.c
setting-phone/src/setting-phone-language-region.c
setting-profile/src/setting-profile-sound-main.c
setting-security/src/setting-security-main.c
setting-security/src/setting-security.c
setting-storage/src/setting-storage-main.c
setting-time/include/setting-time.h
setting-time/src/setting-time-main.c
src/setting-handler.c

index 97b28108f9bc8e86271e8f0bcf0be067038a93cf..d5d09367f6ddd2ca36211d50779d19f1ac4d7a04 100644 (file)
@@ -1717,7 +1717,7 @@ static void setting_about_main_mouse_up_Gendial_list_cb(void *data,
                        elm_object_focus_set(back_btn, EINA_TRUE);
                }
 
-               app_launcher("org.tizen.oma-dm");
+               app_launcher("org.tizen.oma-dm", NULL, NULL);
 #endif
        } else if (!safeStrCmp(SETTING_ABOUT_DEVICE_NAME_STR,
                        list_item->keyStr)) {
index ed2b38737ad1e8aab04830646592c9fe2cbf415d..4b3deb0b19286adb05f41e8180c29356276fe2f9 100644 (file)
@@ -425,7 +425,7 @@ static gboolean setting_applications_create_homescreen_setting_ug(void *data)
                return FALSE;
        }
 
-       app_launcher("org.tizen.setting-homescreen");
+       app_launcher("org.tizen.setting-homescreen", NULL, NULL);
 
        return TRUE;
 }
index 049c3eecd6a296f49dabfe2c855ff87a5a0eaf1d..bba9801252a8ba5ce7794371871b816a2212fbc4 100644 (file)
@@ -179,7 +179,7 @@ static void setting_applications_manage_apps_ug(SettingApplicationsUG *ad)
 {
        SETTING_TRACE_BEGIN;
        if (app_launcher(
-                       "setting-manage-applications-efl|viewtype:manage-applications")
+                       "setting-manage-applications-efl|viewtype:manage-applications", NULL, NULL)
                        == 0) {
                ad->event_freeze_timer = ecore_timer_add(1,
                                setting_applications_manage_apps_freeze_event_timer_cb,
index 26e250f04e57d29d558c6ff4c03fe36351efcc8d..d24021796a02e312c2ec6978a9366d2b6827b8f7 100644 (file)
@@ -129,7 +129,7 @@ extern char *_get_default_font();
 extern int setting_set_i18n(char *pkgname, char *localedir);
 extern int setting_set_i18n_force(char *pkgname, char *localedir);
 
-extern int app_launcher(const char *pkg_name);
+extern int app_launcher(const char *pkg_name, app_control_reply_cb callback, void *user_data);
 extern int app_group_launcher(const char *pkg_name);
 extern char *substring(const char *str, size_t begin, size_t len);
 extern bool check_blockingmode_sub_item();
index caf4e2a57a0efa19416f1b7dadfe1791ca947513..24a3fdf050a25d2127f4862542cef7261d522a9c 100644 (file)
@@ -1895,7 +1895,7 @@ int setting_set_i18n_force(char *pkgname, char *localedir)
 /*example 2:  app_launcher("emergency-msg-setting-efl"); */
 /*example 3:  app_launcher(
  * "sevenemail-setting-efl|caller:setting;cmd:main option"); */
-EXPORT_PUBLIC int app_launcher(const char *pkg_name)
+EXPORT_PUBLIC int app_launcher(const char *pkg_name, app_control_reply_cb callback, void *user_data)
 {
        int ret = -1;
        char *path = NULL;
@@ -1913,7 +1913,8 @@ EXPORT_PUBLIC int app_launcher(const char *pkg_name)
                SETTING_TRACE("app path - %s", path);
        }
 
-       int launch_ret = app_control_send_launch_request(service, NULL, NULL);
+       SETTING_TRACE("service name  - %s", path);
+       int launch_ret = app_control_send_launch_request(service, callback, user_data);
        SETTING_TRACE("after app_service_create - %s : %d ", pkg_name,
                        launch_ret);
        if (launch_ret == APP_CONTROL_ERROR_NONE) {
index fc53acf20e820dd90c97bea4d6a4f5f8ddf10a77..bfb9cc18c8bd09644e03920addedfe75d044b99f 100644 (file)
@@ -388,7 +388,7 @@ static void setting_connectivity_main_chk_btn_cb(void *data, Evas_Object *obj,
        SETTING_TRACE("list_item->keyStr = %s", list_item->keyStr);
        if (!safeStrCmp("IDS_ST_MBODY_SHOW_CPU_USAGE", list_item->keyStr)) {
                if (opposite) {
-                       app_launcher(SETTING_CPU_USAGE_PKG_NAME);
+                       app_launcher(SETTING_CPU_USAGE_PKG_NAME, NULL, NULL);
                } else {
 #if 0
                        bool running_flag = FALSE;
@@ -444,7 +444,7 @@ static void setting_connectivity_usb_mouse_up_Gendial_CPU_usage_cb(void *data,
 
                if (list_item->chk_status) {
                        vconf_set_bool("db/setting/show_cpu_info", 1);
-                       app_launcher(SETTING_CPU_USAGE_PKG_NAME);
+                       app_launcher(SETTING_CPU_USAGE_PKG_NAME, NULL, NULL);
                } else {
                        vconf_set_bool("db/setting/show_cpu_info", 0);
                }
@@ -472,7 +472,7 @@ static void __setting_connectivity_usb_dia_usage_mouse_up_cb(void *data,
        if (list_item)
                SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
 
-       app_launcher("org.tizen.crash-viewer");
+       app_launcher("org.tizen.crash-viewer", NULL, NULL);
 }
 
 char *get_bg_processes()
index 109db9ddcc6410beb928c62ad7fd316e8a1ee1c1..c47898bc665c73028f73040649b26cca7e118779 100644 (file)
@@ -700,7 +700,7 @@ gboolean setting_display_create_font_sg(void *data)
        /* error check */
        retv_if(data == NULL, FALSE);
 
-       if (0 == app_launcher("setting-font-efl")) {
+       if (0 == app_launcher("setting-font-efl", NULL, NULL)) {
                if (ad->event_freeze_timer) {
                        ecore_timer_del(ad->event_freeze_timer);
                        ad->event_freeze_timer = NULL;
index 3b785ed307aa1e1d9d813530d44e674b717af73b..6d3a8438f01e84726f91f4236f85923ebc4a36f0 100644 (file)
@@ -69,7 +69,7 @@ static void setting_moreconnections_main_mouse_up_Gendial_list_cb(void *data,
        SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
 
        if (!safeStrCmp(KeyStr_LocationService, list_item->keyStr)) {
-               app_launcher("org.tizen.setting-location");
+               app_launcher("org.tizen.setting-location", NULL, NULL);
        }
 }
 
index 7fcdfb41aeceb726ab1447f1f4369fc668aba7ab..70310e2eaccfd943446afa04a7ab92e66bf1ab69 100644 (file)
@@ -192,7 +192,7 @@ static void setting_phone_lang_create_readout_ug(SettingPhoneUG *ad)
        SETTING_TRACE_BEGIN;
        ret_if(ad == NULL);
 
-       if (app_launcher("setting-drivingmode-efl") == 0) {
+       if (app_launcher("setting-drivingmode-efl", NULL, NULL) == 0) {
                ad->event_freeze_timer = ecore_timer_add(1,
                                setting_phone_language_region_freeze_event_timer_cb,
                                ad);
index 4bdc3ce968885409945645c31a11020775a14cea..6d063c0e6d3053b69d8275a23aabb5abd8e406f9 100644 (file)
@@ -1338,6 +1338,7 @@ static Eina_Bool __feedback_back_cb(void *data, Elm_Object_Item *it)
        return EINA_TRUE;
 }
 
+#if 0
 void setting_sound_notifications_layout_ug_cb(ui_gadget_h ug,
                enum ug_mode mode,
                void *priv)
@@ -1363,6 +1364,7 @@ void setting_sound_notifications_layout_ug_cb(ui_gadget_h ug,
        }
        SETTING_TRACE_END;
 }
+#endif
 
 static void
 setting_sound_main_mouse_up_Gendial_list_cb(void *data,
index 70de72e41255c55e3648df805ccb727b03b0f80e..9390b98283275970e5a734dacd28e039096c0207 100644 (file)
@@ -410,34 +410,13 @@ static void setting_security_main_mouse_up_Gendial_list_cb(void *data,
        SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
 
        if (!safeStrCmp(KeyStr_LockScreen, list_item->keyStr)) {
-#if 1
-               if (0 == app_launcher("org.tizen.ug-lockscreen-options")) {
+               if (0 == app_launcher("org.tizen.ug-lockscreen-options", NULL, NULL)) {
                        /*if (0 == app_launcher(
                         * "setting-lockscreen-options-efl")) { */
                        ad->update_view_timer = ecore_timer_add(1,
                                        __freeze_event_timer_cb, ad);
                        evas_object_freeze_events_set(ad->navi_bar, EINA_TRUE);
                }
-#else
-               retm_if(data == NULL, "Data parameter is NULL");
-
-               SettingSecurityUG *ad = (SettingSecurityUG *) data;
-
-               struct ug_cbs *cbs = (struct ug_cbs *)
-                               calloc(1, sizeof(struct ug_cbs));
-               setting_retm_if(!cbs, "calloc failed");
-               cbs->layout_cb = setting_security_lockscreen_layout_ug_cb;
-               cbs->result_cb = NULL;
-               cbs->destroy_cb = setting_security_lockscreen_destroy_ug_cb;
-               cbs->priv = (void *)ad;
-
-               elm_object_tree_focus_allow_set(ad->ly_main, EINA_FALSE);
-
-               SETTING_TRACE("To load ug[%s]", "lockscreen-options");
-               setting_ug_create(ad->ug, "lockscreen-options",
-                               UG_MODE_FULLVIEW, NULL, cbs);
-               FREE(cbs);
-#endif
        }
 }
 
index 8538c486d019b9b6a6e1e7cf666a146968729786..b1fe7aa73b0065a88d536cdc733e414a4188e893 100644 (file)
@@ -1237,29 +1237,7 @@ gboolean setting_security_create_lockscreen_options_sg(void *data)
                return FALSE;
        }
 
-#if 1
-       app_launcher("lockscreen-options");
-#else
-       struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
-
-       if (!cbs)
-       return FALSE;
-       cbs->layout_cb = setting_security_layout_lockscreen_options_ug_cb;
-       cbs->result_cb = NULL;
-       cbs->destroy_cb = setting_security_destroy_lockscreen_options_ug_cb;
-       cbs->priv = (void *)ad;
-
-       if (ad->ly_main)
-       elm_object_tree_focus_allow_set(ad->ly_main, EINA_FALSE);
-       ad->ug_lockscreen = setting_ug_create(ad->ug, "lockscreen-options",
-                       UG_MODE_FULLVIEW, NULL, cbs);
-       if (NULL == ad->ug_lockscreen) { /* error handling */
-               SETTING_TRACE_ERROR("NULL == ad->ug_lockscreen");
-               evas_object_show(ad->ly_main);
-       }
-
-       FREE(cbs);
-#endif
+       app_launcher("lockscreen-options", NULL, NULL);
 
        return TRUE;
 }
index fe558854c00974b826cbbf949a4def48662a1da7..fc2dbc6521612df3ca42995d02b8097650b5f050 100644 (file)
@@ -455,9 +455,9 @@ static void storageUg_main_sel(void *data, Evas_Object *obj, void *event_info)
        } else if (!safeStrCmp(STORAGEUG_STR_DEF_STORAGE, list_item->keyStr)) {
                setting_view_change(ad->main_view, ad->default_view, ad);
        } else if (!safeStrCmp(STORAGEUG_STR_PICS, list_item->keyStr)) {
-               app_launcher("org.tizen.gallery");
+               app_launcher("org.tizen.gallery", NULL, NULL);
        } else if (!safeStrCmp(STORAGEUG_STR_AUDIO, list_item->keyStr)) {
-               app_launcher("org.tizen.music-player");
+               app_launcher("org.tizen.music-player", NULL, NULL);
        } else if (!safeStrCmp(STORAGEUG_STR_MISCES, list_item->keyStr)) {
                setting_view_change(ad->main_view, ad->misces_view, ad);
        } else if (!safeStrCmp(STORAGEUG_STR_CACHE, list_item->keyStr)) {
index fd60c95aac73dca11bd9146f0d32ff8d994cd072..5a33fcf13c0862392a5a0f5b7fe6a34cd61c399b 100644 (file)
@@ -74,6 +74,7 @@ struct _SettingTimeUG {
        Evas_Object *navi_bar;
        Evas_Object *scrl_main;
        char *caller;
+       Ecore_Timer *event_freeze_timer;
 
 #ifdef USE_TIMER_UPDATE_TIME_IN_TIME_VIEW
        Ecore_Timer *update_timer;
index 56867e211cd847593e3847986bf7ada1c8a16c3c..6fe7de8ccbffc85043f60e47ce87ff8e8dd41e10 100644 (file)
@@ -1130,6 +1130,87 @@ void setting_time_main_launch_worldclock_layout_ug_cb(
        SETTING_TRACE_END;
 }
 
+Eina_Bool ___time_freeze_event_timer_cb(void *cb)
+{
+       SettingTimeUG *ad = (SettingTimeUG*)cb;
+
+       SETTING_TRACE_BEGIN;
+       retv_if(cb == NULL, EINA_FALSE);
+
+       evas_object_freeze_events_set(ad->navi_bar, EINA_FALSE);
+       ad->event_freeze_timer = NULL;
+
+       return EINA_FALSE;
+}
+
+static void _worldclock_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+{
+       SETTING_TRACE_BEGIN;
+       /* error check */
+       retm_if(user_data == NULL, "Data parameter is NULL");
+
+       SettingTimeUG *ad = (SettingTimeUG *) user_data;
+
+       char *city = NULL;
+       char *tzpath = NULL;
+       app_control_get_extra_data(reply, "city", &city);
+       app_control_get_extra_data(reply, "tzpath", &tzpath);
+
+       if (!tzpath) {
+               SETTING_TRACE("tzpath from worldclock UG is null.");
+               setting_update_timezone(ad);
+               return;
+       } else {
+               SETTING_TRACE("tzpath : %s", tzpath);
+       }
+       SETTING_TRACE("city : %s", city);
+
+       /* ----------------------------------------------------------------- */
+       char tz_path[MAX_COMMON_BUFFER_LEN / 4 + 1];
+       safeCopyStr(tz_path, SETTING_TIME_ZONEINFO_PATH,
+                       MAX_COMMON_BUFFER_LEN / 4);
+       g_strlcat(tz_path, tzpath, sizeof(tz_path));
+       SETTING_TRACE("full tz_path:(%s)", tz_path);
+       SETTING_TRACE("tz_path:(%s)", tz_path+20);
+
+       int ret = _set_timezone_helper(tz_path+20);
+       if (ret < 0) {
+               SETTING_TRACE("tzpath is not valid.");
+               if (tzpath)
+                       FREE(tzpath);
+               if (city)
+                       FREE(city);
+               return;
+       } else
+               SETTING_TRACE("_set_timezone_helper - successful : "
+                               "%s \n", tz_path);
+
+       ret = vconf_set_str(VCONFKEY_SETAPPL_CITYNAME_INDEX_INT, city);
+       setting_retm_if(ret != 0, "set vconf failed");
+
+       /* parse city and GMT offset from tzpath and system time property */
+       /* set the strings in vconf which will be used while updating display
+        * of timezone */
+       if (!__setting_set_city_tzone(tzpath)) {
+               SETTING_TRACE("__setting_set_city_tzone ERROR");
+               if (tzpath)
+                       FREE(tzpath);
+               if (city)
+                       FREE(city);
+               return;
+       }
+
+       /* update the display for timezone */
+       setting_update_timezone(ad);
+       static int t_event_val = -1;
+       vconf_set_int(VCONFKEY_SYSTEM_TIME_CHANGED, t_event_val);
+       if (tzpath)
+               FREE(tzpath);
+       if (city)
+               FREE(city);
+
+       SETTING_TRACE_END;
+}
 
 void setting_time_main_launch_worldclock_sg(void *data)
 {
@@ -1137,25 +1218,22 @@ void setting_time_main_launch_worldclock_sg(void *data)
        /* error check */
        retm_if(data == NULL, "Data parameter is NULL");
 
+       /* ad is point to data */
        SettingTimeUG *ad = (SettingTimeUG *) data;
 
-       struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
-       setting_retm_if(!cbs, "calloc failed");
-       cbs->layout_cb = setting_time_main_launch_worldclock_layout_ug_cb;
-       cbs->result_cb = setting_time_main_launch_worldclock_result_ug_cb;
-       cbs->destroy_cb = setting_time_main_launch_worldclock_destroy_ug_cb;
-       cbs->priv = (void *)ad;
-
-       elm_object_tree_focus_allow_set(ad->ly_main, EINA_FALSE);
-       SETTING_TRACE("to load ug[%s]", "worldclock-efl");
-       ad->ug_loading = setting_ug_create(ad->ug, "worldclock-efl",
-                       UG_MODE_FULLVIEW, NULL, cbs);
-       if (ad->ug_loading == NULL) {   /* error handling */
-               SETTING_TRACE_ERROR("Cannot load worldclock-efl UG module");
-       }
+       SETTING_TRACE_BEGIN;
+       /* error check */
+       retv_if(data == NULL, FALSE);
 
-       FREE(cbs);
-       return;
+       if (0 == app_launcher("org.tizen.worldclock-efl", _worldclock_reply_cb, ad)) {
+               if (ad->event_freeze_timer) {
+                       ecore_timer_del(ad->event_freeze_timer);
+                       ad->event_freeze_timer = NULL;
+               }
+               ad->event_freeze_timer = ecore_timer_add(
+                               1, ___time_freeze_event_timer_cb, ad);
+               evas_object_freeze_events_set(ad->navi_bar, EINA_TRUE);
+       }
 }
 
 static void __setting_update_datefield_cb(void *cb)
index 02fabf03d2da8aad369f93b42111c7357c2c886c..cf0d71477c2b690676d2a22a4aa2f6d6ff36e851 100644 (file)
@@ -305,7 +305,7 @@ void setting_main_click_list_ex_ug_cb(void *data, Evas_Object *obj,
                return;
        }
        if (pnode && pnode->item_type == Cfg_Item_AppLauncher_Node) {
-               if (app_launcher(data) == 0) {
+               if (app_launcher(data, NULL, NULL) == 0) {
                        ad->event_freeze_timer = ecore_timer_add(1,
                                        setting_main_freeze_event_timer_cb, ad);
                        evas_object_freeze_events_set(ad->navibar_main,