return;
app_control_add_extra_data(app_control, VIEWTYPE_KEY, ENCRYPT_EXTENSION);
- app_control_add_extra_data(app_control, DEVPATH_KEY, "/dev/mmcblk1");
+ app_control_add_extra_data(app_control, DEVPATH_KEY, ad->devpath);
app_control_add_extra_data(app_control, MAPPING_NODE_KEY, "extendedsd");
ret = app_control_set_app_id(app_control, SECURITY_APP_ID);
if (ret != APP_CONTROL_ERROR_NONE) {
/* Handle the launch request. */
GVariant *output;
appdata_s *ad = (appdata_s *)data;
- char *id = NULL;
- char str_id[32];
- char *arr[1];
- int int_id;
+ int id;
int ret;
char *type = NULL;
+ char *devpath;
int len;
ret_if(ad == NULL);
- app_control_get_extra_data(app_control, POPUP_SDCARD_ID, &id);
- if (!id) {
- ad->storage_id = -1;
- DMSG("No sdcard id");
- return;
- }
- ad->storage_id = atoi(id);
-
ret = storage_set_state_changed_cb(ad->storage_id, storage_removed_cb, ad);
if (ret != STORAGE_ERROR_NONE) {
DMSG_ERR("Failed to register signal handler");
} else
create_home_page_base_layout(ad);
- snprintf(str_id, sizeof(str_id), "%d", ad->storage_id);
- arr[0] = str_id;
ret = dbus_method_sync_with_reply(STORAGED_BUS_NAME,
- STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetDeviceInfo", "i", arr, &output);
+ STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetMmcPrimary", NULL, NULL, &output);
if (ret < 0) {
DMSG("Failed to get storage information: %d", ret);
return;
}
- g_variant_get(output, "(issssssisibii)", NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &int_id);
- if (int_id != ad->storage_id) {
- DMSG("Storage already removed");
- ui_app_exit();
- }
+ g_variant_get(output, "(issssssisibii)", NULL, &devpath, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &id);
+
+ DMSG("Get Primary MMC: %d %s", id, devpath);
+ ad->storage_id = id;
+ ad->devpath = strdup(devpath);
}