[SR][Nabi-se][Nabi_SEN_SE-32480] Unable to select more then one file for attachment...
[apps/core/preloaded/ug-myfile-efl.git] / src / common / file-system / mf-ug-fs-oper.c
index 5257ddb..eb539f2 100644 (file)
@@ -250,7 +250,7 @@ mf_ug_drm_file_mime_type mf_ug_fs_oper_get_drm_type(char *path)
        }
 }
 
-static int __drm_is_action_allowed(const char *path, drm_action_type_e action)
+int mf_ug_fs_oper_drm_is_action_allowed(const char *path, drm_action_type_e action, drm_setas_category_e category)
 {
        drm_bool_type_e is_allowed = 0;
        drm_action_allowed_data_s action_data;
@@ -259,6 +259,8 @@ static int __drm_is_action_allowed(const char *path, drm_action_type_e action)
        memset(&action_data,0x0,sizeof(drm_action_allowed_data_s));
        UG_SAFE_STRCPY(action_data.file_path, path);
 
+       action_data.data = category;
+
        ret = drm_is_action_allowed(action,&action_data,&is_allowed);
        if(DRM_RETURN_SUCCESS == ret && DRM_TRUE == is_allowed){
                return true;
@@ -267,6 +269,22 @@ static int __drm_is_action_allowed(const char *path, drm_action_type_e action)
        }
 }
 
+bool mf_ug_fs_oper_drm_is_valid(const char *path, drm_permission_type_e perm_type)
+{
+       int res = DRM_RETURN_SUCCESS;
+       drm_license_status_e licence_status = DRM_LICENSE_STATUS_UNDEFINED;
+       if (path) {
+               res = drm_get_license_status(path, perm_type, &licence_status);
+       }
+
+       ug_error("res is [%d] licence is [%d]", res, licence_status);
+       if (res == DRM_RETURN_SUCCESS && licence_status == DRM_LICENSE_STATUS_VALID) {
+               return true;
+       } else {
+               return false;
+       }
+
+}
 static bool __mf_ug_fs_oper_exec_drm_filter(ugFsNodeInfo *pnode_info, int option)
 {
        if (pnode_info == NULL) {
@@ -282,7 +300,7 @@ static bool __mf_ug_fs_oper_exec_drm_filter(ugFsNodeInfo *pnode_info, int option
 
        if (option & MF_UG_FILTER_DRM_WITHOUT_FL) {
                fullpath = g_strconcat(pnode_info->path, "/", pnode_info->name, NULL);
-               res = __drm_is_action_allowed(fullpath, DRM_IS_FORWARDING_ALLOWED);
+               res = mf_ug_fs_oper_drm_is_action_allowed(fullpath, DRM_IS_FORWARDING_ALLOWED, DRM_SETAS_NONE);
                if (res == DRM_RETURN_SUCCESS) {
                        return FALSE;
                } else {
@@ -293,7 +311,7 @@ static bool __mf_ug_fs_oper_exec_drm_filter(ugFsNodeInfo *pnode_info, int option
        if (option & MF_UG_FILTER_DRM_IMAGE) {
                fullpath = g_strconcat(pnode_info->path, "/", pnode_info->name, NULL);
 
-               result = __drm_is_action_allowed(fullpath, DRM_HAS_VALID_SETAS_STATUS);
+               result = mf_ug_fs_oper_drm_is_action_allowed(fullpath, DRM_HAS_VALID_SETAS_STATUS, DRM_SETAS_WALLPAPER);
                if (result) {
                        mf_ug_drm_file_mime_type drm_mime_type = mf_ug_fs_oper_get_drm_type(fullpath);
                        if (drm_mime_type == MF_UG_DRM_IMAGE_FILE)
@@ -308,7 +326,7 @@ static bool __mf_ug_fs_oper_exec_drm_filter(ugFsNodeInfo *pnode_info, int option
        if (option & MF_UG_FILTER_DRM_RINGTONE) {
                fullpath = g_strconcat(pnode_info->path, "/", pnode_info->name, NULL);
 
-               result = __drm_is_action_allowed(fullpath, DRM_HAS_VALID_SETAS_STATUS);
+               result = mf_ug_fs_oper_drm_is_action_allowed(fullpath, DRM_HAS_VALID_SETAS_STATUS, DRM_SETAS_RINGTONE);
                if (result) {
                        mf_ug_drm_file_mime_type drm_mime_type = mf_ug_fs_oper_get_drm_type(fullpath);
                        if (drm_mime_type == MF_UG_DRM_RINGTONE_FILE)