Use common API in dcm service 07/130307/1
authorHaejeong Kim <backto.kim@samsung.com>
Mon, 22 May 2017 01:38:53 +0000 (10:38 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Mon, 22 May 2017 01:38:53 +0000 (10:38 +0900)
Change-Id: Iafa667dfcb3d620e30be58497dd4c61ee948d825

lib/media-util-dcm.c

index 3211f6c..4651bac 100755 (executable)
@@ -61,11 +61,6 @@ enum {
        DCM_REQUEST_CANCEL_FACE,
 };
 
-typedef enum {
-       DCM_PHONE,                      /**< Stored only in phone */
-       DCM_MMC                         /**< Stored only in MMC */
-} media_dcm_store_type;
-
 extern char MEDIA_IPC_PATH[][70];
 
 int __media_dcm_check_req_queue(const char *path);
@@ -277,19 +272,6 @@ int __media_dcm_pop_manage_queue(const unsigned int request_id, const char *path
        return MS_MEDIA_ERR_NONE;
 }
 
-int __media_dcm_get_store_type_by_path(const char *full_path)
-{
-       if (full_path != NULL && MEDIA_ROOT_PATH_INTERNAL != NULL && MEDIA_ROOT_PATH_SDCARD != NULL) {
-               if (strncmp(full_path, MEDIA_ROOT_PATH_INTERNAL, strlen(MEDIA_ROOT_PATH_INTERNAL)) == 0) {
-                       return DCM_PHONE;
-               } else if (strncmp(full_path, MEDIA_ROOT_PATH_SDCARD, strlen(MEDIA_ROOT_PATH_SDCARD)) == 0) {
-                       return DCM_MMC;
-               }
-       }
-
-       return -1;
-}
-
 int _media_dcm_send_request()
 {
        int err = MS_MEDIA_ERR_NONE;
@@ -572,10 +554,10 @@ int dcm_request_extract_face_async(const unsigned int request_id, const char *pa
 
        MSAPI_DBG("Path : %s", path);
 
-       int store_type = -1;
-       store_type = __media_dcm_get_store_type_by_path(path);
+       ms_user_storage_type_t storage_type = -1;
+       storage_type = ms_user_get_storage_type(uid, path, &storage_type);
 
-       if ((store_type != DCM_PHONE) && (store_type != DCM_MMC)) {
+       if ((storage_type != MS_USER_STORAGE_INTERNAL) && (storage_type != MS_USER_STORAGE_EXTERNAL)) {
                MSAPI_DBG_ERR("The path(%s) is invalid", path);
                return MS_MEDIA_ERR_INVALID_PARAMETER;
        }