From: Szymon Jastrzebski Date: Tue, 30 Jan 2018 14:44:53 +0000 (+0100) Subject: [Alarm][Notification] Synchronously checking access to file X-Git-Tag: submit/tizen/20180427.125243~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0093b9be02b6fbc2c1e1a4515e0586516a8428c;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Alarm][Notification] Synchronously checking access to file This change affects also Alarm module. ACR: http://suprem.sec.samsung.net/jira/browse/TWDAPI-187 Change-Id: Id1758f89a1a2e6be4c56d205c55188637d14e36a Signed-off-by: Szymon Jastrzebski --- diff --git a/src/notification/common_notification.cc b/src/notification/common_notification.cc index 52cc10be..1f824937 100644 --- a/src/notification/common_notification.cc +++ b/src/notification/common_notification.cc @@ -23,6 +23,7 @@ #include "common/filesystem/filesystem_provider.h" #include "common/logger.h" #include "common/scope_exit.h" +#include "common/tools.h" namespace extension { namespace notification { @@ -1080,6 +1081,8 @@ PlatformResult CommonNotification::SetPathFromJson(const picojson::value& noti_v const std::string& value_str = FromJson(noti_obj, key.c_str()); std::string real_path = FilesystemProvider::Create().GetRealPath(value_str); + CHECK_STORAGE_ACCESS_AND_RETURN(real_path); + PlatformResult status = SetImage(noti_handle, type, real_path); CHECK_ERROR(status); } @@ -1314,6 +1317,8 @@ PlatformResult CommonNotification::SetPathsArrayFromJson(const picojson::value& const std::string& text = JsonCast(item); std::string real_path = FilesystemProvider::Create().GetRealPath(text); + CHECK_STORAGE_ACCESS_AND_RETURN(real_path); + PlatformResult status = SetImage(noti_handle, map.at(idx), real_path); CHECK_ERROR(status);