#include "dbus-call.h"
#include "log-util.h"
+#define UNMOUNT_FORCE 1
+
typedef enum {
INTERNAL_STORAGE_ITEM_PAGE_1_HEADING = 0,
INTERNAL_STORAGE_ITEM_PAGE_1_PARA_1,
app_control_h app_control = NULL;
appdata_s* ad = (appdata_s*)data;
int ret;
+ char str_id[32];
+ char str_option[32];
+ char *arr[2];
ret_if(ad == NULL);
page_content = create_page_4(ad);
elm_object_part_content_set(ad->internal_storage_page_data->internal_storage_page_base_layout, "elm.swallow.content", page_content);
+ // Unmount sdcard
+ snprintf(str_id, sizeof(str_id), "%d", ad->storage_id);
+ arr[0] = str_id;
+ snprintf(str_option, sizeof(str_option), "%d", UNMOUNT_FORCE);
+ arr[1] = str_option;
+
+ ret = dbus_method_sync(STORAGED_BUS_NAME,
+ STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "Unmount", "ii", arr);
+ if (ret < 0) {
+ DMSG("Failed to mount sd card as portable storage: %d", ret);
+ return;
+ }
+
ret = app_control_create(&app_control);
if (ret != APP_CONTROL_ERROR_NONE)
return;