#include <media_info_private.h>
#include <storage.h>
#include <system_info.h>
+
#ifdef _USE_SENIOR_MODE
#include <media_util_private.h>
#endif
char *to_replace_str = NULL;
if (replace == TRUE) { //change User session path to System session path
- ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &find_str);
- if (ret != STORAGE_ERROR_NONE) {
- media_content_error("storage_get_root_directory failed");
+ find_str = g_strdup(MEDIA_ROOT_PATH_INTERNAL_OLD);
+ if (!STRING_VALID(find_str)) {
+ media_content_error("strdup failed");
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
goto ERROR;
}
goto ERROR;
}
- ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &to_replace_str);
- if (ret != STORAGE_ERROR_NONE) {
- media_content_error("storage_get_root_directory failed");
+ to_replace_str = g_strdup(MEDIA_ROOT_PATH_INTERNAL_OLD);
+ if (!STRING_VALID(to_replace_str)) {
+ media_content_error("strdup failed");
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
goto ERROR;
}
#ifdef _USE_TVPD_MODE
snprintf(replace_path, MAX_PATH_LEN, "%s", path);
#else
-
- int ret = MEDIA_CONTENT_ERROR_NONE;
- char *old_internal_path = NULL;
-
- ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &old_internal_path);
- if (ret != STORAGE_ERROR_NONE) {
- media_content_error("storage_get_root_directory failed");
- return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
- }
-
- if (strncmp(path, old_internal_path, strlen(old_internal_path)) == 0) {
+ if (strncmp(path, MEDIA_ROOT_PATH_INTERNAL_OLD, strlen(MEDIA_ROOT_PATH_INTERNAL_OLD)) == 0) {
media_content_sec_debug("Old path[%s]", path);
- snprintf(replace_path, MAX_PATH_LEN, "%s%s", MEDIA_ROOT_PATH_INTERNAL, path + strlen(old_internal_path));
+ snprintf(replace_path, MAX_PATH_LEN, "%s%s", MEDIA_ROOT_PATH_INTERNAL, path + strlen(MEDIA_ROOT_PATH_INTERNAL_OLD));
} else {
snprintf(replace_path, MAX_PATH_LEN, "%s", path);
}
-
- SAFE_FREE(old_internal_path);
#endif
if (!STRING_VALID(replace_path)) {
#ifdef _USE_TVPD_MODE
snprintf(replace_path, MAX_PATH_LEN, "%s", path);
#else
-
- int ret = MEDIA_CONTENT_ERROR_NONE;
- char *old_internal_path = NULL;
-
- ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &old_internal_path);
- if (ret != STORAGE_ERROR_NONE) {
- media_content_error("storage_get_root_directory failed");
- return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
- }
-
if (strncmp(path, MEDIA_ROOT_PATH_INTERNAL, strlen(MEDIA_ROOT_PATH_INTERNAL)) == 0) {
media_content_sec_debug("new path[%s]", path);
- snprintf(replace_path, MAX_PATH_LEN, "%s%s", old_internal_path, path + strlen(MEDIA_ROOT_PATH_INTERNAL));
+ snprintf(replace_path, MAX_PATH_LEN, "%s%s", MEDIA_ROOT_PATH_INTERNAL_OLD, path + strlen(MEDIA_ROOT_PATH_INTERNAL));
} else {
snprintf(replace_path, MAX_PATH_LEN, "%s", path);
}
-
- SAFE_FREE(old_internal_path);
#endif
if (!STRING_VALID(replace_path)) {