app: Launch setting app when "Move apps now" and "Set Default storage" button touched 07/158307/1
authorpr.jung <pr.jung@samsung.com>
Tue, 31 Oct 2017 04:58:44 +0000 (13:58 +0900)
committerJung <pr.jung@samsung.com>
Tue, 31 Oct 2017 05:02:05 +0000 (05:02 +0000)
Change-Id: Id9596a1dcdeb681866bc7d5a45aa7a2884a8ec7c
Signed-off-by: pr.jung <pr.jung@samsung.com>
apps/extended-sd/include/extended-sd-main.h
apps/extended-sd/src/es-internal-storage-page.c
apps/extended-sd/src/es-portable-storage-page.c

index 3cdbd2b..ba6cc2a 100644 (file)
 #define UNMOUNT_FORCE  1
 
 #define MYFILES_APP_ID "org.tizen.myfile"
+#define SETTING_APP_ID "org.tizen.setting-storage"
 #define SECURITY_APP_ID        "org.tizen.ode"
 #define ENCRYPT_EXTENSION "ENCRYPT_EXTENSION"
+#define APPSELECT "appselect"
+#define DEFAULT_STORAGE "defstorage"
 
 typedef enum {
        USE_AS_PORTABLE_STORAGE = 0,
index 65ab94c..b9635f2 100644 (file)
@@ -238,6 +238,26 @@ _move_apps_button_click_cb(void *data, Evas_Object* obj, void *event_info)
 {
        FUNC_BEGIN();
 
+       app_control_h app_control = NULL;
+       int ret;
+
+       ret = app_control_create(&app_control);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               return;
+
+       ret = app_control_set_app_id(app_control, SETTING_APP_ID);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               app_control_destroy(app_control);
+               return;
+       }
+
+       app_control_add_extra_data(app_control, VIEWTYPE_KEY, APPSELECT);
+       ret = app_control_send_launch_request(app_control, NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+
+       app_control_destroy(app_control);
+
        FUNC_END();
 }
 
@@ -246,6 +266,26 @@ _set_default_button_click_cb(void *data, Evas_Object* obj, void *event_info)
 {
        FUNC_BEGIN();
 
+       app_control_h app_control = NULL;
+       int ret;
+
+       ret = app_control_create(&app_control);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               return;
+
+       ret = app_control_set_app_id(app_control, SETTING_APP_ID);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               app_control_destroy(app_control);
+               return;
+       }
+
+       app_control_add_extra_data(app_control, VIEWTYPE_KEY, DEFAULT_STORAGE);
+       ret = app_control_send_launch_request(app_control, NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+
+       app_control_destroy(app_control);
+
        FUNC_END();
 }
 
index 0947fca..97981e1 100644 (file)
@@ -141,6 +141,26 @@ _set_default_button_click_cb(void *data, Evas_Object* obj, void *event_info)
 {
        FUNC_BEGIN();
 
+       app_control_h app_control = NULL;
+       int ret;
+
+       ret = app_control_create(&app_control);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               return;
+
+       ret = app_control_set_app_id(app_control, SETTING_APP_ID);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               app_control_destroy(app_control);
+               return;
+       }
+
+       app_control_add_extra_data(app_control, VIEWTYPE_KEY, DEFAULT_STORAGE);
+       ret = app_control_send_launch_request(app_control, NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+
+       app_control_destroy(app_control);
+
        FUNC_END();
 }