}
}
-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;
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;
}
}
+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) {
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 {
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)
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)