if (!storage_ext_is_supported())
return STORAGE_ERROR_NOT_SUPPORTED;
- ret_dbus = gdbus_call_sync_with_reply(STORAGE_EXT_BUS_NAME,
+ dbus_handle_h dbus_handle = gdbus_get_connection(G_BUS_TYPE_SYSTEM, true);
+ if (dbus_handle == NULL) {
+ _E("Failed to get dbus connection");
+ return STORAGE_ERROR_OPERATION_FAILED;
+ }
+
+ ret_dbus = gdbus_priv_call_sync_with_reply(dbus_handle,
+ STORAGE_EXT_BUS_NAME,
STORAGE_EXT_PATH_MANAGER,
STORAGE_EXT_IFACE_MANAGER,
"GetMmcPrimary",
NULL,
&reply);
+
+ gdbus_free_connection(dbus_handle);
+
if (ret_dbus < 0) {
//LCOV_EXCL_START System Error
_E("Failed to get primary sdcard partition"); //LCOV_EXCL_LINE