app: Need to launch app with launch option 41/156141/2
authorpr.jung <pr.jung@samsung.com>
Mon, 16 Oct 2017 09:23:06 +0000 (18:23 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 17 Oct 2017 08:35:38 +0000 (08:35 +0000)
- Can skip portable / extended internal selection page

Change-Id: Ib4d1dc7e06c65ad6bccb8779c47ca271b391a352
Signed-off-by: pr.jung <pr.jung@samsung.com>
apps/extended-sd/src/extended-sd-main.c
src/shared/dbus_macro.h

index 8bff947..d4065ea 100644 (file)
@@ -3,6 +3,9 @@
 #include "log-util.h"
 #include "dbus-call.h"
 
+#define SETUP_EXTENDED "EXTENDED_STORAGE_SETUP"
+#define SETUP_EXTERNAL "EXTERNAL_STORAGE_SETUP"
+
 static void
 win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
 {
@@ -42,8 +45,6 @@ create_base_gui(appdata_s *ad)
        /* Show window after base gui is set up */
        evas_object_show(ad->win);
 
-       create_home_page_base_layout(ad);
-
        FUNC_END();
 }
 
@@ -82,6 +83,9 @@ app_control(app_control_h app_control, void *data)
        int int_id;
        int ret;
 
+       char *type = NULL;
+       int len;
+
        app_control_get_extra_data(app_control, POPUP_SDCARD_ID, &id);
        if (!id) {
                ad->storage_id = -1;
@@ -93,6 +97,19 @@ app_control(app_control_h app_control, void *data)
        ad->storage_id = atoi(id);
        register_signal_handler(ad);
 
+       len = strlen(SETUP_EXTENDED) + 1;
+       app_control_get_extra_data(app_control, SDCARD_SETUP_TYPE, &type);
+       if (!type) {
+               DMSG("No setup type");
+               create_home_page_base_layout(ad);
+       } else if (!strncmp(type, SETUP_EXTENDED, len)) {
+               DMSG("selected USE_AS_INTERNAL_STORAGE");
+               create_internal_storage_page_base_layout(ad);
+       } else if (!strncmp(type, SETUP_EXTERNAL, len)) {
+               DMSG("selected USE_AS_PORTABLE_STORAGE");
+               create_portable_storage_page_base_layout(ad);
+       } else
+               create_home_page_base_layout(ad);
 
        snprintf(str_id, sizeof(str_id), "%d", ad->storage_id);
        arr[0] = str_id;
index 3d70090..76f54a8 100755 (executable)
@@ -90,5 +90,6 @@
 #define POPUP_METHOD_LAUNCH                 "PopupLaunch"
 #define POPUP_KEY_CONTENT                   "_SYSPOPUP_CONTENT_"
 #define POPUP_SDCARD_ID                     "_SDCARD_NUM_"
+#define SDCARD_SETUP_TYPE                   "_SDCARD_SETUP_TYPE_"
 
 #endif /* __STORAGED_DBUS_MACRO_H__ */