return err;
}
-static char* _media_thumb_mmc_get_path(uid_t uid)
-{
- int ret = 0;
- char *result_path = NULL;
-
- ret = tzplatform_set_user(uid);
- if (ret != 0) {
- thumb_err("Invalid UID[%d]", uid);
- return NULL;
- } else {
- const char *result = tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/mmc");
- result_path = strndup(result, strlen(result));
- tzplatform_reset_user();
- }
-
- return result_path;
-}
-
-static char* _media_thumb_phone_get_path(uid_t uid)
-{
- int ret = 0;
- char *result_path = NULL;
-
- ret = tzplatform_set_user(uid);
- if (ret != 0) {
- thumb_err("Invalid UID[%d]", uid);
- return NULL;
- } else {
- const char *result = tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/phone");
- result_path = strndup(result, strlen(result));
- tzplatform_reset_user();
- }
-
- return result_path;
-}
-
int _media_thumb_get_hash_name(const char *file_full_path,
char *thumb_hash_path, size_t max_thumb_path, uid_t uid)
{
char *get_path = NULL;
int ret_len = 0;
ms_user_storage_type_t store_type = -1;
- int ret = 0;
+ int ret = MS_MEDIA_ERR_NONE;
if (file_full_path == NULL || thumb_hash_path == NULL || max_thumb_path <= 0) {
thumb_err("file_full_path==NULL || thumb_hash_path == NULL || max_thumb_path <= 0");
}
if (store_type == MS_USER_STORAGE_INTERNAL) {
- get_path = _media_thumb_phone_get_path(uid);
+ ret = ms_user_get_default_thumb_store_path(uid, &get_path);
if (get_path != NULL)
ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name);
} else if (store_type == MS_USER_STORAGE_EXTERNAL) {
- get_path = _media_thumb_mmc_get_path(uid);
+ ret = ms_user_get_mmc_thumb_store_path(uid, &get_path);
if (get_path != NULL)
ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name);
} else {
- get_path = _media_thumb_phone_get_path(uid);
+ ret = ms_user_get_default_thumb_store_path(uid, &get_path);
if (get_path != NULL)
ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name);
}