{
GDBusConnection *g_bus = NULL;
GError *error = NULL;
- GDBusMessage *message = NULL;
- GDBusMessage *reply = NULL;
GVariant *reply_var = NULL;
GVariantIter *iter = NULL;
char *type_str = NULL;
return MS_MEDIA_ERR_INTERNAL;
}
- message = g_dbus_message_new_method_call(dest, path, interface, method);
- if (!message) {
- MS_DBG_ERR("g_dbus_message_new_method_call(%s:%s-%s)", path, interface, method);
- g_object_unref(g_bus);
- return MS_MEDIA_ERR_INTERNAL;
- }
-
- g_dbus_message_set_body(message, g_variant_new("(s)", (gchar*)param));
-
- reply = g_dbus_connection_send_message_with_reply_sync(g_bus, message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, DBUS_REPLY_TIMEOUT, NULL, NULL, &error);
- g_object_unref(message);
- if (!reply) {
- MS_DBG_ERR("dbus_connection_send error(%s) %s %s:%s-%s",
- error ? error->message : "none", dest, path, interface, method);
- g_error_free(error);
- g_object_unref(message);
- g_object_unref(g_bus);
- return MS_MEDIA_ERR_INTERNAL;
- }
-
- reply_var = g_dbus_message_get_body(reply);
+ reply_var = g_dbus_connection_call_sync(g_bus, dest, path, interface, method, g_variant_new("(s)", (gchar*)param), NULL, G_DBUS_SEND_MESSAGE_FLAGS_NONE, DBUS_REPLY_TIMEOUT, NULL, &error);
if (!reply_var) {
- MS_DBG_ERR("Failed to get the body of message");
- g_object_unref(reply);
+ MS_DBG_ERR("Failed to get GVariant[%s]", error->message);
+ g_error_free(error);
g_object_unref(g_bus);
return MS_MEDIA_ERR_INTERNAL;
}
type_str = strdup((char*)g_variant_get_type_string(reply_var));
if (!type_str) {
MS_DBG_ERR("Failed to get the type-string of message");
- g_object_unref(reply);
+ g_variant_unref(reply_var);
g_object_unref(g_bus);
return MS_MEDIA_ERR_INTERNAL;
}
g_variant_iter_free(iter);
- g_object_unref(reply);
+ g_variant_unref(reply_var);
g_object_unref(g_bus);
MS_SAFE_FREE(type_str);
#endif
static bool __ms_is_dcm_supported(void);
+static bool __ms_is_external_supported(void);
+
static char *priv_lang = NULL;
#endif
/* update external storage */
- __ms_update_storage_status();
+ if (__ms_is_external_supported())
+ __ms_update_storage_status();
#ifdef _USE_SENIOR_MODE
__ms_check_disc_status();
}
-static bool __ms_is_dcm_supported()
+static bool __ms_is_dcm_supported(void)
{
bool isFaceRecognitionSupported = false; /* face_recognition feature supported */
int dcm_service_mode = -1; /* media-content-config:dcm_activation */
return (isFaceRecognitionSupported && (dcm_service_mode == 1)) ? true : false;
}
+static bool __ms_is_external_supported(void)
+{
+ bool support = false;
+
+ int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/storage.external", &support);
+ if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+ MS_DBG_ERR("SYSTEM_INFO_ERROR: storage.external [%d]", nRetVal);
+ return false;
+ }
+
+ return support;
+}
+