#include <FIoFile.h>
#include <FSclReminder.h>
#include <FApp_AppInfo.h>
+#include <FIo_FileImpl.h>
#include "FScl_ReminderImpl.h"
using namespace Tizen::Base;
result
Reminder::SetSoundFile(const String& filePath)
{
- if (!filePath.IsEmpty())
+ String tmpFilePath;
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
{
- SysTryReturnResult(NID_SCL, File::IsFileExist(filePath), E_INVALID_ARG
+ _FileImpl::ConvertVirtualToPhysicalPath(filePath, tmpFilePath);
+ }
+ else
+ {
+ tmpFilePath = filePath;
+ }
+
+ if (!tmpFilePath.IsEmpty())
+ {
+ SysTryReturnResult(NID_SCL, File::IsFileExist(tmpFilePath), E_INVALID_ARG
, "Invalid argument is used. The length of the filePath exceeds the maximum length or the file path is invalid or the file does not exist.");
}
- __soundFilePath = filePath;
+ __soundFilePath = tmpFilePath;
return E_SUCCESS;
}
#include <FSclContact.h>
#include <FApp_AppInfo.h>
#include <FBase_StringConverter.h>
+#include <FIo_FileImpl.h>
#include "FScl_ContactDbConnector.h"
#include "FScl_PhoneNumberImpl.h"
#include "FScl_ContactImpl.h"
{
SysTryReturn(NID_SCL, filePath.IsEmpty() || File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[%s] The specified file is not found.", GetErrorMessage(E_FILE_NOT_FOUND));
+ String thumbnailPath;
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ _FileImpl::ConvertVirtualToPhysicalPath(filePath, thumbnailPath);
+ }
+ else
+ {
+ thumbnailPath = filePath;
+ }
+
int ret = CONTACTS_ERROR_NONE;
unsigned int count = 0;
contacts_record_h imageHandle = null;
contacts_record_get_child_record_count(__contactHandle, _contacts_contact.image, &count);
if (count > 0)
{
- if (!filePath.IsEmpty())
+ if (!thumbnailPath.IsEmpty())
{
- std::unique_ptr<char[]> pCharArray( _StringConverter::CopyToCharArrayN(filePath));
+ std::unique_ptr<char[]> pCharArray( _StringConverter::CopyToCharArrayN(thumbnailPath));
SysTryReturnResult(NID_SCL, pCharArray != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
bool isDefault = false;
}
else
{
- if (!filePath.IsEmpty())
+ if (!thumbnailPath.IsEmpty())
{
- std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(filePath));
+ std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(thumbnailPath));
SysTryReturnResult(NID_SCL, pCharArray != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
int ret = contacts_record_create(_contacts_image._uri, &imageHandle);
case CONTACT_PROPERTY_ID_RINGTONE:
{
- if (!value.IsEmpty() && !File::IsFileExist(value))
+ String ringtonePath;
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ _FileImpl::ConvertVirtualToPhysicalPath(value, ringtonePath);
+ }
+ else
+ {
+ ringtonePath = value;
+ }
+
+ if (!ringtonePath.IsEmpty() && !File::IsFileExist(ringtonePath))
{
SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The specified ringtone file does not exist.", GetErrorMessage(E_INVALID_ARG));
return E_INVALID_ARG;
}
- std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(value));
+ std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(ringtonePath));
contacts_record_set_str(__contactHandle, _contacts_contact.ringtone_path, pCharArray.get());
}