From: Somin Kim Date: Wed, 20 Apr 2016 08:21:05 +0000 (+0900) Subject: Modify notification action behavior related to sound, vibration X-Git-Tag: submit/tizen/20160503.015801^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F66701%2F3;p=platform%2Fcore%2Fcontext%2Fcontext-service.git Modify notification action behavior related to sound, vibration Change-Id: I95f501065cb473d6de011aa2d9fa1fe08a2bcd7a Signed-off-by: Somin Kim --- diff --git a/src/trigger/ActionManager.cpp b/src/trigger/ActionManager.cpp index 5db4ddd..f0e50fc 100644 --- a/src/trigger/ActionManager.cpp +++ b/src/trigger/ActionManager.cpp @@ -139,34 +139,25 @@ void __triggerActionNotification(ctx::Json& action, std::string pkgId) } } - int status; - bool silent = true; - error = vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &status); + int soundOn = 0; + error = vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &soundOn); if (error < 0) { _E("vconf error (%d)", error); - } else { - silent = (status == 0); + } else if (soundOn) { + error = notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL); + if (error != NOTIFICATION_ERROR_NONE) { + _E("Set notification sound failed(%d)", error); + } } - bool vibration = true; - error = vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &status); + int vibrationOn = 0; + error = vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibrationOn); if (error < 0) { _E("vconf error (%d)", error); - } else { - vibration = (status != 0); - } - - if (!silent) { - error = notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL); + } else if (vibrationOn) { + error = notification_set_vibration(notification, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL); if (error != NOTIFICATION_ERROR_NONE) { - _E("Set notification sound failed(%d)", error); - } - - if (vibration) { - error = notification_set_vibration(notification, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL); - if (error != NOTIFICATION_ERROR_NONE) { - _E("Set notification vibration failed(%d)", error); - } + _E("Set notification vibration failed(%d)", error); } }