2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FSys_SettingSoundProvider.cpp
19 * @brief This is the implementation for the _SettingSoundProvider class.
22 #include <FBase_StringConverter.h>
26 #include <FBaseSysLog.h>
29 #include "FSys_SettingInfo.h"
30 #include "FSys_SettingSoundProvider.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Utility;
35 using namespace Tizen::Io;
37 namespace Tizen { namespace System
39 static const wchar_t* _SOUND_MEDIA_VOLUME = L"http://tizen.org/setting/sound.media.volume";
40 static const wchar_t* _SOUND_NOTIFICATION = L"http://tizen.org/setting/sound.notification";
41 static const wchar_t* _SOUND_NOTIFICATION_REPEAT_PERIOD = L"http://tizen.org/setting/sound.notification.repetition_period";
42 static const wchar_t* _SOUND_NOTIFICATION_REPEAT_PERIOD_ONCE = L"once";
43 static const wchar_t* _SOUND_NOTIFICATION_REPEAT_PERIOD_2MIN = L"2min";
44 static const wchar_t* _SOUND_NOTIFICATION_REPEAT_PERIOD_5MIN = L"5min";
45 static const wchar_t* _SOUND_NOTIFICATION_REPEAT_PERIOD_10MIN = L"10min";
46 static const wchar_t* _SOUND_NOTIFICATION_VOLUME = L"http://tizen.org/setting/sound.notification.volume";
47 static const wchar_t* _SOUND_RINGTONE_VOLUME = L"http://tizen.org/setting/sound.ringtone.volume";
48 static const wchar_t* _SOUND_SYSTEM_VOLUME = L"http://tizen.org/setting/sound.system.volume";
50 static const wchar_t* _SOUND_RINGTONE = L"http://tizen.org/setting/sound.ringtone";
51 static const wchar_t* _SOUND_SILENTMODE = L"http://tizen.org/setting/sound.silent_mode";
52 static const wchar_t* _SOUND_TOUCH = L"http://tizen.org/setting/sound.touch";
53 static const wchar_t* _SOUND_LOCK = L"http://tizen.org/setting/sound.lock";
55 _SettingSoundProvider::_SettingSoundProvider()
57 int errorCode = sound_manager_set_volume_changed_cb(SettingEventSoundManager, null);
60 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register volume event listener.");
63 errorCode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, SettingEventSettingInfo, null);
66 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register ringtone event listener.");
69 errorCode = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, SettingEventRuntimeInfo, null);
72 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register silent mode event listener.");
75 errorCode = vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SettingEventVConf, null);
78 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL event listener.");
81 errorCode = vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SettingEventVConf, null);
84 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT event listener.");
87 errorCode = vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SettingEventVConf, null);
90 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register VCONFKEY_SETAPPL_SOUND_LOCK_BOOL event listener.");
93 errorCode = vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SettingEventVConf, null);
96 SysLogException(NID_SYS, E_SYSTEM, "It is failed to register VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT event listener.");
101 _SettingSoundProvider::~_SettingSoundProvider()
103 sound_manager_unset_volume_changed_cb();
105 int errorCode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE);
108 SysLogException(NID_SYS, E_SYSTEM, "It is failed to unregister ringtone event listener.");
111 errorCode = runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_SILENT_MODE_ENABLED);
114 SysLogException(NID_SYS, E_SYSTEM, "It is failed to unregister silent mode event listener.");
117 errorCode = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, SettingEventVConf);
120 SysLogException(NID_SYS, E_SYSTEM, "It is failed to unregister VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL event listener.");
123 errorCode = vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, SettingEventVConf);
126 SysLogException(NID_SYS, E_SYSTEM, "It is failed to unregister VCONFKEY_SETAPPL_SOUND_LOCK_BOOL event listener.");
129 errorCode = vconf_ignore_key_changed(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SettingEventVConf);
132 SysLogException(NID_SYS, E_SYSTEM, "It is failed to unregister VCONFKEY_SETAPPL_SOUND_LOCK_BOOL event listener.");
137 _SettingSoundProvider::GetValue(const String& key, bool& value)
140 result r = E_OBJ_NOT_FOUND;
142 if (key == _SOUND_SILENTMODE)
144 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
146 bool silentModeEnabled = false;
147 errorCode = runtime_info_get_value_bool(RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, &silentModeEnabled);
148 SysTryReturnResult(NID_SYS, errorCode == RUNTIME_INFO_ERROR_NONE, E_SYSTEM, "It is failed to get the RUNTIME_INFO_KEY_SILENT_MODE_ENABLED");
149 value = !silentModeEnabled;
151 else if (key == _SOUND_TOUCH)
153 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound touch effect feature.");
156 errorCode = vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &soundTouch);
157 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get on VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL vconf");
168 else if (key == _SOUND_LOCK)
170 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound touch effect feature.");
174 errorCode = vconf_get_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &soundLock);
175 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get on VCONFKEY_SETAPPL_SOUND_LOCK_BOO vconf");
190 _SettingSoundProvider::SetValue(const String& key, const bool value)
193 result r = E_OBJ_NOT_FOUND;
195 if(key == _SOUND_SILENTMODE)
197 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
199 bool silentMode = !value;
200 errorCode = vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, silentMode);
201 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to set on VCONFKEY_SETAPPL_SOUND_STATUS_BOOL vconf");
203 else if(key == _SOUND_TOUCH)
205 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound touch effect feature.");
207 errorCode = vconf_set_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, value);
208 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get on VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL vconf");
210 else if(key == _SOUND_LOCK)
212 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound lock effect feature.");
214 errorCode = vconf_set_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, value);
215 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get on VCONFKEY_SETAPPL_SOUND_LOCK_BOOL vconf");
221 _SettingSoundProvider::GetValue(const String& key, int& value)
226 result r = E_OBJ_NOT_FOUND;
228 if (key == _SOUND_MEDIA_VOLUME)
230 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
233 errorCode = sound_manager_get_max_volume(SOUND_TYPE_MEDIA, &maxVolume);
234 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_max_volume It is failed");
236 errorCode = sound_manager_get_volume(SOUND_TYPE_MEDIA, &volume);
237 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_volume It is failed");
241 else if (key == _SOUND_NOTIFICATION_VOLUME)
243 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
246 errorCode = sound_manager_get_max_volume(SOUND_TYPE_NOTIFICATION, &maxVolume);
247 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_max_volume It is failed");
249 errorCode = sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &volume);
250 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_volume It is failed");
254 else if (key == _SOUND_RINGTONE_VOLUME)
256 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
259 errorCode = sound_manager_get_max_volume(SOUND_TYPE_RINGTONE, &maxVolume);
260 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_max_volume It is failed");
262 errorCode = sound_manager_get_volume(SOUND_TYPE_RINGTONE, &volume);
263 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_volume It is failed");
267 else if (key == _SOUND_SYSTEM_VOLUME)
269 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
272 errorCode = sound_manager_get_max_volume(SOUND_TYPE_SYSTEM, &maxVolume);
273 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_max_volume It is failed");
275 errorCode = sound_manager_get_volume(SOUND_TYPE_SYSTEM, &volume);
276 SysTryReturnResult(NID_SYS, errorCode == SOUND_MANAGER_ERROR_NONE, E_SYSTEM, "sound_manager_get_volume It is failed");
284 _SettingSoundProvider::SetValue(const String& key, const int value)
288 result r = E_SUCCESS;
289 sound_type_e soundType;
291 if (key == _SOUND_MEDIA_VOLUME)
293 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
294 soundType = SOUND_TYPE_MEDIA;
296 else if (key == _SOUND_NOTIFICATION_VOLUME)
298 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
299 soundType = SOUND_TYPE_NOTIFICATION;
301 else if (key == _SOUND_RINGTONE_VOLUME)
303 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
304 soundType = SOUND_TYPE_RINGTONE;
306 else if (key == _SOUND_SYSTEM_VOLUME)
308 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support sound feature.");
309 soundType = SOUND_TYPE_SYSTEM;
313 return E_OBJ_NOT_FOUND;
316 errorCode = sound_manager_get_max_volume(soundType, &maxVolume);
317 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get max volume.");
318 SysTryReturnResult(NID_SYS, maxVolume >= value && value >= 0, E_INVALID_ARG, "The specified value[%d] is outside the bounds of soundCategory.", value);
320 SysLog(NID_SYS, "Required Volume is %d, Value is %d", soundType, value);
321 errorCode = sound_manager_set_volume(soundType, value);
322 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "A system error has occured.");
328 _SettingSoundProvider::GetValue(const String& key, String& value)
331 result r =E_OBJ_NOT_FOUND;
333 if(key == _SOUND_RINGTONE)
335 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support ringtone feature.");
337 char* pRingtone = null;
338 errorCode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &pRingtone);
339 SysTryReturnResult(NID_SYS, errorCode == SYSTEM_SETTINGS_ERROR_NONE, E_SYSTEM, "It is failed to get ringtone");
342 value.Append(pRingtone);
344 if(File::IsFileExist(value) == false)
346 char* pPreloaded = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_DEFAULT_PATH_STR);
347 SysTryReturnResult(NID_SYS, pPreloaded != null, E_SYSTEM, "It is failed to get default ringtone.");
350 preloaded.Append(pPreloaded);
352 if(File::IsFileExist(preloaded) == true)
355 errorCode = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, pPreloaded);
356 if(errorCode != SYSTEM_SETTINGS_ERROR_NONE)
358 SysLogException(NID_SYS, E_SYSTEM, "It is failed to set default ringtone.");
361 if(pPreloaded != null)
368 if(pPreloaded != null)
376 if(key == _SOUND_NOTIFICATION)
378 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support ringtone feature.");
380 char* pNotification = null;
381 pNotification = vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR);
382 SysTryReturnResult(NID_SYS, pNotification != null, E_SYSTEM, "It is failed to get ringtone");
384 value.Append(pNotification);
387 if(File::IsFileExist(value) == false)
389 char* pPreloaded = vconf_get_str(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR);
390 SysTryReturnResult(NID_SYS, pPreloaded != null, E_SYSTEM, "It is failed to get default noti ringtone.");
393 preloaded.Append(pPreloaded);
394 if(File::IsFileExist(preloaded) == true)
397 errorCode = vconf_set_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, pPreloaded);
400 SysLogException(NID_SYS, E_SYSTEM, "It is failed to set default noti ringtone.");
403 if(pPreloaded != null)
410 if(pPreloaded != null)
418 else if(key == _SOUND_NOTIFICATION_REPEAT_PERIOD)
420 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support notificaito sound feature.");
423 int current_value = 0;
424 errorCode = vconf_get_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, ¤t_value);
425 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get notification repeat count.");
427 switch (current_value)
429 case SETTING_SOUND_REP_ONCE:
430 value = _SOUND_NOTIFICATION_REPEAT_PERIOD_ONCE;
432 case SETTING_SOUND_REP_EVERY_2_MIN:
433 value = _SOUND_NOTIFICATION_REPEAT_PERIOD_2MIN;
435 case SETTING_SOUND_REP_EVERY_5_MIN:
436 value = _SOUND_NOTIFICATION_REPEAT_PERIOD_5MIN;
438 case SETTING_SOUND_REP_EVERY_10_MIN:
439 value = _SOUND_NOTIFICATION_REPEAT_PERIOD_10MIN;
442 SysLogException(NID_SYS, E_SYSTEM, "Unsupported value[%d] is provided.", current_value);
451 _SettingSoundProvider::SetValue(const String& key, const String value)
454 result r = E_OBJ_NOT_FOUND;
456 if(key == _SOUND_RINGTONE)
458 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support ringtone sound feature.");
461 char* pFilePath = null;
462 SysTryReturn(NID_SYS, File::IsFileExist(value) == true, E_INVALID_ARG, E_INVALID_ARG, "The entry for the specified ringtone file or the file path cannot be found");
463 pFilePath = _StringConverter::CopyToCharArrayN(value);
465 SysTryReturn(NID_SYS, pFilePath != null, E_SYSTEM, E_SYSTEM, "It is failed to convert type of filePath");
467 errorCode = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, const_cast<char*>(pFilePath));
468 SysTryReturn(NID_SYS, errorCode == 0, E_SYSTEM, E_SYSTEM, "It is failed to set ringtone");
472 else if(key == _SOUND_NOTIFICATION)
474 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support notification sound feature.");
477 char* pFilePath = null;
478 SysTryReturn(NID_SYS, File::IsFileExist(value) == true, E_INVALID_ARG, E_INVALID_ARG, "The entry for the specified notification file or the file path cannot be found");
479 pFilePath = _StringConverter::CopyToCharArrayN(value);
481 SysTryReturn(NID_SYS, pFilePath != null, E_SYSTEM, E_SYSTEM, "It is failed to convert type of filePath");
483 errorCode = vconf_set_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, const_cast<char*>(pFilePath));
484 SysTryReturn(NID_SYS, errorCode == 0, E_SYSTEM, E_SYSTEM, "It is failed to set ringtone");
488 else if(key == _SOUND_NOTIFICATION_REPEAT_PERIOD)
490 SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support notificaito sound feature.");
493 String requestValue(value);
495 requestValue.ToLowerCase();
497 int current_value = 0;
499 if(requestValue == _SOUND_NOTIFICATION_REPEAT_PERIOD_ONCE)
501 current_value = (int) SETTING_SOUND_REP_ONCE;
503 else if(requestValue == _SOUND_NOTIFICATION_REPEAT_PERIOD_2MIN)
505 current_value = (int) SETTING_SOUND_REP_EVERY_2_MIN;
507 else if(requestValue == _SOUND_NOTIFICATION_REPEAT_PERIOD_5MIN)
509 current_value = (int) SETTING_SOUND_REP_EVERY_5_MIN;
511 else if(requestValue == _SOUND_NOTIFICATION_REPEAT_PERIOD_10MIN)
513 current_value = (int) SETTING_SOUND_REP_EVERY_10_MIN;
517 SysLogException(NID_SYS, E_INVALID_ARG, "Requested value[%ls] is not supported.", value.GetPointer());
518 return E_INVALID_ARG;
521 errorCode = vconf_set_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, current_value);
522 SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to get notification repeat count.");
530 _SettingSoundProvider::HasKey(const Tizen::Base::String& key)
533 if(key == _SOUND_MEDIA_VOLUME || key == _SOUND_NOTIFICATION_VOLUME
534 || key == _SOUND_RINGTONE_VOLUME || key == _SOUND_SYSTEM_VOLUME)
538 else if(key == _SOUND_RINGTONE)
542 else if(key == _SOUND_SILENTMODE)
546 else if(key == _SOUND_TOUCH || key == _SOUND_LOCK)
550 else if(key == _SOUND_NOTIFICATION || key == _SOUND_NOTIFICATION_REPEAT_PERIOD)
559 _SettingSoundProvider::SettingEventSoundManager(sound_type_e type, unsigned int volume, void* userData)
565 case SOUND_TYPE_SYSTEM:
566 settingKey.Append(_SOUND_SYSTEM_VOLUME);
568 case SOUND_TYPE_MEDIA:
569 settingKey.Append(_SOUND_MEDIA_VOLUME);
571 case SOUND_TYPE_RINGTONE:
572 settingKey.Append(_SOUND_RINGTONE_VOLUME);
574 case SOUND_TYPE_NOTIFICATION:
575 settingKey.Append(_SOUND_NOTIFICATION_VOLUME);
578 SysLog(NID_SYS, "NOT IMPLEMENTED");
582 _SettingInfo* pSettingInfo = _SettingInfo::GetInstance();
583 SysTryReturnVoidResult(NID_SYS, pSettingInfo != null, E_SYSTEM, "_SettingInfo is not ready.");
585 result r = pSettingInfo->AnnounceSettingEvent(settingKey);
586 SysTryReturnVoidResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to send the event[%ls].", settingKey.GetPointer());
590 _SettingSoundProvider::SettingEventSettingInfo(system_settings_key_e key, void* userData)
594 if(key == SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE)
596 settingKey.Append(_SOUND_RINGTONE);
602 _SettingInfo* pSettingInfo = _SettingInfo::GetInstance();
603 SysTryReturnVoidResult(NID_SYS, pSettingInfo != null, E_SYSTEM, "_SettingInfo is not ready.");
605 result r = pSettingInfo->AnnounceSettingEvent(settingKey);
606 SysTryReturnVoidResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to send the event[%ls].", settingKey.GetPointer());
610 _SettingSoundProvider::SettingEventRuntimeInfo(runtime_info_key_e key, void* userData)
614 if(key == RUNTIME_INFO_KEY_SILENT_MODE_ENABLED)
616 settingKey.Append(_SOUND_SILENTMODE);
622 _SettingInfo* pSettingInfo = _SettingInfo::GetInstance();
623 SysTryReturnVoidResult(NID_SYS, pSettingInfo != null, E_SYSTEM, "_SettingInfo is not ready.");
625 result r = pSettingInfo->AnnounceSettingEvent(settingKey);
626 SysTryReturnVoidResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to send the event[%ls].", settingKey.GetPointer());
629 _SettingSoundProvider::SettingEventVConf(keynode_t* node, void* userData)
633 if (strcmp(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, vconf_keynode_get_name(node)) == 0)
635 settingKey.Append(_SOUND_TOUCH);
637 else if(strcmp(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, vconf_keynode_get_name(node)) == 0)
639 settingKey.Append(_SOUND_LOCK);
641 else if(strcmp(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, vconf_keynode_get_name(node)) == 0)
643 settingKey.Append(_SOUND_NOTIFICATION_REPEAT_PERIOD);
645 else if(strcmp(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, vconf_keynode_get_name(node)) == 0)
647 settingKey.Append(_SOUND_NOTIFICATION);
653 _SettingInfo* pSettingInfo = _SettingInfo::GetInstance();
654 SysTryReturnVoidResult(NID_SYS, pSettingInfo != null, E_SYSTEM, "_SettingInfo is not ready.");
656 result r = pSettingInfo->AnnounceSettingEvent(settingKey);
657 SysTryReturnVoidResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to send the event[%ls].", settingKey.GetPointer());