2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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.
19 namespace Tizen.System
22 /// The System Settings API provides APIs for sharing the configuration over a system.
25 /// The System Settings API provides functions for getting the system configuration related to user preferences.
26 /// The main features of the System Settings API include accessing system-wide configurations, such as ringtones, wallpapers, and so on.
28 public static class SystemSettings
31 /// The file path of the current ringtone.
33 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
34 /// <privlevel>platform</privlevel>
35 public static string IncomingCallRingtone
40 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.IncomingCallRingtone, out filePath);
41 if (res != SystemSettingsError.None)
43 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get IncomingCallRingtone system setting.");
49 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.IncomingCallRingtone, value);
50 if (res != SystemSettingsError.None)
52 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set IncomingCallRingtone system setting.");
58 /// The file path of the current home-screen wallpaper.
60 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
61 /// <privlevel>platform</privlevel>
62 public static string WallpaperHomeScreen
67 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperHomeScreen, out filePath);
68 if (res != SystemSettingsError.None)
70 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperHomeScreen system setting.");
76 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperHomeScreen, value);
77 if (res != SystemSettingsError.None)
79 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperHomeScreen system setting.");
85 /// The file path of the current lock-screen wallpaper.
87 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
88 /// <privlevel>platform</privlevel>
89 public static string WallpaperLockScreen
94 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperLockScreen, out filePath);
95 if (res != SystemSettingsError.None)
97 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperLockScreen system setting.");
103 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperLockScreen, value);
104 if (res != SystemSettingsError.None)
106 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperLockScreen system setting.");
112 /// The current system font size.
114 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
115 /// <privlevel>platform</privlevel>
116 public static SystemSettingsFontSize FontSize
121 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.FontSize, out fontSize);
122 if (res != SystemSettingsError.None)
124 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontSize system setting.");
126 return (SystemSettingsFontSize)fontSize;
130 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.FontSize, (int)value);
131 if (res != SystemSettingsError.None)
133 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontSize system setting.");
139 /// The current system font type.
141 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
142 /// <privlevel>platform</privlevel>
143 public static string FontType
148 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.FontType, out fontType);
149 if (res != SystemSettingsError.None)
151 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontType system setting.");
157 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.FontType, value);
158 if (res != SystemSettingsError.None)
160 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontType system setting.");
166 /// Indicates whether the motion service is activated.
168 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
169 /// <privlevel>platform</privlevel>
170 public static bool MotionActivationEnabled
174 bool isMotionServiceActivated;
175 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionActivationEnabled, out isMotionServiceActivated);
176 if (res != SystemSettingsError.None)
178 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionActivation system setting.");
180 return isMotionServiceActivated;
184 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.MotionActivationEnabled, value);
185 if (res != SystemSettingsError.None)
187 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set MotionActivation system setting.");
193 /// The file path of the current email alert ringtone.
195 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
196 /// <privlevel>platform</privlevel>
197 public static string EmailAlertRingtone
202 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.EmailAlertRingtone, out filePath);
203 if (res != SystemSettingsError.None)
205 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get EmailAlertRingtone system setting.");
211 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.EmailAlertRingtone, value);
212 if (res != SystemSettingsError.None)
214 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set EmailAlertRingtone system setting.");
219 /// Indicates whether the USB debugging is enabled.
221 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
222 /// <privlevel>platform</privlevel>
223 public static bool UsbDebuggingEnabled
227 bool isusbDebuggingEnabled;
228 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, out isusbDebuggingEnabled);
229 if (res != SystemSettingsError.None)
231 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UsbDebuggingEnabled system setting.");
233 return isusbDebuggingEnabled;
237 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, value);
238 if (res != SystemSettingsError.None)
240 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set UsbDebuggingEnabled system setting.");
246 /// Indicates whether the 3G data network is enabled.
248 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
249 /// <privlevel>platform</privlevel>
250 public static bool Data3GNetworkEnabled
254 bool is3GDataEnabled;
255 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, out is3GDataEnabled);
256 if (res != SystemSettingsError.None)
258 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Data3GNetworkEnabled system setting.");
260 return is3GDataEnabled;
264 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, value);
265 if (res != SystemSettingsError.None)
267 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set Data3GNetworkEnabled system setting.");
273 /// Indicates the lock-screen application package name.
275 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
276 /// <privlevel>platform</privlevel>
277 public static string LockscreenApp
282 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LockscreenApp, out pkgName);
283 if (res != SystemSettingsError.None)
285 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockscreenApp system setting.");
291 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LockscreenApp, value);
292 if (res != SystemSettingsError.None)
294 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockscreenApp system setting.");
300 /// The current system default font type (only supports Get).
302 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
303 /// <privlevel>platform</privlevel>
304 public static string DefaultFontType
308 string defaultFontType;
309 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DefaultFontType, out defaultFontType);
310 if (res != SystemSettingsError.None)
312 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DefaultFontType system setting value.");
314 return defaultFontType;
319 /// Indicates the current country setting in the <LANGUAGE>_<REGION> syntax.
320 /// The country setting is in the ISO 639-2 format,
321 /// and the region setting is in the ISO 3166-1 alpha-2 format.
323 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
324 /// <privlevel>platform</privlevel>
325 public static string LocaleCountry
329 string countrySetting;
330 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleCountry, out countrySetting);
331 if (res != SystemSettingsError.None)
333 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleCountry system setting.");
335 return countrySetting;
339 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleCountry, value);
340 if (res != SystemSettingsError.None)
342 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleCountry system setting.");
348 /// Indicates the current language setting in the <LANGUAGE>_<REGION> syntax.
349 /// The language setting is in the ISO 639-2 format,
350 /// and the region setting is in the ISO 3166-1 alpha-2 format.
352 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
353 /// <privlevel>platform</privlevel>
354 public static string LocaleLanguage
358 string languageSetting;
359 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleLanguage, out languageSetting);
360 if (res != SystemSettingsError.None)
362 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleLanguage system setting.");
364 return languageSetting;
368 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleLanguage, value);
369 if (res != SystemSettingsError.None)
371 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleLanguage system setting.");
377 /// Indicates whether the 24-hour clock is used.
378 /// If the value is false, the 12-hour clock is used.
380 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
381 /// <privlevel>platform</privlevel>
382 public static bool LocaleTimeFormat24HourEnabled
387 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, out is24HrFormat);
388 if (res != SystemSettingsError.None)
390 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeFormat24Hour system setting.");
396 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, value);
397 if (res != SystemSettingsError.None)
399 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeFormat24Hour system setting.");
405 /// Indicates the current time zone, for example, Pacific/Tahiti.
407 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
408 /// <privlevel>platform</privlevel>
409 public static string LocaleTimeZone
414 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleTimeZone, out timeZone);
415 if (res != SystemSettingsError.None)
417 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeZone system setting.");
423 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleTimeZone, value);
424 if (res != SystemSettingsError.None)
426 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeZone system setting.");
432 /// Once the system changes time, this event occurs to notify the time change.
434 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
435 /// <privlevel>platform</privlevel>
436 public static int Time
441 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.Time, out time);
442 if (res != SystemSettingsError.None)
444 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Time system setting.");
450 /// Indicates whether the screen lock sound is enabled on the device, for example, the LCD on or off sound.
452 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
453 /// <privlevel>platform</privlevel>
454 public static bool SoundLockEnabled
458 bool isSoundLockEnabled;
459 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundLockEnabled, out isSoundLockEnabled);
460 if (res != SystemSettingsError.None)
462 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundLock system setting.");
464 return isSoundLockEnabled;
469 /// Indicates whether the device is in the silent mode.
471 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
472 /// <privlevel>platform</privlevel>
473 public static bool SoundSilentModeEnabled
478 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundSilentModeEnabled, out isSilent);
479 if (res != SystemSettingsError.None)
481 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundSilentMode system setting.");
488 /// Indicates whether the screen touch sound is enabled on the device.
490 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
491 /// <privlevel>platform</privlevel>
492 public static bool SoundTouchEnabled
496 bool isTouchSoundEnabled;
497 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundTouchEnabled, out isTouchSoundEnabled);
498 if (res != SystemSettingsError.None)
500 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundTouch system setting value.");
502 return isTouchSoundEnabled;
507 /// Indicates whether the rotation control is automatic.
509 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
510 /// <privlevel>platform</privlevel>
511 public static bool DisplayScreenRotationAutoEnabled
515 bool isRotationAutomatic;
516 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, out isRotationAutomatic);
517 if (res != SystemSettingsError.None)
519 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DisplayScreenRotationAuto system setting.");
521 return isRotationAutomatic;
526 /// Indicates the device name.
528 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
529 /// <privlevel>platform</privlevel>
530 public static string DeviceName
535 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DeviceName, out deviceName);
536 if (res != SystemSettingsError.None)
538 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DeviceName system setting value.");
544 /// Indicates whether the device user has enabled the motion feature.
546 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
547 /// <privlevel>platform</privlevel>
548 public static bool MotionEnabled
552 bool isMotionEnabled;
553 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionEnabled, out isMotionEnabled);
554 if (res != SystemSettingsError.None)
556 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionEnabled system setting value.");
558 return isMotionEnabled;
563 /// Indicates whether Wi-Fi related notifications are enabled on the device.
565 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
566 /// <privlevel>platform</privlevel>
567 public static bool NetworkWifiNotificationEnabled
571 bool isWifiNotificationEnabled;
572 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkWifiNotificationEnabled, out isWifiNotificationEnabled);
573 if (res != SystemSettingsError.None)
575 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkWifiNotification system setting.");
577 return isWifiNotificationEnabled;
582 /// Indicates whether the device is in the flight mode.
584 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
585 /// <privlevel>platform</privlevel>
586 public static bool NetworkFlightModeEnabled
590 bool isFlightModeEnabled;
591 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkFlightModeEnabled, out isFlightModeEnabled);
592 if (res != SystemSettingsError.None)
594 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkFlightMode system setting.");
596 return isFlightModeEnabled;
601 /// Indicates the backlight time (in seconds). The following values can be used: 15, 30, 60, 120, 300, and 600.
603 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
604 /// <privlevel>platform</privlevel>
605 public static int ScreenBacklightTime
610 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.ScreenBacklightTime, out backlightTime);
611 if (res != SystemSettingsError.None)
613 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get ScreenBacklightTime system setting.");
615 return backlightTime;
619 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.ScreenBacklightTime, value);
620 if (res != SystemSettingsError.None)
622 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set ScreenBacklightTime system setting.");
628 /// Indicates the file path of the current notification tone set by the user.
630 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
631 /// <privlevel>platform</privlevel>
632 public static string SoundNotification
637 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.SoundNotification, out filePath);
638 if (res != SystemSettingsError.None)
640 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotification system setting.");
646 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.SoundNotification, value);
647 if (res != SystemSettingsError.None)
649 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotification system setting.");
655 /// Indicates the time period for notification repetitions.
657 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
658 /// <privlevel>platform</privlevel>
659 public static int SoundNotificationRepetitionPeriod
663 int notificationRepetitionPeriod;
664 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, out notificationRepetitionPeriod);
665 if (res != SystemSettingsError.None)
667 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotificationRepetitionPeriod system setting.");
669 return notificationRepetitionPeriod;
673 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, value);
674 if (res != SystemSettingsError.None)
676 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotificationRepetitionPeriod system setting.");
682 /// Indicates the current lock state.
684 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
685 /// <privlevel>platform</privlevel>
686 public static SystemSettingsIdleLockState LockState
691 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.LockState, out LockState);
692 if (res != SystemSettingsError.None)
694 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockState system setting.");
696 return (SystemSettingsIdleLockState)LockState;
700 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.LockState, (int)value);
701 if (res != SystemSettingsError.None)
703 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockState system setting.");
709 /// The current system ADS ID.
711 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
712 /// <privlevel>platform</privlevel>
713 public static string AdsId
718 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.AdsId, out adsId);
719 if (res != SystemSettingsError.None)
721 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get AdsId system setting.");
727 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.AdsId, value);
728 if (res != SystemSettingsError.None)
730 throw SystemSettingsExceptionFactory.CreateException(res, "unable to set AdsId system setting.");
737 /// Indicates the time period for notification repetitions.
739 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
740 /// <privlevel>platform</privlevel>
741 public static SystemSettingsUdsState UltraDataSave
746 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.UltraDataSave, out UltraDataSave);
747 if (res != SystemSettingsError.None)
749 throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UltraDataSave system setting.");
751 return (SystemSettingsUdsState)UltraDataSave;
757 private static readonly Interop.Settings.SystemSettingsChangedCallback s_incomingCallRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
759 string path = SystemSettings.IncomingCallRingtone;
760 IncomingCallRingtoneChangedEventArgs eventArgs = new IncomingCallRingtoneChangedEventArgs(path);
761 s_incomingCallRingtoneChanged?.Invoke(null, eventArgs);
763 private static event EventHandler<IncomingCallRingtoneChangedEventArgs> s_incomingCallRingtoneChanged;
765 /// The IncomingCallRingtoneChanged event is triggered when the file path of the incoming ringtone is changed.
767 /// <param name="sender"></param>
768 /// <param name="e">The IncomingCallRingtoneChangedEventArgs object that contains the key and the changed value.</param>
769 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
770 /// <privlevel>platform</privlevel>
771 public static event EventHandler<IncomingCallRingtoneChangedEventArgs> IncomingCallRingtoneChanged
775 if (s_incomingCallRingtoneChanged == null)
777 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback, IntPtr.Zero);
778 if (ret != SystemSettingsError.None)
780 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
783 s_incomingCallRingtoneChanged += value;
788 s_incomingCallRingtoneChanged -= value;
789 if (s_incomingCallRingtoneChanged == null)
791 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.IncomingCallRingtone);
792 if (ret != SystemSettingsError.None)
794 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
800 private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperHomeScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
802 string path = SystemSettings.WallpaperHomeScreen;
803 WallpaperHomeScreenChangedEventArgs eventArgs = new WallpaperHomeScreenChangedEventArgs(path);
804 s_wallpaperHomeScreenChanged?.Invoke(null, eventArgs);
806 private static event EventHandler<WallpaperHomeScreenChangedEventArgs> s_wallpaperHomeScreenChanged;
808 /// THe WallpaperHomeScreenChanged event is triggered when the file path of the current home screen wallpaper is changed.
810 /// <param name="sender"></param>
811 /// <param name="e">The WallpaperHomeScreenChangedEventArgs object that contains the key and the changed value.</param>
812 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
813 /// <privlevel>platform</privlevel>
814 public static event EventHandler<WallpaperHomeScreenChangedEventArgs> WallpaperHomeScreenChanged
818 if (s_wallpaperHomeScreenChanged == null)
820 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback, IntPtr.Zero);
821 if (ret != SystemSettingsError.None)
823 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
826 s_wallpaperHomeScreenChanged += value;
831 s_wallpaperHomeScreenChanged -= value;
832 if (s_wallpaperHomeScreenChanged == null)
834 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperHomeScreen);
835 if (ret != SystemSettingsError.None)
837 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
843 private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperLockScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
845 string path = SystemSettings.WallpaperLockScreen;
846 WallpaperLockScreenChangedEventArgs eventArgs = new WallpaperLockScreenChangedEventArgs(path);
847 s_wallpaperLockScreenChanged?.Invoke(null, eventArgs);
849 private static event EventHandler<WallpaperLockScreenChangedEventArgs> s_wallpaperLockScreenChanged;
851 /// The WallpaperLockScreenChanged event is triggered when the file path of the current lock screen wallpaper is changed.
853 /// <param name="sender"></param>
854 /// <param name="e">The WallpaperLockScreenChangedEventArgs object that contains the key and the changed value.</param>
855 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
856 /// <privlevel>platform</privlevel>
857 public static event EventHandler<WallpaperLockScreenChangedEventArgs> WallpaperLockScreenChanged
861 if (s_wallpaperLockScreenChanged == null)
863 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback, IntPtr.Zero);
864 if (ret != SystemSettingsError.None)
866 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
869 s_wallpaperLockScreenChanged += value;
874 s_wallpaperLockScreenChanged -= value;
875 if (s_wallpaperLockScreenChanged == null)
877 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperLockScreen);
878 if (ret != SystemSettingsError.None)
880 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
886 private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontSizeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
888 SystemSettingsFontSize fontSize = SystemSettings.FontSize;
889 FontSizeChangedEventArgs eventArgs = new FontSizeChangedEventArgs(fontSize);
890 s_fontSizeChanged?.Invoke(null, eventArgs);
892 private static event EventHandler<FontSizeChangedEventArgs> s_fontSizeChanged;
894 /// The FontSizeChanged event is triggered when the current system font size is changed.
896 /// <param name="sender"></param>
897 /// <param name="e">The FontSizeChangedEventArgs object that contains the key and the changed value.</param>
898 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
899 /// <privlevel>platform</privlevel>
900 public static event EventHandler<FontSizeChangedEventArgs> FontSizeChanged
904 if (s_fontSizeChanged == null)
906 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback, IntPtr.Zero);
907 if (ret != SystemSettingsError.None)
909 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
912 s_fontSizeChanged += value;
917 s_fontSizeChanged -= value;
918 if (s_fontSizeChanged == null)
920 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontSize);
921 if (ret != SystemSettingsError.None)
923 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
929 private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontTypeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
931 string fontType = SystemSettings.FontType;
932 FontTypeChangedEventArgs eventArgs = new FontTypeChangedEventArgs(fontType);
933 s_fontTypeChanged?.Invoke(null, eventArgs);
935 private static event EventHandler<FontTypeChangedEventArgs> s_fontTypeChanged;
937 /// The FontTypeChanged event is triggered when the current system font type is changed.
939 /// <param name="sender"></param>
940 /// <param name="e">The FontTypeChangedEventArgs object that contains the key and the changed value.</param>
941 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
942 /// <privlevel>platform</privlevel>
943 public static event EventHandler<FontTypeChangedEventArgs> FontTypeChanged
947 if (s_fontTypeChanged == null)
949 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback, IntPtr.Zero);
950 if (ret != SystemSettingsError.None)
952 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
955 s_fontTypeChanged += value;
960 s_fontTypeChanged -= value;
961 if (s_fontTypeChanged == null)
963 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontType);
964 if (ret != SystemSettingsError.None)
966 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
972 private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionActivationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
974 bool motionActivation = SystemSettings.MotionActivationEnabled;
975 MotionActivationSettingChangedEventArgs eventArgs = new MotionActivationSettingChangedEventArgs(motionActivation);
976 s_motionActivationChanged?.Invoke(null, eventArgs);
978 private static event EventHandler<MotionActivationSettingChangedEventArgs> s_motionActivationChanged;
980 /// The MotionActivationChanged event is triggered when the motion service status is changed.
982 /// <param name="sender"></param>
983 /// <param name="e">The MotionActivationChangedEventArgs object that contains the key and the changed value.</param>
984 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
985 /// <privlevel>platform</privlevel>
986 public static event EventHandler<MotionActivationSettingChangedEventArgs> MotionActivationSettingChanged
990 if (s_motionActivationChanged == null)
992 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback, IntPtr.Zero);
993 if (ret != SystemSettingsError.None)
995 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
998 s_motionActivationChanged += value;
1003 s_motionActivationChanged -= value;
1004 if (s_motionActivationChanged == null)
1006 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionActivationEnabled);
1007 if (ret != SystemSettingsError.None)
1009 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1015 private static readonly Interop.Settings.SystemSettingsChangedCallback s_emailAlertRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1017 string emailAlertRingtone = SystemSettings.EmailAlertRingtone;
1018 EmailAlertRingtoneChangedEventArgs eventArgs = new EmailAlertRingtoneChangedEventArgs(emailAlertRingtone);
1019 s_emailAlertRingtoneChanged?.Invoke(null, eventArgs);
1021 private static event EventHandler<EmailAlertRingtoneChangedEventArgs> s_emailAlertRingtoneChanged;
1023 /// The EmailAlertRingtoneChanged event is triggered when the file path of the current email alert ringtone is changed.
1025 /// <param name="sender"></param>
1026 /// <param name="e">The EmailAlertRingtoneChangedEventArgs object that contains the key and the changed value.</param>
1027 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1028 /// <privlevel>platform</privlevel>
1029 public static event EventHandler<EmailAlertRingtoneChangedEventArgs> EmailAlertRingtoneChanged
1033 if (s_emailAlertRingtoneChanged == null)
1035 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback, IntPtr.Zero);
1036 if (ret != SystemSettingsError.None)
1038 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1041 s_emailAlertRingtoneChanged += value;
1046 s_emailAlertRingtoneChanged -= value;
1047 if (s_emailAlertRingtoneChanged == null)
1049 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.EmailAlertRingtone);
1050 if (ret != SystemSettingsError.None)
1052 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1058 private static readonly Interop.Settings.SystemSettingsChangedCallback s_usbDebuggingSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1060 bool usbDebuggingEnabled = SystemSettings.UsbDebuggingEnabled;
1061 UsbDebuggingSettingChangedEventArgs eventArgs = new UsbDebuggingSettingChangedEventArgs(usbDebuggingEnabled);
1062 s_usbDebuggingSettingChanged?.Invoke(null, eventArgs);
1064 private static event EventHandler<UsbDebuggingSettingChangedEventArgs> s_usbDebuggingSettingChanged;
1066 /// The UsbDebuggingSettingChangedEventArgs event is triggered when the USB debugging status is changed.
1068 /// <param name="sender"></param>
1069 /// <param name="e">The UsbDebuggingSettingChangedEventArgs object that contains the key and the changed value.</param>
1070 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1071 /// <privlevel>platform</privlevel>
1072 public static event EventHandler<UsbDebuggingSettingChangedEventArgs> UsbDebuggingSettingChanged
1076 if (s_usbDebuggingSettingChanged == null)
1078 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback, IntPtr.Zero);
1079 if (ret != SystemSettingsError.None)
1081 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1084 s_usbDebuggingSettingChanged += value;
1089 s_usbDebuggingSettingChanged -= value;
1090 if (s_usbDebuggingSettingChanged == null)
1092 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UsbDebuggingEnabled);
1093 if (ret != SystemSettingsError.None)
1095 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1101 private static readonly Interop.Settings.SystemSettingsChangedCallback s_data3GNetworkSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1103 bool data3GEnabled = SystemSettings.Data3GNetworkEnabled;
1104 Data3GNetworkSettingChangedEventArgs eventArgs = new Data3GNetworkSettingChangedEventArgs(data3GEnabled);
1105 s_data3GNetworkSettingChanged?.Invoke(null, eventArgs);
1107 private static event EventHandler<Data3GNetworkSettingChangedEventArgs> s_data3GNetworkSettingChanged;
1109 /// The Data3GNetworkSettingChanged event is triggered when the 3G data network status is changed.
1111 /// <param name="sender"></param>
1112 /// <param name="e">The Data3GNetworkSettingChangedEventArgs object that contains the key and the changed value.</param>
1113 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1114 /// <privlevel>platform</privlevel>
1115 public static event EventHandler<Data3GNetworkSettingChangedEventArgs> Data3GNetworkSettingChanged
1119 if (s_data3GNetworkSettingChanged == null)
1121 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback, IntPtr.Zero);
1122 if (ret != SystemSettingsError.None)
1124 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1127 s_data3GNetworkSettingChanged += value;
1132 s_data3GNetworkSettingChanged -= value;
1133 if (s_data3GNetworkSettingChanged == null)
1135 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Data3GNetworkEnabled);
1136 if (ret != SystemSettingsError.None)
1138 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1144 private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockscreenAppChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1146 string lockScreenApp = SystemSettings.LockscreenApp;
1147 LockscreenAppChangedEventArgs eventArgs = new LockscreenAppChangedEventArgs(lockScreenApp);
1148 s_lockscreenAppChanged?.Invoke(null, eventArgs);
1150 private static event EventHandler<LockscreenAppChangedEventArgs> s_lockscreenAppChanged;
1152 /// The LockscreenAppChanged event is triggered when the lockscreen application package name is changed.
1154 /// <param name="sender"></param>
1155 /// <param name="e">The LockscreenAppChangedEventArgs object that contains the key and the changed value.</param>
1156 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1157 /// <privlevel>platform</privlevel>
1158 public static event EventHandler<LockscreenAppChangedEventArgs> LockscreenAppChanged
1162 if (s_lockscreenAppChanged == null)
1164 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockscreenApp, s_lockscreenAppChangedCallback, IntPtr.Zero);
1165 if (ret != SystemSettingsError.None)
1167 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1170 s_lockscreenAppChanged += value;
1175 s_lockscreenAppChanged -= value;
1176 if (s_lockscreenAppChanged == null)
1178 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockscreenApp);
1179 if (ret != SystemSettingsError.None)
1181 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1187 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeCountryChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1189 string localeCountry = SystemSettings.LocaleCountry;
1190 LocaleCountryChangedEventArgs eventArgs = new LocaleCountryChangedEventArgs(localeCountry);
1191 s_localeCountryChanged?.Invoke(null, eventArgs);
1193 private static event EventHandler<LocaleCountryChangedEventArgs> s_localeCountryChanged;
1195 /// The LocaleCountryChanged event is triggered when the current country setting in the <LANGUAGE>_<REGION> syntax, is changed.
1197 /// <param name="sender"></param>
1198 /// <param name="e">The LocaleCountryChangedEventArgs object that contains the key and the changed value.</param>
1199 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1200 /// <privlevel>platform</privlevel>
1201 public static event EventHandler<LocaleCountryChangedEventArgs> LocaleCountryChanged
1205 if (s_localeCountryChanged == null)
1207 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback, IntPtr.Zero);
1208 if (ret != SystemSettingsError.None)
1210 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1213 s_localeCountryChanged += value;
1218 s_localeCountryChanged -= value;
1219 if (s_localeCountryChanged == null)
1221 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleCountry);
1222 if (ret != SystemSettingsError.None)
1224 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1230 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeLanguageChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1232 string localeLanguage = SystemSettings.LocaleLanguage;
1233 LocaleLanguageChangedEventArgs eventArgs = new LocaleLanguageChangedEventArgs(localeLanguage);
1234 s_localeLanguageChanged?.Invoke(null, eventArgs);
1236 private static event EventHandler<LocaleLanguageChangedEventArgs> s_localeLanguageChanged;
1238 /// The LocaleLanguageChanged event is triggered when the current language setting in the <LANGUAGE>_<REGION> syntax, is changed.
1240 /// <param name="sender"></param>
1241 /// <param name="e">The LocaleLanguageChangedEventArgs object that contains the key and the changed value.</param>
1242 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1243 /// <privlevel>platform</privlevel>
1244 public static event EventHandler<LocaleLanguageChangedEventArgs> LocaleLanguageChanged
1248 if (s_localeLanguageChanged == null)
1250 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback, IntPtr.Zero);
1251 if (ret != SystemSettingsError.None)
1253 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1256 s_localeLanguageChanged += value;
1261 s_localeLanguageChanged -= value;
1262 if (s_localeLanguageChanged == null)
1264 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleLanguage);
1265 if (ret != SystemSettingsError.None)
1267 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1273 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeFormat24HourChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1275 bool localeTimeFormat24Hour = SystemSettings.LocaleTimeFormat24HourEnabled;
1276 LocaleTimeFormat24HourSettingChangedEventArgs eventArgs = new LocaleTimeFormat24HourSettingChangedEventArgs(localeTimeFormat24Hour);
1277 s_localeTimeFormat24HourChanged?.Invoke(null, eventArgs);
1279 private static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> s_localeTimeFormat24HourChanged;
1281 /// The LocaleTimeFormat24HourChanged event is triggered when the time format is changed.
1283 /// <param name="sender"></param>
1284 /// <param name="e">The LocaleTimeFormat24HourChangedEventArgs object that contains the key and the changed value.</param>
1285 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1286 /// <privlevel>platform</privlevel>
1287 public static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> LocaleTimeFormat24HourSettingChanged
1291 if (s_localeTimeFormat24HourChanged == null)
1293 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback, IntPtr.Zero);
1294 if (ret != SystemSettingsError.None)
1296 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1299 s_localeTimeFormat24HourChanged += value;
1304 s_localeTimeFormat24HourChanged -= value;
1305 if (s_localeTimeFormat24HourChanged == null)
1307 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled);
1308 if (ret != SystemSettingsError.None)
1310 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1316 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeZoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1318 string localeTimeZone = SystemSettings.LocaleTimeZone;
1319 LocaleTimeZoneChangedEventArgs eventArgs = new LocaleTimeZoneChangedEventArgs(localeTimeZone);
1320 s_localeTimeZoneChanged?.Invoke(null, eventArgs);
1322 private static event EventHandler<LocaleTimeZoneChangedEventArgs> s_localeTimeZoneChanged;
1324 /// The LocaleTimeZoneChanged event is triggered when the current time zone is changed.
1326 /// <param name="sender"></param>
1327 /// <param name="e">The LocaleTimeZoneChangedEventArgs object that contains the key and the changed value.</param>
1328 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1329 /// <privlevel>platform</privlevel>
1330 public static event EventHandler<LocaleTimeZoneChangedEventArgs> LocaleTimeZoneChanged
1334 if (s_localeTimeZoneChanged == null)
1336 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback, IntPtr.Zero);
1337 if (ret != SystemSettingsError.None)
1339 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1342 s_localeTimeZoneChanged += value;
1347 s_localeTimeZoneChanged -= value;
1348 if (s_localeTimeZoneChanged == null)
1350 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeZone);
1351 if (ret != SystemSettingsError.None)
1353 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1359 private static readonly Interop.Settings.SystemSettingsChangedCallback s_timeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1362 int time = SystemSettings.Time;
1363 TimeChangedEventArgs eventArgs = new TimeChangedEventArgs(time);
1364 s_timeChanged?.Invoke(null, eventArgs);
1366 private static event EventHandler<TimeChangedEventArgs> s_timeChanged;
1368 /// The TimeChanged event is triggered when the system time is changed.
1370 /// <param name="sender"></param>
1371 /// <param name="e">The TimeChangedEventArgs object that contains the key and the changed value.</param>
1372 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1373 /// <privlevel>platform</privlevel>
1374 public static event EventHandler<TimeChangedEventArgs> TimeChanged
1378 if (s_timeChanged == null)
1380 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Time, s_timeChangedCallback, IntPtr.Zero);
1381 if (ret != SystemSettingsError.None)
1383 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1386 s_timeChanged += value;
1391 s_timeChanged -= value;
1392 if (s_timeChanged == null)
1394 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Time);
1395 if (ret != SystemSettingsError.None)
1397 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1403 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundLockChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1405 bool soundLock = SystemSettings.SoundLockEnabled;
1406 SoundLockSettingChangedEventArgs eventArgs = new SoundLockSettingChangedEventArgs(soundLock);
1407 s_soundLockChanged?.Invoke(null, eventArgs);
1409 private static event EventHandler<SoundLockSettingChangedEventArgs> s_soundLockChanged;
1411 /// The SoundLockChanged event is triggered when the screen lock sound enabled status is changed.
1413 /// <param name="sender"></param>
1414 /// <param name="e">The SoundLockChangedEventArgs object that contains the key and the changed value.</param>
1415 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1416 /// <privlevel>platform</privlevel>
1417 public static event EventHandler<SoundLockSettingChangedEventArgs> SoundLockSettingChanged
1421 if (s_soundLockChanged == null)
1423 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback, IntPtr.Zero);
1424 if (ret != SystemSettingsError.None)
1426 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1429 s_soundLockChanged += value;
1434 s_soundLockChanged -= value;
1435 if (s_soundLockChanged == null)
1437 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundLockEnabled);
1438 if (ret != SystemSettingsError.None)
1440 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1446 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundSilentModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1448 bool soundSilentMode = SystemSettings.SoundSilentModeEnabled;
1449 SoundSilentModeSettingChangedEventArgs eventArgs = new SoundSilentModeSettingChangedEventArgs(soundSilentMode);
1450 s_soundSilentModeChanged?.Invoke(null, eventArgs);
1452 private static event EventHandler<SoundSilentModeSettingChangedEventArgs> s_soundSilentModeChanged;
1454 /// The SoundSilentModeChanged event is triggered when the silent mode status is changed.
1456 /// <param name="sender"></param>
1457 /// <param name="e">The SoundSilentModeChangedEventArgs object that contains the key and the changed value.</param>
1458 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1459 /// <privlevel>platform</privlevel>
1460 public static event EventHandler<SoundSilentModeSettingChangedEventArgs> SoundSilentModeSettingChanged
1464 if (s_soundSilentModeChanged == null)
1466 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback, IntPtr.Zero);
1467 if (ret != SystemSettingsError.None)
1469 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1472 s_soundSilentModeChanged += value;
1477 s_soundSilentModeChanged -= value;
1478 if (s_soundSilentModeChanged == null)
1480 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundSilentModeEnabled);
1481 if (ret != SystemSettingsError.None)
1483 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1489 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundTouchChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1491 bool soundTouch = SystemSettings.SoundTouchEnabled;
1492 SoundTouchSettingChangedEventArgs eventArgs = new SoundTouchSettingChangedEventArgs(soundTouch);
1493 s_soundTouchChanged?.Invoke(null, eventArgs);
1495 private static event EventHandler<SoundTouchSettingChangedEventArgs> s_soundTouchChanged;
1497 /// THe SoundTouchChanged event is triggered when the screen touch sound enabled status is changed.
1499 /// <param name="sender"></param>
1500 /// <param name="e">The SoundTouchChangedEventArgs object that contains the key and the changed value.</param>
1501 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1502 /// <privlevel>platform</privlevel>
1503 public static event EventHandler<SoundTouchSettingChangedEventArgs> SoundTouchSettingChanged
1507 if (s_soundTouchChanged == null)
1509 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback, IntPtr.Zero);
1510 if (ret != SystemSettingsError.None)
1512 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1515 s_soundTouchChanged += value;
1520 s_soundTouchChanged -= value;
1521 if (s_soundTouchChanged == null)
1523 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundTouchEnabled);
1524 if (ret != SystemSettingsError.None)
1526 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1532 private static readonly Interop.Settings.SystemSettingsChangedCallback s_displayScreenRotationAutoChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1534 bool displayScreenRotationAuto = SystemSettings.DisplayScreenRotationAutoEnabled;
1535 DisplayScreenRotationAutoSettingChangedEventArgs eventArgs = new DisplayScreenRotationAutoSettingChangedEventArgs(displayScreenRotationAuto);
1536 s_displayScreenRotationAutoChanged?.Invoke(null, eventArgs);
1538 private static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> s_displayScreenRotationAutoChanged;
1540 /// The DisplayScreenRotationAutoChanged event is triggered when the automatic rotation control status is changed.
1542 /// <param name="sender"></param>
1543 /// <param name="e">The DisplayScreenRotationAutoChangedEventArgs object that contains the key and the changed value.</param>
1544 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1545 /// <privlevel>platform</privlevel>
1546 public static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> DisplayScreenRotationAutoSettingChanged
1550 if (s_displayScreenRotationAutoChanged == null)
1552 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback, IntPtr.Zero);
1553 if (ret != SystemSettingsError.None)
1555 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1558 s_displayScreenRotationAutoChanged += value;
1563 s_displayScreenRotationAutoChanged -= value;
1564 if (s_displayScreenRotationAutoChanged == null)
1566 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled);
1567 if (ret != SystemSettingsError.None)
1569 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1575 private static readonly Interop.Settings.SystemSettingsChangedCallback s_deviceNameChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1577 string deviceName = SystemSettings.DeviceName;
1578 DeviceNameChangedEventArgs eventArgs = new DeviceNameChangedEventArgs(deviceName);
1579 s_deviceNameChanged?.Invoke(null, eventArgs);
1581 private static event EventHandler<DeviceNameChangedEventArgs> s_deviceNameChanged;
1583 /// The DeviceNameChanged event is triggered when the device name is changed.
1585 /// <param name="sender"></param>
1586 /// <param name="e">The DeviceNameChangedEventArgs object that contains the key and the changed value.</param>
1587 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1588 /// <privlevel>platform</privlevel>
1589 public static event EventHandler<DeviceNameChangedEventArgs> DeviceNameChanged
1593 if (s_deviceNameChanged == null)
1595 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback, IntPtr.Zero);
1596 if (ret != SystemSettingsError.None)
1598 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1601 s_deviceNameChanged += value;
1606 s_deviceNameChanged -= value;
1607 if (s_deviceNameChanged == null)
1609 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DeviceName);
1610 if (ret != SystemSettingsError.None)
1612 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1618 private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1620 bool motionEnabled = SystemSettings.MotionEnabled;
1621 MotionSettingChangedEventArgs eventArgs = new MotionSettingChangedEventArgs(motionEnabled);
1622 s_motionSettingChanged?.Invoke(null, eventArgs);
1624 private static event EventHandler<MotionSettingChangedEventArgs> s_motionSettingChanged;
1626 /// The MotionSettingChanged event is triggered when the motion feature enabled status is changed.
1628 /// <param name="sender"></param>
1629 /// <param name="e">The MotionSettingChangedEventArgs object that contains the key and the changed value.</param>
1630 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1631 /// <privlevel>platform</privlevel>
1632 public static event EventHandler<MotionSettingChangedEventArgs> MotionSettingChanged
1636 if (s_motionSettingChanged == null)
1638 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback, IntPtr.Zero);
1639 if (ret != SystemSettingsError.None)
1641 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1644 s_motionSettingChanged += value;
1649 s_motionSettingChanged -= value;
1650 if (s_motionSettingChanged == null)
1652 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionEnabled);
1653 if (ret != SystemSettingsError.None)
1655 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1661 private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkWifiNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1663 bool networkWifiNotification = SystemSettings.NetworkWifiNotificationEnabled;
1664 NetworkWifiNotificationSettingChangedEventArgs eventArgs = new NetworkWifiNotificationSettingChangedEventArgs(networkWifiNotification);
1665 s_networkWifiNotificationChanged?.Invoke(null, eventArgs);
1667 private static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> s_networkWifiNotificationChanged;
1669 /// The NetworkWifiNotificationChanged event is triggered when the WiFi-related notifications enabled status is changed.
1671 /// <param name="sender"></param>
1672 /// <param name="e">The NetworkWifiNotificationChangedEventArgs object that contains the key and the changed value.</param>
1673 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1674 /// <privlevel>platform</privlevel>
1675 public static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> NetworkWifiNotificationSettingChanged
1679 if (s_networkWifiNotificationChanged == null)
1681 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback, IntPtr.Zero);
1682 if (ret != SystemSettingsError.None)
1684 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1687 s_networkWifiNotificationChanged += value;
1692 s_networkWifiNotificationChanged -= value;
1693 if (s_networkWifiNotificationChanged == null)
1695 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled);
1696 if (ret != SystemSettingsError.None)
1698 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1704 private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkFlightModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1706 bool networkFlightMode = SystemSettings.NetworkFlightModeEnabled;
1707 NetworkFlightModeSettingChangedEventArgs eventArgs = new NetworkFlightModeSettingChangedEventArgs(networkFlightMode);
1708 s_networkFlightModeChanged?.Invoke(null, eventArgs);
1710 private static event EventHandler<NetworkFlightModeSettingChangedEventArgs> s_networkFlightModeChanged;
1712 /// The NetworkFlightModeChanged event is triggered when the flight mode status is changed.
1714 /// <param name="sender"></param>
1715 /// <param name="e">The NetworkFlightModeChangedEventArgs object that contains the key and the changed value.</param>
1716 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1717 /// <privlevel>platform</privlevel>
1718 public static event EventHandler<NetworkFlightModeSettingChangedEventArgs> NetworkFlightModeSettingChanged
1722 if (s_networkFlightModeChanged == null)
1724 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback, IntPtr.Zero);
1725 if (ret != SystemSettingsError.None)
1727 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1730 s_networkFlightModeChanged += value;
1735 s_networkFlightModeChanged -= value;
1736 if (s_networkFlightModeChanged == null)
1738 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkFlightModeEnabled);
1739 if (ret != SystemSettingsError.None)
1741 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1747 private static readonly Interop.Settings.SystemSettingsChangedCallback s_screenBacklightTimeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1749 int screenBacklightTime = SystemSettings.ScreenBacklightTime;
1750 ScreenBacklightTimeChangedEventArgs eventArgs = new ScreenBacklightTimeChangedEventArgs(screenBacklightTime);
1751 s_screenBacklightTimeChanged?.Invoke(null, eventArgs);
1753 private static event EventHandler<ScreenBacklightTimeChangedEventArgs> s_screenBacklightTimeChanged;
1755 /// THe ScreenBacklightTimeChanged event is triggered when the backlight time is changed.
1757 /// <param name="sender"></param>
1758 /// <param name="e">The ScreenBacklightTimeChangedEventArgs object that contains the key and the changed value.</param>
1759 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1760 /// <privlevel>platform</privlevel>
1761 public static event EventHandler<ScreenBacklightTimeChangedEventArgs> ScreenBacklightTimeChanged
1765 if (s_screenBacklightTimeChanged == null)
1767 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback, IntPtr.Zero);
1768 if (ret != SystemSettingsError.None)
1770 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1773 s_screenBacklightTimeChanged += value;
1778 s_screenBacklightTimeChanged -= value;
1779 if (s_screenBacklightTimeChanged == null)
1781 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.ScreenBacklightTime);
1782 if (ret != SystemSettingsError.None)
1784 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1790 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1792 string soundNotification = SystemSettings.SoundNotification;
1793 SoundNotificationChangedEventArgs eventArgs = new SoundNotificationChangedEventArgs(soundNotification);
1794 s_soundNotificationChanged?.Invoke(null, eventArgs);
1796 private static event EventHandler<SoundNotificationChangedEventArgs> s_soundNotificationChanged;
1798 /// The SoundNotificationChanged event is triggered when the file path of the current notification tone set by the user is changed.
1800 /// <param name="sender"></param>
1801 /// <param name="e">The SoundNotificationChangedEventArgs object that contains the key and the changed value.</param>
1802 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1803 /// <privlevel>platform</privlevel>
1804 public static event EventHandler<SoundNotificationChangedEventArgs> SoundNotificationChanged
1808 if (s_soundNotificationChanged == null)
1810 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback, IntPtr.Zero);
1811 if (ret != SystemSettingsError.None)
1813 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1816 s_soundNotificationChanged += value;
1821 s_soundNotificationChanged -= value;
1822 if (s_soundNotificationChanged == null)
1824 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotification);
1825 if (ret != SystemSettingsError.None)
1827 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1833 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationRepetitionPeriodChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1835 int soundNotificationRepetitionPeriod = SystemSettings.SoundNotificationRepetitionPeriod;
1836 SoundNotificationRepetitionPeriodChangedEventArgs eventArgs = new SoundNotificationRepetitionPeriodChangedEventArgs(soundNotificationRepetitionPeriod);
1837 s_soundNotificationRepetitionPeriodChanged?.Invoke(null, eventArgs);
1839 private static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> s_soundNotificationRepetitionPeriodChanged;
1841 /// The SoundNotificationRepetitionPeriodChanged event is triggered when the time period for notification repetitions is changed.
1843 /// <param name="sender"></param>
1844 /// <param name="e">The SoundNotificationRepetitionPeriodChangedEventArgs object that contains the key and the changed value.</param>
1845 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1846 /// <privlevel>platform</privlevel>
1847 public static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> SoundNotificationRepetitionPeriodChanged
1851 if (s_soundNotificationRepetitionPeriodChanged == null)
1853 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback, IntPtr.Zero);
1854 if (ret != SystemSettingsError.None)
1856 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1859 s_soundNotificationRepetitionPeriodChanged += value;
1864 s_soundNotificationRepetitionPeriodChanged -= value;
1865 if (s_soundNotificationRepetitionPeriodChanged == null)
1867 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod);
1868 if (ret != SystemSettingsError.None)
1870 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1876 private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockStateChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1878 SystemSettingsIdleLockState lockState = SystemSettings.LockState;
1879 LockStateChangedEventArgs eventArgs = new LockStateChangedEventArgs(lockState);
1880 s_lockStateChanged?.Invoke(null, eventArgs);
1882 private static event EventHandler<LockStateChangedEventArgs> s_lockStateChanged;
1884 /// The LockStateChanged event is triggered when the current lock state is changed.
1886 /// <param name="sender"></param>
1887 /// <param name="e">The LockStateChangedEventArgs object that contains the key and the changed value.</param>
1888 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1889 /// <privlevel>platform</privlevel>
1890 public static event EventHandler<LockStateChangedEventArgs> LockStateChanged
1894 if (s_lockStateChanged == null)
1896 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback, IntPtr.Zero);
1897 if (ret != SystemSettingsError.None)
1899 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1902 s_lockStateChanged += value;
1907 s_lockStateChanged -= value;
1908 if (s_lockStateChanged == null)
1910 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockState);
1911 if (ret != SystemSettingsError.None)
1913 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1919 private static readonly Interop.Settings.SystemSettingsChangedCallback s_adsIdChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1921 string adsId = SystemSettings.AdsId;
1922 AdsIdChangedEventArgs eventArgs = new AdsIdChangedEventArgs(adsId);
1923 s_adsIdChanged?.Invoke(null, eventArgs);
1925 private static event EventHandler<AdsIdChangedEventArgs> s_adsIdChanged;
1927 /// The AdsIdChanged event is triggered when the current ADS ID state is changed.
1929 /// <param name="sender"></param>
1930 /// <param name="e">The AdsIdChangedEventArgs object that contains the key and the changed value.</param>
1931 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1932 /// <privlevel>platform</privlevel>
1933 public static event EventHandler<AdsIdChangedEventArgs> AdsIdChanged
1937 if (s_adsIdChanged == null)
1939 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback, IntPtr.Zero);
1940 if (ret != SystemSettingsError.None)
1942 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1945 s_adsIdChanged += value;
1950 s_adsIdChanged -= value;
1951 if (s_adsIdChanged == null)
1953 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AdsId);
1954 if (ret != SystemSettingsError.None)
1956 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1962 private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSaveChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1964 SystemSettingsUdsState ultraDataSave = SystemSettings.UltraDataSave;
1965 UltraDataSaveChangedEventArgs eventArgs = new UltraDataSaveChangedEventArgs(ultraDataSave);
1966 s_ultraDataSaveChanged?.Invoke(null, eventArgs);
1968 private static event EventHandler<UltraDataSaveChangedEventArgs> s_ultraDataSaveChanged;
1970 /// The UltraDataSaveChanged event is triggered when the current Ultra Data Save state is changed.
1972 /// <param name="sender"></param>
1973 /// <param name="e">The UltraDataSaveChangedEventArgs object that contains the key and the changed value.</param>
1974 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1975 /// <privlevel>platform</privlevel>
1976 public static event EventHandler<UltraDataSaveChangedEventArgs> UltraDataSaveChanged
1980 if (s_ultraDataSaveChanged == null)
1982 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback, IntPtr.Zero);
1983 if (ret != SystemSettingsError.None)
1985 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1988 s_ultraDataSaveChanged += value;
1993 s_ultraDataSaveChanged -= value;
1994 if (s_ultraDataSaveChanged == null)
1996 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSave);
1997 if (ret != SystemSettingsError.None)
1999 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2005 private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSavePackageListChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2007 string ultraDataSavePackageList = "None";
2008 UltraDataSavePackageListChangedEventArgs eventArgs = new UltraDataSavePackageListChangedEventArgs(ultraDataSavePackageList);
2009 s_ultraDataSavePackageListChanged?.Invoke(null, eventArgs);
2011 private static event EventHandler<UltraDataSavePackageListChangedEventArgs> s_ultraDataSavePackageListChanged;
2013 /// The UltraDataSavePackageListChanged event is triggered when the current ADS ID state is changed.
2015 /// <param name="sender"></param>
2016 /// <param name="e">The UltraDataSavePackageListChangedEventArgs object that contains the key and the changed value.</param>
2017 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2018 /// <privlevel>platform</privlevel>
2019 public static event EventHandler<UltraDataSavePackageListChangedEventArgs> UltraDataSavePackageListChanged
2023 if (s_ultraDataSavePackageListChanged == null)
2025 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback, IntPtr.Zero);
2026 if (ret != SystemSettingsError.None)
2028 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2031 s_ultraDataSavePackageListChanged += value;
2036 s_ultraDataSavePackageListChanged -= value;
2037 if (s_ultraDataSavePackageListChanged == null)
2039 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSavePackageList);
2040 if (ret != SystemSettingsError.None)
2042 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");