summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhj kim <backto.kim@samsung.com>2020-03-24 06:51:51 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2020-03-24 06:51:51 +0000
commit1ffa517587a40b9476033c5c9d889e863db92f2d (patch)
treeee27bc740b5ec9f047a2accf5c85b110ac6da3b5 /src
parent509e5ffcc96f4adc5278b3eaa15328e213d7f69b (diff)
parent9a3580d2e410a3b91567995b2afb082e940dd05b (diff)
downloadmedia-content-1ffa517587a40b9476033c5c9d889e863db92f2d.tar.gz
media-content-1ffa517587a40b9476033c5c9d889e863db92f2d.tar.bz2
media-content-1ffa517587a40b9476033c5c9d889e863db92f2d.zip
Merge "Block path replacement(temporary)" into tizen
Diffstat (limited to 'src')
-rwxr-xr-xsrc/media_filter.c15
-rwxr-xr-xsrc/media_util_private.c15
2 files changed, 21 insertions, 9 deletions
diff --git a/src/media_filter.c b/src/media_filter.c
index 8ca675f..6b91c16 100755
--- a/src/media_filter.c
+++ b/src/media_filter.c
@@ -209,6 +209,14 @@ int media_filter_set_condition(filter_h filter, const char *condition, media_con
SAFE_FREE(_filter->condition);
_filter->condition = _media_content_replace_path_in_condition(condition);
+
+ /* FIXME
+ If an error is occured in _media_content_replace_path_in_condition(),
+ A suitable return value is 'MEDIA_CONTENT_ERROR_INVALID_OPERATION'.
+ However, it is not stated in the description of media_filter_set_condition().
+ Therefore, use 'MEDIA_CONTENT_ERROR_OUT_OF_MEMORY' temporarily.
+ It will be modified after removing _media_content_replace_path_in_condition() function.
+ */
media_content_retvm_if(_filter->condition == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "Fail to _media_content_replace_path_in_condition");
media_content_sec_debug("Condition string : %s", _filter->condition);
@@ -363,6 +371,13 @@ int media_filter_set_condition_v2(filter_h filter, const char *condition)
if (STRING_VALID(_filter->condition))
SAFE_FREE(_filter->condition);
+ /* FIXME
+ If an error is occured in _media_content_replace_path_in_condition(),
+ A suitable return value is 'MEDIA_CONTENT_ERROR_INVALID_OPERATION'.
+ However, it is not stated in the description of media_filter_set_condition().
+ Therefore, use 'MEDIA_CONTENT_ERROR_OUT_OF_MEMORY' temporarily.
+ It will be modified after removing _media_content_replace_path_in_condition() function.
+ */
_filter->condition = _media_content_replace_path_in_condition(condition);
media_content_retvm_if(_filter->condition == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "Fail to _media_content_replace_path_in_condition");
diff --git a/src/media_util_private.c b/src/media_util_private.c
index e8a226e..ef337ad 100755
--- a/src/media_util_private.c
+++ b/src/media_util_private.c
@@ -330,11 +330,11 @@ int _media_content_check_dir(const char *path)
}
+/* FIXME : If there are no issue reports related to this, it will be deleted in tizen 6.5 or after. */
char * _media_content_replace_path_in_condition(const char *condition)
{
-#ifdef _USE_TVPD_MODE
return g_strdup(condition);
-#else
+#if 0
char **split_list = NULL;
char *result = NULL;
@@ -354,11 +354,13 @@ char * _media_content_replace_path_in_condition(const char *condition)
#endif
}
+/* FIXME : If there are no issue reports related to this, it will be deleted in Tizen 6.5 or after. */
int _media_content_replace_path(const char *path, char *replace_path)
{
-#ifdef _USE_TVPD_MODE
+ media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid path");
+
snprintf(replace_path, MAX_PATH_LEN, "%s", path);
-#else
+#if 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(MEDIA_ROOT_PATH_INTERNAL_OLD));
@@ -367,11 +369,6 @@ int _media_content_replace_path(const char *path, char *replace_path)
}
#endif
- if (!STRING_VALID(replace_path)) {
- media_content_error("replace failed");
- return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
- }
-
return MEDIA_CONTENT_ERROR_NONE;
}