2 * Copyright 2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
23 #include <drm_client.h>
24 #include <drm_client_types.h>
27 #include "mf-fs-util.h"
30 int mf_drm_is_converted_fl(char *path)
32 drm_bool_type_e is_allowed = 0;
33 drm_action_type_e action = DRM_IS_FORWARDING_ALLOWED;
34 drm_action_allowed_data_s action_data;
37 memset(&action_data,0x0,sizeof(drm_action_allowed_data_s));
39 SAFE_STRCPY(action_data.file_path, path);
41 ret = drm_is_action_allowed(action,&action_data,&is_allowed);
42 if(DRM_RETURN_SUCCESS == ret && DRM_TRUE == is_allowed){
49 int mf_drm_is_drm_file(const char *file_fullpath)
51 if (file_fullpath == NULL)
52 return MYFILE_ERR_DRM_PERMISSION_DENY;
53 drm_bool_type_e drmFlag = DRM_FALSE;
55 res = drm_is_drm_file(file_fullpath, &drmFlag);
57 if (res == DRM_RETURN_SUCCESS && drmFlag == DRM_TRUE)
60 return MYFILE_ERR_DRM_PERMISSION_DENY;
63 drm_file_mime_type_e mf_drm_check_drm_mime_type(char *mime_type)
65 gchar **result = NULL;
66 if (mime_type != NULL) {
67 result = g_strsplit(mime_type, "/", 0);
68 if (result && *result) {
69 if (g_strcmp0(*result, "audio") == 0) {
71 return MYFILE_DRM_RINGTONE_FILE;
72 } else if (g_strcmp0(*result, "image") == 0) {
74 return MYFILE_DRM_IMAGE_FILE;
77 return MYFILE_DRM_UNKNOW_FILE;
81 return MYFILE_DRM_UNKNOW_FILE;
84 return MYFILE_DRM_UNKNOW_FILE;