projects
/
profile
/
mobile
/
apps
/
native
/
clock.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a358fe
)
[Timer] Do not deactivate alarm if is already deactivated
50/106450/3
author
Kamil Lipiszko
<k.lipiszko@samsung.com>
Wed, 21 Dec 2016 14:13:49 +0000
(15:13 +0100)
committer
Lukasz Stanislawski
<l.stanislaws@samsung.com>
Wed, 4 Jan 2017 13:14:00 +0000
(
05:14
-0800)
Change-Id: If4434428f8333c13cff78d174c6f393469a9ee05
clock/src/Model/Timer.cpp
patch
|
blob
|
history
diff --git
a/clock/src/Model/Timer.cpp
b/clock/src/Model/Timer.cpp
index
beea864
..
97d34ab
100644
(file)
--- a/
clock/src/Model/Timer.cpp
+++ b/
clock/src/Model/Timer.cpp
@@
-145,6
+145,11
@@
bool Timer::ActivateAlarm(int delay)
bool Timer::DeactivateAlarm()
{
+ if (!alarm_id_) {
+ WRN("No alarm to deactivate");
+ return false;
+ }
+
int ret = alarm_cancel(alarm_id_);
if (ret != ALARM_ERROR_NONE) {
ERR("alarm_cancel failed[%d]: %s", ret, get_error_message(ret));