From f0093b9be02b6fbc2c1e1a4515e0586516a8428c Mon Sep 17 00:00:00 2001 From: Szymon Jastrzebski Date: Tue, 30 Jan 2018 15:44:53 +0100 Subject: [PATCH] [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 --- src/notification/common_notification.cc | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.34.1