Remove function for rollback path 48/186348/1 accepted/tizen/unified/20180813.061449 submit/tizen/20180810.064017
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 9 Aug 2018 05:51:35 +0000 (14:51 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 9 Aug 2018 05:51:35 +0000 (14:51 +0900)
Code modification according to policy change
 - return path
 - path for notification

Change-Id: Ie7e620718cd55369d5a59ee28080f647fbb60e87
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
lib/include/media-util.h
lib/include/private.h
lib/media-util-noti-internal.c

index 152acae..6ea0d99 100755 (executable)
 #endif
 
 #ifdef _USE_SENIOR_MODE
-#define MEDIA_CONTENT_PATH             "content"               /**<  user content folder name*/
-#else
-#define MEDIA_CONTENT_PATH             "media"         /**<  user content folder name*/
-#endif
-#ifdef _USE_SENIOR_MODE
 #define MEDIA_ROOT_PATH_SENIOR_MODE "/opt/familytv"
 #endif
 
index 50e8ed3..5bc01ac 100755 (executable)
@@ -64,6 +64,4 @@ static inline tizen_profile_t _get_tizen_profile()
        return profile;
 }
 
-#define _USE_TV_PATH   (_get_tizen_profile() == TIZEN_PROFILE_TV)
-
 #endif /* _MEDIA_SERVER_PRIVATE_H_ */
index bd4d973..f1901e2 100755 (executable)
@@ -60,11 +60,7 @@ int media_db_update_send_internal(int pid, /* mandatory */
        GVariant *message = NULL;
        GDBusConnection *bus = NULL;
        GError *error = NULL;
-       char repl_path[MAX_FILEPATH_LEN] = {0, };
-#if !defined(_USE_SENIOR_MODE)
-       char *tmp_path = NULL;
-       const char *old_path = "/opt/usr/media";
-#endif
+
        bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
        if (!bus) {
                MSAPI_DBG("Failed to get gdbus connection: %s", error->message);
@@ -72,29 +68,11 @@ int media_db_update_send_internal(int pid, /* mandatory */
                return MS_MEDIA_ERR_INTERNAL;
        }
 
-       memset(repl_path, 0, sizeof(repl_path));
-#if !defined(_USE_SENIOR_MODE)
-       if (!_USE_TV_PATH) {
-               /* Need uid to change path */
-               if (strncmp(path, "/opt/usr/home", strlen("/opt/usr/home")) == 0) {
-                       tmp_path = strstr(path, MEDIA_CONTENT_PATH);
-                       snprintf(repl_path, sizeof(repl_path), "%s%s", old_path, tmp_path + strlen(MEDIA_CONTENT_PATH));
-               } else {
-                       snprintf(repl_path, sizeof(repl_path), "%s", path);
-               }
-
-               MSAPI_DBG("New path: [%s]", repl_path);
-       } else
-#endif
-       {
-               snprintf(repl_path, sizeof(repl_path), "%s", path);
-       }
-
        if (item == MS_MEDIA_ITEM_FILE) {
                MSAPI_DBG("FILE CHANGED");
                if (uuid != NULL && mime_type != NULL) {
                        /* fill all datas */
-                       message = g_variant_new("(iiissis)", item, pid, update_type, repl_path, uuid, media_type, mime_type);
+                       message = g_variant_new("(iiissis)", item, pid, update_type, path, uuid, media_type, mime_type);
                } else {
                        MSAPI_DBG_ERR("uuid or mime_type is NULL");
                        return MS_MEDIA_ERR_INVALID_PARAMETER;
@@ -103,9 +81,9 @@ int media_db_update_send_internal(int pid, /* mandatory */
                MSAPI_DBG("DIRECTORY CHANGED");
                /* fill all datas */
                if (uuid != NULL)
-                       message = g_variant_new("(iiiss)", item, pid, update_type, repl_path, uuid);
+                       message = g_variant_new("(iiiss)", item, pid, update_type, path, uuid);
                else
-                       message = g_variant_new("(iiis)", item, pid, update_type, repl_path);
+                       message = g_variant_new("(iiis)", item, pid, update_type, path);
        } else {
                MSAPI_DBG("this request is wrong");
        }