#include "CTs-platform-permission-common.h"
#include <thumbnail_util.h>
+#include <storage.h>
#define MEDIA_IMAGE_WIDTH 1280
#define MEDIA_IMAGE_HEIGHT 720
-#define SAMPLE_FILE_PATH_1 (ThumbnailGetDataPath("PlatformPermission_test.jpg"))
+#define SAMPLE_FILE_PATH_1 "PlatformPermission_test.jpg"
bool g_bCallbackHit;
bool g_bCallBackHit;
int errorcode;
g_pDataControlMainLoop = NULL;\
}\
}
+
+const char *target_image_source_path = NULL;
+
+/**
+* @function storage_device_cb
+* @description Retrives the internal storage directory and set resource path
+* @parameter int storage_id, storage_type_e type, storage_state_e state, const char* path
+, void* user_data
+* @return bool
+*/
+static bool storage_device_cb(int storage_id, storage_type_e type, storage_state_e state, const char* path, void* user_data)
+{
+ if (type == STORAGE_TYPE_INTERNAL)
+ {
+ target_image_source_path=(char*)calloc(strlen(path)+strlen("/Images/")+strlen(SAMPLE_FILE_PATH_1)+1, sizeof(char));
+ snprintf(target_image_source_path, strlen(path)+strlen("/Images/")+strlen(SAMPLE_FILE_PATH_1)+1,"%s/Images/%s",path,SAMPLE_FILE_PATH_1);
+ FPRINTF("[Line : %d][%s] Thumbnail Image Path : %s\\n", __LINE__, API_NAMESPACE, target_image_source_path);
+ return false;
+ }
+ return true;
+}
+
/**
* @function DataControlTimeout
* @description Called if some callback is not invoked for a particular timeout
FPRINTF("[Line : %d][%s] TEST SUIT start-up: CTs_Platform_Permission_p\\n", __LINE__, API_NAMESPACE);
#endif
TCT_CheckInstalledApp(5, TPK1, TPK2, TPK3, TPK4, TPK5);
+
+ storage_foreach_device_supported(storage_device_cb,NULL);
}
/**
void CTs_platform_permission_thumbnailutil_cleanup(void)
{
#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT clean-up: CTs_Platform_Permission_p\\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] TEST SUIT clean-up: CTs_Platform_Permission_p\\n", __LINE__, API_NAMESPACE);
#endif
- return;
+ if (target_image_source_path)
+ {
+ free(target_image_source_path);
+ target_image_source_path = NULL;
+ }
+ return;
}
//& purpose: checking http://tizen.org/privilege/mediastorage
int nRet = thumbnail_util_create(&stHandleThumbnail);
PRINT_RESULT(THUMBNAIL_UTIL_ERROR_NONE, nRet, "thumbnail_util_create", ThumbnailUtilGetError(nRet));
- nRet = thumbnail_util_set_path(stHandleThumbnail, SAMPLE_FILE_PATH_1);
+ nRet = thumbnail_util_set_path(stHandleThumbnail, target_image_source_path);
PRINT_RESULT(THUMBNAIL_UTIL_ERROR_NONE, nRet, "thumbnail_util_set_path", ThumbnailUtilGetError(nRet));
nRet = thumbnail_util_set_size(stHandleThumbnail, MEDIA_IMAGE_WIDTH, MEDIA_IMAGE_HEIGHT);