result
Reminder::SetSoundFile(const String& filePath)
{
- String tmpFilePath;
- if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ if (filePath.IsEmpty())
{
- _FileImpl::ConvertVirtualToPhysicalPath(filePath, tmpFilePath);
+ __soundFilePath.Clear();
}
else
{
- tmpFilePath = filePath;
- }
+ result r = E_SUCCESS;
+ String tmpFilePath;
+
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ r = _FileImpl::ConvertVirtualToPhysicalPath(filePath, tmpFilePath);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used.", GetErrorMessage(E_INVALID_ARG));
+ }
+ 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.");
- }
+ , "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 = tmpFilePath;
+ __soundFilePath = tmpFilePath;
+ }
return E_SUCCESS;
}
}
String thumbnailPath(pCharValue);
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ _FileImpl::ConvertPhysicalToVirtualPath(pCharValue, thumbnailPath);
+ }
Image image;
- result r = image.Construct();
- SysTryReturn(NID_SCL, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Failed to construct Image.", GetErrorMessage(E_SYSTEM));
+ result r = image.Construct();
+ SysTryReturn(NID_SCL, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Failed to construct Image.", GetErrorMessage(E_SYSTEM));
ImageFormat imageFormat = image.GetImageFormat(thumbnailPath);
- SysTryReturn(NID_SCL, GetLastResult() != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, GetLastResult() != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
SysTryReturn(NID_SCL, GetLastResult() == E_SUCCESS, null, E_SYSTEM, "[%s] Failed to get the format of the thumbnail image.", GetErrorMessage(E_SYSTEM));
BitmapPixelFormat bitmapPixelFormat = BITMAP_PIXEL_FORMAT_RGB565;
case CONTACT_PROPERTY_ID_RINGTONE:
{
+ SysTryReturn(NID_SCL, value.IsEmpty() || File::IsFileExist(value), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used.", GetErrorMessage(E_INVALID_ARG));
+
String ringtonePath;
if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
{
- _FileImpl::ConvertVirtualToPhysicalPath(value, ringtonePath);
+ if (!value.IsEmpty())
+ {
+ result r = _FileImpl::ConvertVirtualToPhysicalPath(value, ringtonePath);
+ SysTryReturn(NID_SCL, r != E_INVALID_ARG, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used.", GetErrorMessage(E_INVALID_ARG));
+ }
}
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(ringtonePath));
contacts_record_set_str(__contactHandle, _contacts_contact.ringtone_path, pCharArray.get());