From 034edcbf8e48eb1b90510fbc8c8420a02bb183fa Mon Sep 17 00:00:00 2001 From: JungYumin Date: Thu, 18 Apr 2013 18:40:54 +0900 Subject: [PATCH] Applied secure log for privacy protect Change-Id: Ib2341d47384c667229c1b9ef336218c43452a728 Signed-off-by: JungYumin --- src/FMedia_AudioRecorderImpl.cpp | 8 ++++---- src/FMedia_CameraImpl.cpp | 8 ++++---- src/FMedia_CapabilityImpl.cpp | 4 ++-- src/FMedia_PlayerImpl.cpp | 2 +- src/FMedia_RecorderUtil.cpp | 8 ++++---- src/FMedia_VideoFrameExtractorImpl.cpp | 2 +- src/FMedia_VideoRecorderImpl.cpp | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/FMedia_AudioRecorderImpl.cpp b/src/FMedia_AudioRecorderImpl.cpp index 992ea40..63c304c 100755 --- a/src/FMedia_AudioRecorderImpl.cpp +++ b/src/FMedia_AudioRecorderImpl.cpp @@ -306,15 +306,15 @@ _AudioRecorderImpl::CreateAudioFile(const Tizen::Base::String& mediaLocalPath, b std::unique_ptr pFileName (_StringConverter::CopyToCharArrayN(mediaLocalPath)); SysTryCatch(NID_MEDIA, pFileName.get() != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Propagating.", GetErrorMessage(E_INVALID_ARG)); - SysLog(NID_MEDIA, "File Path : %s\n, overwrite:%d", pFileName.get(), overwrite); + SysSecureLog(NID_MEDIA, "File Path : %s\n, overwrite:%d", pFileName.get(), overwrite); r = _RecorderUtil::PrepareFile(mediaLocalPath, overwrite); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] audio recorder prepare file failed. mediaLocalPath:%s, overwirte:%d", + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] audio recorder prepare file failed. mediaLocalPath:%s, overwirte:%d", GetErrorMessage(r), pFileName.get(), overwrite); err = recorder_set_filename(__handle, pFileName.get()); r = ConvertResult(err); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] audio recorder set attribute failed. mediaLocalPath:%s", GetErrorMessage(r), pFileName.get()); + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] audio recorder set attribute failed. mediaLocalPath:%s", GetErrorMessage(r), pFileName.get()); SetState(RECORDER_STATE_OPENED); @@ -515,7 +515,7 @@ _AudioRecorderImpl::SetMaxRecordingTime(long msTime) secTime = msTime > 1000 ? ((msTime+500) / 1000) : 1; err = recorder_attr_set_time_limit(__handle, secTime); r = ConvertResult(err); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] audio recorder set attribute failed. msTime:%ls", GetErrorMessage(r), msTime); + SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] audio recorder set attribute failed. msTime:%d", GetErrorMessage(r), msTime); // For reload and Get the exact value __maxTime = msTime; diff --git a/src/FMedia_CameraImpl.cpp b/src/FMedia_CameraImpl.cpp index a4c66ba..37fbafa 100755 --- a/src/FMedia_CameraImpl.cpp +++ b/src/FMedia_CameraImpl.cpp @@ -1825,20 +1825,20 @@ _CameraImpl::SetExifGpsCoordinates(double latitude, double longitude, float alti result r = E_SUCCESS; CameraState state = CAMERA_STATE_ERROR; int err = MM_SUCCESS; - SysLog(NID_MEDIA, "Enter. latitude:%f, longitude:%f, altitude:%f", latitude, longitude, altitude); + SysSecureLog(NID_MEDIA, "Enter. latitude:%f, longitude:%f, altitude:%f", latitude, longitude, altitude); state = GetState(); SysTryReturn(NID_MEDIA, state == CAMERA_STATE_INITIALIZED || state == CAMERA_STATE_PREVIEW || state == CAMERA_STATE_CAPTURED , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Camera is in an invalid state. This method is not working in this state. Current state is :%d", state); - SysTryCatch(NID_MEDIA, -90.0 <= latitude && latitude <= 90.0 , r = E_OUT_OF_RANGE, r, "[E_OUT_OF_RANGE] This latitude(%f) is out of range.", latitude); - SysTryCatch(NID_MEDIA, -180.0 <= longitude && longitude <= 180.0 , r = E_OUT_OF_RANGE, r, "[E_OUT_OF_RANGE] This longitude(%f) is out of range.", longitude); + SysSecureTryCatch(NID_MEDIA, -90.0 <= latitude && latitude <= 90.0 , r = E_OUT_OF_RANGE, r, "[E_OUT_OF_RANGE] This latitude(%f) is out of range.", latitude); + SysSecureTryCatch(NID_MEDIA, -180.0 <= longitude && longitude <= 180.0 , r = E_OUT_OF_RANGE, r, "[E_OUT_OF_RANGE] This longitude(%f) is out of range.", longitude); if ( __isPoweredOn ) { err = camera_attr_set_geotag(__handle, latitude, longitude, (double)altitude); r = ConvertResult(err); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. latitude:%f, longitude:%f, altitude:%f", GetErrorMessage(r), latitude, longitude, altitude); + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. latitude:%f, longitude:%f, altitude:%f", GetErrorMessage(r), latitude, longitude, altitude); } __exifLatitude = latitude; __exifLongitude = longitude; diff --git a/src/FMedia_CapabilityImpl.cpp b/src/FMedia_CapabilityImpl.cpp index f9227e2..0faa30f 100755 --- a/src/FMedia_CapabilityImpl.cpp +++ b/src/FMedia_CapabilityImpl.cpp @@ -130,10 +130,10 @@ _CapabilityImpl::Construct(void) __pMap.reset(pMap.release()); - SysLog(NID_MEDIA, "Capability XML path:%ls", mediaCapabilityFilePath.GetPointer()); + SysSecureLog(NID_MEDIA, "Capability XML path:%ls", mediaCapabilityFilePath.GetPointer()); r = File::GetAttributes( mediaCapabilityFilePath, attributes); - SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating. File path is %ls", GetErrorMessage(r), mediaCapabilityFilePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating. File path is %ls", GetErrorMessage(r), mediaCapabilityFilePath.GetPointer()); length = attributes.GetFileSize(); SysTryReturn(NID_MEDIA, length > 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating."); diff --git a/src/FMedia_PlayerImpl.cpp b/src/FMedia_PlayerImpl.cpp index f3ae16f..ccaf8b0 100644 --- a/src/FMedia_PlayerImpl.cpp +++ b/src/FMedia_PlayerImpl.cpp @@ -461,7 +461,7 @@ _PlayerImpl::OpenFile(const Tizen::Base::String& mediaLocalPath, bool isAsync) pInputFilePath.reset(_StringConverter::CopyToCharArrayN(mediaLocalPath)); SysTryCatch(NID_MEDIA, pInputFilePath.get() , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. pInputFilePath is null"); - SysLog(NID_MEDIA, "Input file path after conversion is [%s]", pInputFilePath.get()); + SysSecureLog(NID_MEDIA, "Input file path after conversion is [%s]", pInputFilePath.get()); __preState = __currentState; __currentState = PLAYER_STATE_OPENING; diff --git a/src/FMedia_RecorderUtil.cpp b/src/FMedia_RecorderUtil.cpp index cc09d45..d2d9ae3 100755 --- a/src/FMedia_RecorderUtil.cpp +++ b/src/FMedia_RecorderUtil.cpp @@ -530,12 +530,12 @@ _RecorderUtil::PrepareFile(const Tizen::Base::String& path, bool overwrite) if (overwrite) { r = File::Remove(path); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] camcorder remove existing file failed. path:%ls", GetErrorMessage(r), path.GetPointer()); + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] camcorder remove existing file failed. path:%ls", GetErrorMessage(r), path.GetPointer()); } else { r = E_FILE_ALREADY_EXIST; - SysLogException(NID_MEDIA, r, "[E_FILE_ALREADY_EXIST] The file already exists and overwrite is false. path:%ls", path.GetPointer()); + SysSecureLogException(NID_MEDIA, r, "[E_FILE_ALREADY_EXIST] The file already exists and overwrite is false. path:%ls", path.GetPointer()); goto CATCH; } } @@ -543,9 +543,9 @@ _RecorderUtil::PrepareFile(const Tizen::Base::String& path, bool overwrite) { File file; r = file.Construct(path, L"w"); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, r = E_RESOURCE_UNAVAILABLE, E_RESOURCE_UNAVAILABLE, "[E_RESOURCE_UNAVAILABLE] The file path is not available. path:%ls", path.GetPointer()); + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, r = E_RESOURCE_UNAVAILABLE, E_RESOURCE_UNAVAILABLE, "[E_RESOURCE_UNAVAILABLE] The file path is not available. path:%ls", path.GetPointer()); r = File::Remove(path); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] camcorder remove temp file failed. path:%ls", GetErrorMessage(r), path.GetPointer()); + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] camcorder remove temp file failed. path:%ls", GetErrorMessage(r), path.GetPointer()); } return r; diff --git a/src/FMedia_VideoFrameExtractorImpl.cpp b/src/FMedia_VideoFrameExtractorImpl.cpp index 11e60c4..bde0d05 100644 --- a/src/FMedia_VideoFrameExtractorImpl.cpp +++ b/src/FMedia_VideoFrameExtractorImpl.cpp @@ -105,7 +105,7 @@ _VideoFrameExtractorImpl::Construct(const Tizen::Base::String &filePath, MediaPi SysTryReturn(NID_MEDIA, !filePath.IsEmpty(), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] path is empty"); - SysTryReturn(NID_MEDIA, Tizen::Io::File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryReturn(NID_MEDIA, Tizen::Io::File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] File is not Found: %ls",filePath.GetPointer()); SysTryReturn(NID_MEDIA, pixelFormat > MEDIA_PIXEL_FORMAT_NONE && pixelFormat < MEDIA_PIXEL_FORMAT_GRAY, diff --git a/src/FMedia_VideoRecorderImpl.cpp b/src/FMedia_VideoRecorderImpl.cpp index 2273e0a..00af106 100755 --- a/src/FMedia_VideoRecorderImpl.cpp +++ b/src/FMedia_VideoRecorderImpl.cpp @@ -364,10 +364,10 @@ _VideoRecorderImpl::CreateVideoFile(const Tizen::Base::String& mediaLocalPath, b std::unique_ptr pFileName (_StringConverter::CopyToCharArrayN(mediaLocalPath)); SysTryCatch(NID_MEDIA, pFileName.get() != null, r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(mediaLocalPath) is used. File name is null."); - SysLog(NID_MEDIA, "File Path : %s\n, overwrite:%d", pFileName.get(), overwrite); + SysSecureLog(NID_MEDIA, "File Path : %s\n, overwrite:%d", pFileName.get(), overwrite); r = _RecorderUtil::PrepareFile(mediaLocalPath, overwrite); - SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] camcorder prepare file failed. mediaLocalPath:%s, overwirte:%d", + SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] camcorder prepare file failed. mediaLocalPath:%s, overwirte:%d", GetErrorMessage(r), pFileName.get(), overwrite); err = recorder_set_filename(__handle, pFileName.get()); @@ -1661,7 +1661,7 @@ _VideoRecorderImpl::ReloadConfiguration(int reload) int err = MM_SUCCESS; std::unique_ptr pFileName (Tizen::Base::_StringConverter::CopyToCharArrayN(__filePath)); SysTryCatch(NID_MEDIA, pFileName.get() != null, r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(__filePath) is used. File name is null."); - SysLog(NID_MEDIA, "File Path : %s\n", pFileName.get()); + SysSecureLog(NID_MEDIA, "File Path : %s\n", pFileName.get()); err = recorder_set_filename(__handle, pFileName.get()); r = ConvertResult(err); -- 2.7.4