// Unmount sdcard
ret = dbus_handle_method_sync_var(STORAGED_BUS_NAME,
- STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "Unmount", g_variant_new("(ii)", ad->storage_id, UNMOUNT_FORCE));
+ STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "Unmount", g_variant_new("(ii)", ad->storage_id, UNMOUNT_FORCE), NULL);
if (ret < 0) {
DMSG("Failed to mount sd card as portable storage: %d", ret);
return;
}
ret = dbus_handle_method_sync_var(STORAGED_BUS_NAME,
- STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "Mount", g_variant_new("(is)", ad->storage_id, ""));
+ STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "Mount", g_variant_new("(is)", ad->storage_id, ""), NULL);
if (ret < 0) {
DMSG("Failed to mount sd card as portable storage: %d", ret);
goto out;
return;
if (primary) {
- output = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
- STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetDeviceList", g_variant_new("(s)", "mmc"));
- if (!output) {
+ ret = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetDeviceList", g_variant_new("(s)", "mmc"), &output);
+ if (ret < 0) {
DMSG("Failed to get storage information.");
return;
}
} else
create_home_page_base_layout(ad);
- output = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
"GetMmcPrimary",
- NULL);
- if (!output) {
+ NULL,
+ &output);
+ if (ret < 0) {
DMSG("Failed to get storage information.");
return;
}
static bool request_block_method(const char *method, GVariant *param, int timeout)
{
- GVariant *msg;
- int val;
+ int val, err;
bool ret = FALSE;
+ GVariant *msg;
- msg = dbus_handle_method_sync_with_reply_var_timeout(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var_timeout(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
- method, param, timeout);
+ method, param, &msg, timeout);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", method);
return ret;
}
static int get_id()
{
GVariant *msg;
- int val;
+ int val, err;
int ret = -1;
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETMMCPRIMARY,
- NULL);
+ NULL,
+ &msg);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
static bool block_showdevicelist()
{
- GVariant *msg;
- int ret = FALSE;
+ int err;
_D("----------------------------------------------------------------------------------");
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_SHOWDEVICELIST,
+ NULL,
NULL);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_SHOWDEVICELIST);
- return ret;
+ return FALSE;
}
_I("Success. %s", METHOD_BLOCK_SHOWDEVICELIST);
- g_variant_unref(msg);
return TRUE;
}
{
GVariant *msg;
GVariantIter *iter;
- int val;
+ int val, err;
int ret = FALSE;
_D("----------------------------------------------------------------------------------");
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETDEVICELIST,
- g_variant_new("(s)", type));
+ g_variant_new("(s)", type),
+ &msg);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
GVariantIter *iter;
char *val;
int ret = FALSE;
+ int err;
_D("----------------------------------------------------------------------------------");
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETDEVICELIST2,
- g_variant_new("(s)", type));
+ g_variant_new("(s)", type),
+ &msg);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s)", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
GVariant *msg;
int val = -1;
int ret = FALSE;
+ int err;
_D("----------------------------------------------------------------------------------");
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETDEVICEINFO,
- g_variant_new("(i)", id));
+ g_variant_new("(i)", id),
+ &msg);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
GVariant *msg;
int val = -1;
int ret = FALSE;
+ int err;
_D("----------------------------------------------------------------------------------");
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETMMCPRIMARY,
- NULL);
+ NULL,
+ &msg);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
GVariant *msg;
unsigned long long val1, val2;
bool ret = FALSE;
+ int err;
- msg = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ err = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_STORAGE,
STORAGED_INTERFACE_STORAGE,
- method, param);
+ method, param, &msg);
- if (!msg) {
+ if (err < 0) {
_E("Failed to call dbus method(%s): no reply", method);
return ret;
}
{
int ret;
- ret = dbus_handle_method_async(PKGDIR_BUS_NAME, PKGDIR_PATH,
- PKGDIR_INTERFACE, "CreateExternalDirsForAllPkgs", NULL, NULL);
+ ret = dbus_handle_method_async_var(PKGDIR_BUS_NAME, PKGDIR_PATH,
+ PKGDIR_INTERFACE, "CreateExternalDirsForAllPkgs", NULL);
if (ret)
_E("Failed to create external directory.");
}
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
MMC_POPUP_NOTI,
- g_variant_new("(s)", MMC_INSERTED));
+ g_variant_new("(s)", MMC_INSERTED),
+ NULL);
if (ret != 0)
_E("Failed to popup: %d", ret);
}
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
MMC_POPUP_NOTI,
- g_variant_new("(s)", MMC_REMOVED));
+ g_variant_new("(s)", MMC_REMOVED),
+ NULL);
if (ret != 0)
_E("Failed to popup: %d", ret);
}
/* if there is the attached device, try to mount */
block_init_from_udev_enumerate();
- ret = dbus_handle_method_async_with_reply(DEVICED_BUS_NAME,
+ ret = dbus_handle_method_async_with_reply_var(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
METHOD_ADD_POWEROFF_WAIT,
- NULL, NULL,
+ NULL,
add_poweroff_wait_cb,
-1, NULL);
if (ret < 0)
terminate_threads();
if (add_poweroff_wait) {
- ret = dbus_handle_method_sync(DEVICED_BUS_NAME,
+ ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
METHOD_REMOVE_POWEROFF_WAIT,
pipe_exit();
if (add_poweroff_wait) {
- ret = dbus_handle_method_sync(DEVICED_BUS_NAME,
+ ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
METHOD_REMOVE_POWEROFF_WAIT,
static int remove_notification(void)
{
- const char *param[1];
- char id_str[16];
int ret;
- snprintf(id_str, sizeof(id_str), "%d", noti_id);
- param[0] = id_str;
-
- ret = dbus_handle_method_sync(POPUP_BUS_NAME,
+ ret = dbus_handle_method_sync_var(POPUP_BUS_NAME,
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
INTERNAL_STORAGE_NOTIOFF,
- "i",
- param);
+ g_variant_new("(i)", noti_id),
+ NULL);
if (ret < 0)
_E("Failed to remove noti(%d).", noti_id);
{
int ret;
- ret = dbus_handle_method_async_with_reply(POPUP_BUS_NAME,
+ ret = dbus_handle_method_async_with_reply_var(POPUP_BUS_NAME,
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
INTERNAL_STORAGE_NOTION,
NULL,
- NULL,
_noti_cb,
-1,
NULL);