From dd45168bde76db485e36a7da8bd780993e94908a Mon Sep 17 00:00:00 2001
From: =?utf8?q?Piotr=20Kosko/Native/Web=20API=20=28PLT=29=20/SRPOL/Profess?=
=?utf8?q?ional/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?=
Date: Mon, 5 Aug 2019 07:53:03 +0200
Subject: [PATCH] [Alarm] Fixed the behaviour change introduced during SVACE
issues fixing
[Bug] Issue was introduced in commit 1b4d5c8e8e760140c3e5c93e59ff23bde99f9862
https://review.tizen.org/gerrit/#/c/platform/core/api/webapi-plugins/+/207226/
Alarm TCT - 12 fails
[Verification] Alarm TCT after fix - 100% (tizen-unified_20190804.1_mobile-wayland-armv7l-tm1)
Change-Id: I343bf2d20d2f88f6d3ac37eb2631a0db395daecb
---
src/alarm/alarm_manager.cc | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/alarm/alarm_manager.cc b/src/alarm/alarm_manager.cc
index db2e035..d90bdcd 100644
--- a/src/alarm/alarm_manager.cc
+++ b/src/alarm/alarm_manager.cc
@@ -551,13 +551,11 @@ PlatformResult AlarmManager::GetAlarm(int id, picojson::object& obj) {
notification_free(notification_handle);
};
- ret = alarm_get_app_control(id, &app_control);
- if (ALARM_ERROR_NONE != ret) {
- return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Unknown error occurred.",
- ("Getting data failed: %d (%s)", ret, get_error_message(ret)));
- } else {
- ret = alarm_get_notification(id, ¬ification_handle);
- if (ALARM_ERROR_NONE != ret) {
+ if (ALARM_ERROR_NONE != alarm_get_app_control(id, &app_control)) {
+ // This is a special kind of alarm, which has the notification instead of an app_control handle.
+ // In case of error during app_control gathering, we check if it has notification. If both calls
+ // end with error, then we report NOT_FOUND_ERROR
+ if (ALARM_ERROR_NONE != alarm_get_notification(id, ¬ification_handle)) {
return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Alarm not found.",
("Alarm not found: %d (%s)", ret, get_error_message(ret)));
} else {
--
2.7.4