*/
#include <app_control.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include "extended-sd-main.h"
#include "log-util.h"
elm_object_part_content_set(ad->internal_storage_page_data->internal_storage_page_base_layout, "elm.swallow.content", page_content);
// Unmount sdcard
- ret_val = dbus_handle_method_sync_var(STORAGED_BUS_NAME,
+ ret_val = gdbus_call_sync_with_reply_int(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "Unmount", g_variant_new("(ii)", ad->storage_id, UNMOUNT_FORCE), NULL);
if (ret_val < 0) {
DMSG("Failed to mount sd card as portable storage: %d", ret_val);
page_content = create_page_2(ad);
elm_object_part_content_set(ad->internal_storage_page_data->internal_storage_page_base_layout, "elm.swallow.content", page_content);
- ret_dbus = dbus_handle_method_async_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_async_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
"CheckSpeed",
*/
#include <app_control.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include "extended-sd-main.h"
#include "log-util.h"
goto out;
}
- ret = dbus_handle_method_sync_var(STORAGED_BUS_NAME,
+ ret = gdbus_call_sync_with_reply_int(STORAGED_BUS_NAME,
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);
return;
if (primary) {
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetDeviceList", g_variant_new("(s)", "mmc"), &reply);
if (ret_dbus < 0) {
DMSG("Failed to get storage information.");
g_variant_unref(reply);
}
- ret_dbus = dbus_handle_method_async_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_async_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
"FormatwithType",
elm_object_part_content_set(ad->portable_storage_page_data->portable_storage_page_base_layout, "elm.swallow.content", page_content);
- ret_dbus = dbus_handle_method_async_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_async_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
"Unmount",
* limitations under the License
*/
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include "extended-sd-main.h"
#include "es-preference-util.h"
} else
create_home_page_base_layout(ad);
- ret_val = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_val = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
"GetMmcPrimary",
bool ret = FALSE;
GVariant *reply;
- ret_dbus = dbus_handle_method_sync_with_reply_var_timeout(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply_timeout(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
method, param, &reply, timeout);
int reply_id, ret_dbus;
int ret = -1;
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETMMCPRIMARY,
_D("----------------------------------------------------------------------------------");
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_SHOWDEVICELIST,
int ret = FALSE;
_D("----------------------------------------------------------------------------------");
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETDEVICELIST,
int ret_dbus;
_D("----------------------------------------------------------------------------------");
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETDEVICELIST2,
int ret_dbus;
_D("----------------------------------------------------------------------------------");
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETDEVICEINFO,
int ret_dbus;
_D("----------------------------------------------------------------------------------");
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
METHOD_BLOCK_GETMMCPRIMARY,
bool ret = FALSE;
int ret_dbus;
- ret_dbus = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply(STORAGED_BUS_NAME,
STORAGED_PATH_STORAGE,
STORAGED_INTERFACE_STORAGE,
method, param, &reply);
#define STORAGED__TEST_H__
#include <stdio.h>
#include <errno.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include "log.h"
#include "storaged_common.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include <libsyscommon/ini-parser.h>
#include <libsyscommon/list.h>
#ifdef EXTENDED_STORAGE
data = bdev->data;
- ret_dbus = dbus_handle_emit_dbus_signal(NULL,
+ ret_dbus = gdbus_signal_emit(NULL,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
BLOCK_DEVICE_BLOCKED,
/* Broadcast outside with BlockManager iface */
param = block_data_to_gvariant(data, flags);
- ret_dbus = dbus_handle_emit_dbus_signal(NULL,
+ ret_dbus = gdbus_signal_emit(NULL,
STORAGED_PATH_BLOCK_MANAGER,
STORAGED_INTERFACE_BLOCK_MANAGER,
signal_name,
{
int ret_dbus;
- ret_dbus = dbus_handle_method_async_var(PKGDIR_BUS_NAME, PKGDIR_PATH,
+ ret_dbus = gdbus_call_async(PKGDIR_BUS_NAME, PKGDIR_PATH,
PKGDIR_INTERFACE, "CreateExternalDirsForAllPkgs", NULL);
if (ret_dbus)
_E("Failed to create external directory.");
create_external_apps_directory();
mmc_make_default_path(pdata.bdev->data->mount_point);
- ret_val = dbus_handle_method_sync_var(POPUP_BUS_NAME,
+ ret_val = gdbus_call_sync_with_reply_int(POPUP_BUS_NAME,
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
MMC_POPUP_NOTI,
pdata.bdev->data->primary &&
BLOCK_IS_FLAG_SET(pdata.bdev->data, UNMOUNT_UNSAFE)) {
- ret_val = dbus_handle_method_sync_var(POPUP_BUS_NAME,
+ ret_val = gdbus_call_sync_with_reply_int(POPUP_BUS_NAME,
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
MMC_POPUP_NOTI,
/* if there is the attached device, try to mount */
block_init_from_udev_enumerate();
- ret_val = dbus_handle_method_async_with_reply_var(DEVICED_BUS_NAME,
+ ret_val = gdbus_call_async_with_reply(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
METHOD_ADD_POWEROFF_WAIT,
terminate_threads();
if (add_poweroff_wait) {
- ret_dbus = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
+ ret_dbus = gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
METHOD_REMOVE_POWEROFF_WAIT,
if (onprivate) {
bdev->on_private_op = REQ_PRIVATE;
- bdev->private_pid = dbus_handle_get_sender_pid(NULL, sender);
+ bdev->private_pid = gdbus_connection_get_sender_pid(NULL, sender);
_D("Private operation state(%d). pid=%d.", bdev->on_private_op, bdev->private_pid);
}
}
if (onprivate) {
- pid = dbus_handle_get_sender_pid(NULL, sender);
+ pid = gdbus_connection_get_sender_pid(NULL, sender);
if (bdev->on_private_op == REQ_NORMAL || (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid)) {
_E("Failed to process private unmount operation pid=%d private_pid=%d.", pid, bdev->private_pid);
ret = -EPERM;
goto out;
}
- pid = dbus_handle_get_sender_pid(NULL, sender);
+ pid = gdbus_connection_get_sender_pid(NULL, sender);
if (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid) {
_E("Failed to format on private state.");
ret = -EPERM;
goto out;
}
- pid = dbus_handle_get_sender_pid(NULL, sender);
+ pid = gdbus_connection_get_sender_pid(NULL, sender);
if (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid) {
_E("Failed to format on private state.");
ret = -EPERM;
static GVariant *block_data_to_gvariant(struct block_data *data, int flags)
{
if (!data)
- return dbus_handle_new_g_variant_tuple();
+ return gdbus_new_g_variant_tuple();
return g_variant_new("(issssssisibii)",
data->block_type,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
show_block_device_list();
- return dbus_handle_new_g_variant_tuple();
+ return gdbus_new_g_variant_tuple();
}
static enum block_device_type get_bdev_type_from_type_string(const char *type_str)
_E("Failed to mount tmpfs to root mount path: %d", ret_val);
/* register block manager object and interface */
- ret_val = dbus_handle_register_dbus_object(NULL, STORAGED_PATH_BLOCK_MANAGER, &block_interface);
+ ret_val = gdbus_register_object(NULL, STORAGED_PATH_BLOCK_MANAGER, &block_interface);
if (ret_val < 0)
_E("Failed to register block interface and methods: %d", ret_val);
if (ret_val < 0)
_E("Failed to get internal storage number.");
- id_block_poweroff = subscribe_dbus_signal(NULL, DEVICED_PATH_POWEROFF,
+ id_block_poweroff = gdbus_signal_subscribe(NULL, DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
SIGNAL_POWEROFF_STATE,
block_poweroff, NULL, NULL);
udev_exit(NULL);
/* unregister notifier for below each event */
- unsubscribe_dbus_signal(NULL, id_block_poweroff);
+ gdbus_signal_unsubscribe(NULL, id_block_poweroff);
/* unregister mmc uevent control routine */
ret_val = unregister_udev_uevent_control(&uh);
pipe_exit();
if (add_poweroff_wait) {
- ret_val = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
+ ret_val = gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME,
DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
METHOD_REMOVE_POWEROFF_WAIT,
#include <dbus/dbus.h>
#include <stdbool.h>
#include <limits.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include "fd_handler.h"
#include "log.h"
#ifndef __STORAGED_DBUS_MAIN_H__
#define __STORAGED_DBUS_MAIN_H__
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
int set_dbus_connection(const char *bus);
#include <argos.h>
#include <systemd/sd-daemon.h>
#include <glib.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include <sys/types.h>
#include <sys/stat.h>
return -ENOMEM;
}
- handle = dbus_handle_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
+ handle = gdbus_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
if (!handle)
_E("Failed to get dbus connection.");;
dir_init();
modules_init(NULL);
- ret = dbus_handle_request_bus_name(handle, STORAGED_BUS_NAME, dbus_name_acquired, NULL);
+ ret = gdbus_request_name(handle, STORAGED_BUS_NAME, dbus_name_acquired, NULL);
if (ret <= 0) {
_E("Failed to request bus name.");
- dbus_handle_check_owner_name(NULL, STORAGED_BUS_NAME);
+ gdbus_check_name_owner(NULL, STORAGED_BUS_NAME);
}
signal(SIGTERM, sig_quit);
va_start(args, num);
- ret = dbus_handle_method_async_pairs_with_reply(app_match[match].bus,
+ ret = gdbus_call_pairs_async_with_reply(app_match[match].bus,
app_match[match].path,
app_match[match].iface,
app_match[match].method,
#ifndef __APPS_H__
#define __APPS_H__
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#define POPUP_DEFAULT "system"
#include <stdio.h>
#include <errno.h>
#include <assert.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include <libsyscommon/list.h>
#include "log.h"
void udev_init(void *data)
{
- id_device_change_poweroff = subscribe_dbus_signal(NULL, DEVICED_PATH_POWEROFF,
+ id_device_change_poweroff = gdbus_signal_subscribe(NULL, DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
SIGNAL_POWEROFF_STATE,
device_change_poweroff,
void udev_exit(void *data)
{
- unsubscribe_dbus_signal(NULL, id_device_change_poweroff);
+ gdbus_signal_unsubscribe(NULL, id_device_change_poweroff);
}
#include <storage.h>
#include <tzplatform_config.h>
#include <glib.h>
-#include <libsyscommon/dbus-system.h>
+#include <libsyscommon/libgdbus.h>
#include <libsyscommon/ini-parser.h>
#include "log.h"
_D("time=%s path=%d level=%s", buf, path, value);
out:
- ret_dbus = dbus_handle_emit_dbus_signal(NULL,
+ ret_dbus = gdbus_signal_emit(NULL,
STORAGED_PATH_LOWMEM,
STORAGED_INTERFACE_LOWMEM,
SIGNAL_NEED_CLEANUP,
va_start(args, num);
- ret = dbus_handle_method_async_pairs_with_reply(POPUP_BUS_NAME,
+ ret = gdbus_call_pairs_async_with_reply(POPUP_BUS_NAME,
POPUP_PATH_SYSTEM,
POPUP_INTERFACE_SYSTEM,
"PopupLaunch",
{
int ret;
- ret = dbus_handle_method_sync_var(POPUP_BUS_NAME,
+ ret = gdbus_call_sync_with_reply_int(POPUP_BUS_NAME,
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
INTERNAL_STORAGE_NOTIOFF,
{
int ret;
- ret = dbus_handle_method_async_with_reply_var(POPUP_BUS_NAME,
+ ret = gdbus_call_async_with_reply(POPUP_BUS_NAME,
POPUP_PATH_NOTI,
POPUP_INTERFACE_NOTI,
INTERNAL_STORAGE_NOTION,
dAvail = (unsigned long long)s.f_bsize * s.f_bavail;
}
- pid = dbus_handle_get_sender_pid(NULL, sender);
+ pid = gdbus_connection_get_sender_pid(NULL, sender);
_D("PID=%d path='%s' total=%4.0llu avail=%4.0llu", pid, str_path, dTotal, dAvail);
storage_get_memory_size(str_path, &s);
- pid = dbus_handle_get_sender_pid(NULL, sender);
+ pid = gdbus_connection_get_sender_pid(NULL, sender);
_D("PID=%d path='%s'", pid, str_path);
storage_config_load(&storage_internal_info);
- ret_val = dbus_handle_register_dbus_object(NULL, STORAGED_PATH_STORAGE,
+ ret_val = gdbus_register_object(NULL, STORAGED_PATH_STORAGE,
&storage_interface);
if (ret_val < 0)
_E("Failed to register dbus interface and methods: %d", ret_val);
init_cleanup_storage();
- id_storage_poweroff = subscribe_dbus_signal(NULL, DEVICED_PATH_POWEROFF,
+ id_storage_poweroff = gdbus_signal_subscribe(NULL, DEVICED_PATH_POWEROFF,
DEVICED_INTERFACE_POWEROFF,
SIGNAL_POWEROFF_STATE,
storage_poweroff, NULL, NULL);
{
free_cleanup_storage();
/* unregister notifier for below each event */
- unsubscribe_dbus_signal(NULL, id_storage_poweroff);
+ gdbus_signal_unsubscribe(NULL, id_storage_poweroff);
}
static storaged_module_interface storage_module = {