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 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
768 /// <privlevel>platform</privlevel>
769 public static event EventHandler<IncomingCallRingtoneChangedEventArgs> IncomingCallRingtoneChanged
773 if (s_incomingCallRingtoneChanged == null)
775 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback, IntPtr.Zero);
776 if (ret != SystemSettingsError.None)
778 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
781 s_incomingCallRingtoneChanged += value;
786 s_incomingCallRingtoneChanged -= value;
787 if (s_incomingCallRingtoneChanged == null)
789 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.IncomingCallRingtone);
790 if (ret != SystemSettingsError.None)
792 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
798 private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperHomeScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
800 string path = SystemSettings.WallpaperHomeScreen;
801 WallpaperHomeScreenChangedEventArgs eventArgs = new WallpaperHomeScreenChangedEventArgs(path);
802 s_wallpaperHomeScreenChanged?.Invoke(null, eventArgs);
804 private static event EventHandler<WallpaperHomeScreenChangedEventArgs> s_wallpaperHomeScreenChanged;
806 /// THe WallpaperHomeScreenChanged event is triggered when the file path of the current home screen wallpaper is changed.
808 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
809 /// <privlevel>platform</privlevel>
810 public static event EventHandler<WallpaperHomeScreenChangedEventArgs> WallpaperHomeScreenChanged
814 if (s_wallpaperHomeScreenChanged == null)
816 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback, IntPtr.Zero);
817 if (ret != SystemSettingsError.None)
819 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
822 s_wallpaperHomeScreenChanged += value;
827 s_wallpaperHomeScreenChanged -= value;
828 if (s_wallpaperHomeScreenChanged == null)
830 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperHomeScreen);
831 if (ret != SystemSettingsError.None)
833 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
839 private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperLockScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
841 string path = SystemSettings.WallpaperLockScreen;
842 WallpaperLockScreenChangedEventArgs eventArgs = new WallpaperLockScreenChangedEventArgs(path);
843 s_wallpaperLockScreenChanged?.Invoke(null, eventArgs);
845 private static event EventHandler<WallpaperLockScreenChangedEventArgs> s_wallpaperLockScreenChanged;
847 /// The WallpaperLockScreenChanged event is triggered when the file path of the current lock screen wallpaper is changed.
849 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
850 /// <privlevel>platform</privlevel>
851 public static event EventHandler<WallpaperLockScreenChangedEventArgs> WallpaperLockScreenChanged
855 if (s_wallpaperLockScreenChanged == null)
857 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback, IntPtr.Zero);
858 if (ret != SystemSettingsError.None)
860 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
863 s_wallpaperLockScreenChanged += value;
868 s_wallpaperLockScreenChanged -= value;
869 if (s_wallpaperLockScreenChanged == null)
871 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperLockScreen);
872 if (ret != SystemSettingsError.None)
874 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
880 private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontSizeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
882 SystemSettingsFontSize fontSize = SystemSettings.FontSize;
883 FontSizeChangedEventArgs eventArgs = new FontSizeChangedEventArgs(fontSize);
884 s_fontSizeChanged?.Invoke(null, eventArgs);
886 private static event EventHandler<FontSizeChangedEventArgs> s_fontSizeChanged;
888 /// The FontSizeChanged event is triggered when the current system font size is changed.
890 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
891 /// <privlevel>platform</privlevel>
892 public static event EventHandler<FontSizeChangedEventArgs> FontSizeChanged
896 if (s_fontSizeChanged == null)
898 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback, IntPtr.Zero);
899 if (ret != SystemSettingsError.None)
901 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
904 s_fontSizeChanged += value;
909 s_fontSizeChanged -= value;
910 if (s_fontSizeChanged == null)
912 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontSize);
913 if (ret != SystemSettingsError.None)
915 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
921 private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontTypeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
923 string fontType = SystemSettings.FontType;
924 FontTypeChangedEventArgs eventArgs = new FontTypeChangedEventArgs(fontType);
925 s_fontTypeChanged?.Invoke(null, eventArgs);
927 private static event EventHandler<FontTypeChangedEventArgs> s_fontTypeChanged;
929 /// The FontTypeChanged event is triggered when the current system font type is changed.
931 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
932 /// <privlevel>platform</privlevel>
933 public static event EventHandler<FontTypeChangedEventArgs> FontTypeChanged
937 if (s_fontTypeChanged == null)
939 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback, IntPtr.Zero);
940 if (ret != SystemSettingsError.None)
942 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
945 s_fontTypeChanged += value;
950 s_fontTypeChanged -= value;
951 if (s_fontTypeChanged == null)
953 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontType);
954 if (ret != SystemSettingsError.None)
956 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
962 private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionActivationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
964 bool motionActivation = SystemSettings.MotionActivationEnabled;
965 MotionActivationSettingChangedEventArgs eventArgs = new MotionActivationSettingChangedEventArgs(motionActivation);
966 s_motionActivationChanged?.Invoke(null, eventArgs);
968 private static event EventHandler<MotionActivationSettingChangedEventArgs> s_motionActivationChanged;
970 /// The MotionActivationChanged event is triggered when the motion service status is changed.
972 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
973 /// <privlevel>platform</privlevel>
974 public static event EventHandler<MotionActivationSettingChangedEventArgs> MotionActivationSettingChanged
978 if (s_motionActivationChanged == null)
980 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback, IntPtr.Zero);
981 if (ret != SystemSettingsError.None)
983 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
986 s_motionActivationChanged += value;
991 s_motionActivationChanged -= value;
992 if (s_motionActivationChanged == null)
994 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionActivationEnabled);
995 if (ret != SystemSettingsError.None)
997 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1003 private static readonly Interop.Settings.SystemSettingsChangedCallback s_emailAlertRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1005 string emailAlertRingtone = SystemSettings.EmailAlertRingtone;
1006 EmailAlertRingtoneChangedEventArgs eventArgs = new EmailAlertRingtoneChangedEventArgs(emailAlertRingtone);
1007 s_emailAlertRingtoneChanged?.Invoke(null, eventArgs);
1009 private static event EventHandler<EmailAlertRingtoneChangedEventArgs> s_emailAlertRingtoneChanged;
1011 /// The EmailAlertRingtoneChanged event is triggered when the file path of the current email alert ringtone is changed.
1013 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1014 /// <privlevel>platform</privlevel>
1015 public static event EventHandler<EmailAlertRingtoneChangedEventArgs> EmailAlertRingtoneChanged
1019 if (s_emailAlertRingtoneChanged == null)
1021 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback, IntPtr.Zero);
1022 if (ret != SystemSettingsError.None)
1024 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1027 s_emailAlertRingtoneChanged += value;
1032 s_emailAlertRingtoneChanged -= value;
1033 if (s_emailAlertRingtoneChanged == null)
1035 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.EmailAlertRingtone);
1036 if (ret != SystemSettingsError.None)
1038 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1044 private static readonly Interop.Settings.SystemSettingsChangedCallback s_usbDebuggingSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1046 bool usbDebuggingEnabled = SystemSettings.UsbDebuggingEnabled;
1047 UsbDebuggingSettingChangedEventArgs eventArgs = new UsbDebuggingSettingChangedEventArgs(usbDebuggingEnabled);
1048 s_usbDebuggingSettingChanged?.Invoke(null, eventArgs);
1050 private static event EventHandler<UsbDebuggingSettingChangedEventArgs> s_usbDebuggingSettingChanged;
1052 /// The UsbDebuggingSettingChangedEventArgs event is triggered when the USB debugging status is changed.
1054 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1055 /// <privlevel>platform</privlevel>
1056 public static event EventHandler<UsbDebuggingSettingChangedEventArgs> UsbDebuggingSettingChanged
1060 if (s_usbDebuggingSettingChanged == null)
1062 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback, IntPtr.Zero);
1063 if (ret != SystemSettingsError.None)
1065 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1068 s_usbDebuggingSettingChanged += value;
1073 s_usbDebuggingSettingChanged -= value;
1074 if (s_usbDebuggingSettingChanged == null)
1076 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UsbDebuggingEnabled);
1077 if (ret != SystemSettingsError.None)
1079 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1085 private static readonly Interop.Settings.SystemSettingsChangedCallback s_data3GNetworkSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1087 bool data3GEnabled = SystemSettings.Data3GNetworkEnabled;
1088 Data3GNetworkSettingChangedEventArgs eventArgs = new Data3GNetworkSettingChangedEventArgs(data3GEnabled);
1089 s_data3GNetworkSettingChanged?.Invoke(null, eventArgs);
1091 private static event EventHandler<Data3GNetworkSettingChangedEventArgs> s_data3GNetworkSettingChanged;
1093 /// The Data3GNetworkSettingChanged event is triggered when the 3G data network status is changed.
1095 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1096 /// <privlevel>platform</privlevel>
1097 public static event EventHandler<Data3GNetworkSettingChangedEventArgs> Data3GNetworkSettingChanged
1101 if (s_data3GNetworkSettingChanged == null)
1103 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback, IntPtr.Zero);
1104 if (ret != SystemSettingsError.None)
1106 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1109 s_data3GNetworkSettingChanged += value;
1114 s_data3GNetworkSettingChanged -= value;
1115 if (s_data3GNetworkSettingChanged == null)
1117 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Data3GNetworkEnabled);
1118 if (ret != SystemSettingsError.None)
1120 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1126 private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockscreenAppChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1128 string lockScreenApp = SystemSettings.LockscreenApp;
1129 LockscreenAppChangedEventArgs eventArgs = new LockscreenAppChangedEventArgs(lockScreenApp);
1130 s_lockscreenAppChanged?.Invoke(null, eventArgs);
1132 private static event EventHandler<LockscreenAppChangedEventArgs> s_lockscreenAppChanged;
1134 /// The LockscreenAppChanged event is triggered when the lockscreen application package name is changed.
1136 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1137 /// <privlevel>platform</privlevel>
1138 public static event EventHandler<LockscreenAppChangedEventArgs> LockscreenAppChanged
1142 if (s_lockscreenAppChanged == null)
1144 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockscreenApp, s_lockscreenAppChangedCallback, IntPtr.Zero);
1145 if (ret != SystemSettingsError.None)
1147 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1150 s_lockscreenAppChanged += value;
1155 s_lockscreenAppChanged -= value;
1156 if (s_lockscreenAppChanged == null)
1158 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockscreenApp);
1159 if (ret != SystemSettingsError.None)
1161 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1167 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeCountryChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1169 string localeCountry = SystemSettings.LocaleCountry;
1170 LocaleCountryChangedEventArgs eventArgs = new LocaleCountryChangedEventArgs(localeCountry);
1171 s_localeCountryChanged?.Invoke(null, eventArgs);
1173 private static event EventHandler<LocaleCountryChangedEventArgs> s_localeCountryChanged;
1175 /// The LocaleCountryChanged event is triggered when the current country setting in the <LANGUAGE>_<REGION> syntax, is changed.
1177 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1178 /// <privlevel>platform</privlevel>
1179 public static event EventHandler<LocaleCountryChangedEventArgs> LocaleCountryChanged
1183 if (s_localeCountryChanged == null)
1185 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback, IntPtr.Zero);
1186 if (ret != SystemSettingsError.None)
1188 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1191 s_localeCountryChanged += value;
1196 s_localeCountryChanged -= value;
1197 if (s_localeCountryChanged == null)
1199 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleCountry);
1200 if (ret != SystemSettingsError.None)
1202 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1208 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeLanguageChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1210 string localeLanguage = SystemSettings.LocaleLanguage;
1211 LocaleLanguageChangedEventArgs eventArgs = new LocaleLanguageChangedEventArgs(localeLanguage);
1212 s_localeLanguageChanged?.Invoke(null, eventArgs);
1214 private static event EventHandler<LocaleLanguageChangedEventArgs> s_localeLanguageChanged;
1216 /// The LocaleLanguageChanged event is triggered when the current language setting in the <LANGUAGE>_<REGION> syntax, is changed.
1218 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1219 /// <privlevel>platform</privlevel>
1220 public static event EventHandler<LocaleLanguageChangedEventArgs> LocaleLanguageChanged
1224 if (s_localeLanguageChanged == null)
1226 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback, IntPtr.Zero);
1227 if (ret != SystemSettingsError.None)
1229 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1232 s_localeLanguageChanged += value;
1237 s_localeLanguageChanged -= value;
1238 if (s_localeLanguageChanged == null)
1240 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleLanguage);
1241 if (ret != SystemSettingsError.None)
1243 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1249 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeFormat24HourChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1251 bool localeTimeFormat24Hour = SystemSettings.LocaleTimeFormat24HourEnabled;
1252 LocaleTimeFormat24HourSettingChangedEventArgs eventArgs = new LocaleTimeFormat24HourSettingChangedEventArgs(localeTimeFormat24Hour);
1253 s_localeTimeFormat24HourChanged?.Invoke(null, eventArgs);
1255 private static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> s_localeTimeFormat24HourChanged;
1257 /// The LocaleTimeFormat24HourChanged event is triggered when the time format is changed.
1259 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1260 /// <privlevel>platform</privlevel>
1261 public static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> LocaleTimeFormat24HourSettingChanged
1265 if (s_localeTimeFormat24HourChanged == null)
1267 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback, IntPtr.Zero);
1268 if (ret != SystemSettingsError.None)
1270 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1273 s_localeTimeFormat24HourChanged += value;
1278 s_localeTimeFormat24HourChanged -= value;
1279 if (s_localeTimeFormat24HourChanged == null)
1281 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled);
1282 if (ret != SystemSettingsError.None)
1284 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1290 private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeZoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1292 string localeTimeZone = SystemSettings.LocaleTimeZone;
1293 LocaleTimeZoneChangedEventArgs eventArgs = new LocaleTimeZoneChangedEventArgs(localeTimeZone);
1294 s_localeTimeZoneChanged?.Invoke(null, eventArgs);
1296 private static event EventHandler<LocaleTimeZoneChangedEventArgs> s_localeTimeZoneChanged;
1298 /// The LocaleTimeZoneChanged event is triggered when the current time zone is changed.
1300 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1301 /// <privlevel>platform</privlevel>
1302 public static event EventHandler<LocaleTimeZoneChangedEventArgs> LocaleTimeZoneChanged
1306 if (s_localeTimeZoneChanged == null)
1308 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback, IntPtr.Zero);
1309 if (ret != SystemSettingsError.None)
1311 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1314 s_localeTimeZoneChanged += value;
1319 s_localeTimeZoneChanged -= value;
1320 if (s_localeTimeZoneChanged == null)
1322 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeZone);
1323 if (ret != SystemSettingsError.None)
1325 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1331 private static readonly Interop.Settings.SystemSettingsChangedCallback s_timeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1334 int time = SystemSettings.Time;
1335 TimeChangedEventArgs eventArgs = new TimeChangedEventArgs(time);
1336 s_timeChanged?.Invoke(null, eventArgs);
1338 private static event EventHandler<TimeChangedEventArgs> s_timeChanged;
1340 /// The TimeChanged event is triggered when the system time is changed.
1342 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1343 /// <privlevel>platform</privlevel>
1344 public static event EventHandler<TimeChangedEventArgs> TimeChanged
1348 if (s_timeChanged == null)
1350 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Time, s_timeChangedCallback, IntPtr.Zero);
1351 if (ret != SystemSettingsError.None)
1353 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1356 s_timeChanged += value;
1361 s_timeChanged -= value;
1362 if (s_timeChanged == null)
1364 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Time);
1365 if (ret != SystemSettingsError.None)
1367 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1373 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundLockChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1375 bool soundLock = SystemSettings.SoundLockEnabled;
1376 SoundLockSettingChangedEventArgs eventArgs = new SoundLockSettingChangedEventArgs(soundLock);
1377 s_soundLockChanged?.Invoke(null, eventArgs);
1379 private static event EventHandler<SoundLockSettingChangedEventArgs> s_soundLockChanged;
1381 /// The SoundLockChanged event is triggered when the screen lock sound enabled status is changed.
1383 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1384 /// <privlevel>platform</privlevel>
1385 public static event EventHandler<SoundLockSettingChangedEventArgs> SoundLockSettingChanged
1389 if (s_soundLockChanged == null)
1391 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback, IntPtr.Zero);
1392 if (ret != SystemSettingsError.None)
1394 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1397 s_soundLockChanged += value;
1402 s_soundLockChanged -= value;
1403 if (s_soundLockChanged == null)
1405 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundLockEnabled);
1406 if (ret != SystemSettingsError.None)
1408 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1414 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundSilentModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1416 bool soundSilentMode = SystemSettings.SoundSilentModeEnabled;
1417 SoundSilentModeSettingChangedEventArgs eventArgs = new SoundSilentModeSettingChangedEventArgs(soundSilentMode);
1418 s_soundSilentModeChanged?.Invoke(null, eventArgs);
1420 private static event EventHandler<SoundSilentModeSettingChangedEventArgs> s_soundSilentModeChanged;
1422 /// The SoundSilentModeChanged event is triggered when the silent mode status is changed.
1424 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1425 /// <privlevel>platform</privlevel>
1426 public static event EventHandler<SoundSilentModeSettingChangedEventArgs> SoundSilentModeSettingChanged
1430 if (s_soundSilentModeChanged == null)
1432 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback, IntPtr.Zero);
1433 if (ret != SystemSettingsError.None)
1435 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1438 s_soundSilentModeChanged += value;
1443 s_soundSilentModeChanged -= value;
1444 if (s_soundSilentModeChanged == null)
1446 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundSilentModeEnabled);
1447 if (ret != SystemSettingsError.None)
1449 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1455 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundTouchChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1457 bool soundTouch = SystemSettings.SoundTouchEnabled;
1458 SoundTouchSettingChangedEventArgs eventArgs = new SoundTouchSettingChangedEventArgs(soundTouch);
1459 s_soundTouchChanged?.Invoke(null, eventArgs);
1461 private static event EventHandler<SoundTouchSettingChangedEventArgs> s_soundTouchChanged;
1463 /// THe SoundTouchChanged event is triggered when the screen touch sound enabled status is changed.
1465 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1466 /// <privlevel>platform</privlevel>
1467 public static event EventHandler<SoundTouchSettingChangedEventArgs> SoundTouchSettingChanged
1471 if (s_soundTouchChanged == null)
1473 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback, IntPtr.Zero);
1474 if (ret != SystemSettingsError.None)
1476 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1479 s_soundTouchChanged += value;
1484 s_soundTouchChanged -= value;
1485 if (s_soundTouchChanged == null)
1487 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundTouchEnabled);
1488 if (ret != SystemSettingsError.None)
1490 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1496 private static readonly Interop.Settings.SystemSettingsChangedCallback s_displayScreenRotationAutoChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1498 bool displayScreenRotationAuto = SystemSettings.DisplayScreenRotationAutoEnabled;
1499 DisplayScreenRotationAutoSettingChangedEventArgs eventArgs = new DisplayScreenRotationAutoSettingChangedEventArgs(displayScreenRotationAuto);
1500 s_displayScreenRotationAutoChanged?.Invoke(null, eventArgs);
1502 private static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> s_displayScreenRotationAutoChanged;
1504 /// The DisplayScreenRotationAutoChanged event is triggered when the automatic rotation control status is changed.
1506 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1507 /// <privlevel>platform</privlevel>
1508 public static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> DisplayScreenRotationAutoSettingChanged
1512 if (s_displayScreenRotationAutoChanged == null)
1514 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback, IntPtr.Zero);
1515 if (ret != SystemSettingsError.None)
1517 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1520 s_displayScreenRotationAutoChanged += value;
1525 s_displayScreenRotationAutoChanged -= value;
1526 if (s_displayScreenRotationAutoChanged == null)
1528 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled);
1529 if (ret != SystemSettingsError.None)
1531 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1537 private static readonly Interop.Settings.SystemSettingsChangedCallback s_deviceNameChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1539 string deviceName = SystemSettings.DeviceName;
1540 DeviceNameChangedEventArgs eventArgs = new DeviceNameChangedEventArgs(deviceName);
1541 s_deviceNameChanged?.Invoke(null, eventArgs);
1543 private static event EventHandler<DeviceNameChangedEventArgs> s_deviceNameChanged;
1545 /// The DeviceNameChanged event is triggered when the device name is changed.
1547 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1548 /// <privlevel>platform</privlevel>
1549 public static event EventHandler<DeviceNameChangedEventArgs> DeviceNameChanged
1553 if (s_deviceNameChanged == null)
1555 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback, IntPtr.Zero);
1556 if (ret != SystemSettingsError.None)
1558 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1561 s_deviceNameChanged += value;
1566 s_deviceNameChanged -= value;
1567 if (s_deviceNameChanged == null)
1569 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DeviceName);
1570 if (ret != SystemSettingsError.None)
1572 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1578 private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1580 bool motionEnabled = SystemSettings.MotionEnabled;
1581 MotionSettingChangedEventArgs eventArgs = new MotionSettingChangedEventArgs(motionEnabled);
1582 s_motionSettingChanged?.Invoke(null, eventArgs);
1584 private static event EventHandler<MotionSettingChangedEventArgs> s_motionSettingChanged;
1586 /// The MotionSettingChanged event is triggered when the motion feature enabled status is changed.
1588 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1589 /// <privlevel>platform</privlevel>
1590 public static event EventHandler<MotionSettingChangedEventArgs> MotionSettingChanged
1594 if (s_motionSettingChanged == null)
1596 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback, IntPtr.Zero);
1597 if (ret != SystemSettingsError.None)
1599 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1602 s_motionSettingChanged += value;
1607 s_motionSettingChanged -= value;
1608 if (s_motionSettingChanged == null)
1610 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionEnabled);
1611 if (ret != SystemSettingsError.None)
1613 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1619 private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkWifiNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1621 bool networkWifiNotification = SystemSettings.NetworkWifiNotificationEnabled;
1622 NetworkWifiNotificationSettingChangedEventArgs eventArgs = new NetworkWifiNotificationSettingChangedEventArgs(networkWifiNotification);
1623 s_networkWifiNotificationChanged?.Invoke(null, eventArgs);
1625 private static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> s_networkWifiNotificationChanged;
1627 /// The NetworkWifiNotificationChanged event is triggered when the WiFi-related notifications enabled status is changed.
1629 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1630 /// <privlevel>platform</privlevel>
1631 public static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> NetworkWifiNotificationSettingChanged
1635 if (s_networkWifiNotificationChanged == null)
1637 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback, IntPtr.Zero);
1638 if (ret != SystemSettingsError.None)
1640 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1643 s_networkWifiNotificationChanged += value;
1648 s_networkWifiNotificationChanged -= value;
1649 if (s_networkWifiNotificationChanged == null)
1651 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled);
1652 if (ret != SystemSettingsError.None)
1654 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1660 private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkFlightModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1662 bool networkFlightMode = SystemSettings.NetworkFlightModeEnabled;
1663 NetworkFlightModeSettingChangedEventArgs eventArgs = new NetworkFlightModeSettingChangedEventArgs(networkFlightMode);
1664 s_networkFlightModeChanged?.Invoke(null, eventArgs);
1666 private static event EventHandler<NetworkFlightModeSettingChangedEventArgs> s_networkFlightModeChanged;
1668 /// The NetworkFlightModeChanged event is triggered when the flight mode status is changed.
1670 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1671 /// <privlevel>platform</privlevel>
1672 public static event EventHandler<NetworkFlightModeSettingChangedEventArgs> NetworkFlightModeSettingChanged
1676 if (s_networkFlightModeChanged == null)
1678 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback, IntPtr.Zero);
1679 if (ret != SystemSettingsError.None)
1681 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1684 s_networkFlightModeChanged += value;
1689 s_networkFlightModeChanged -= value;
1690 if (s_networkFlightModeChanged == null)
1692 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkFlightModeEnabled);
1693 if (ret != SystemSettingsError.None)
1695 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1701 private static readonly Interop.Settings.SystemSettingsChangedCallback s_screenBacklightTimeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1703 int screenBacklightTime = SystemSettings.ScreenBacklightTime;
1704 ScreenBacklightTimeChangedEventArgs eventArgs = new ScreenBacklightTimeChangedEventArgs(screenBacklightTime);
1705 s_screenBacklightTimeChanged?.Invoke(null, eventArgs);
1707 private static event EventHandler<ScreenBacklightTimeChangedEventArgs> s_screenBacklightTimeChanged;
1709 /// THe ScreenBacklightTimeChanged event is triggered when the backlight time is changed.
1711 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1712 /// <privlevel>platform</privlevel>
1713 public static event EventHandler<ScreenBacklightTimeChangedEventArgs> ScreenBacklightTimeChanged
1717 if (s_screenBacklightTimeChanged == null)
1719 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback, IntPtr.Zero);
1720 if (ret != SystemSettingsError.None)
1722 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1725 s_screenBacklightTimeChanged += value;
1730 s_screenBacklightTimeChanged -= value;
1731 if (s_screenBacklightTimeChanged == null)
1733 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.ScreenBacklightTime);
1734 if (ret != SystemSettingsError.None)
1736 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1742 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1744 string soundNotification = SystemSettings.SoundNotification;
1745 SoundNotificationChangedEventArgs eventArgs = new SoundNotificationChangedEventArgs(soundNotification);
1746 s_soundNotificationChanged?.Invoke(null, eventArgs);
1748 private static event EventHandler<SoundNotificationChangedEventArgs> s_soundNotificationChanged;
1750 /// The SoundNotificationChanged event is triggered when the file path of the current notification tone set by the user is changed.
1752 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1753 /// <privlevel>platform</privlevel>
1754 public static event EventHandler<SoundNotificationChangedEventArgs> SoundNotificationChanged
1758 if (s_soundNotificationChanged == null)
1760 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback, IntPtr.Zero);
1761 if (ret != SystemSettingsError.None)
1763 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1766 s_soundNotificationChanged += value;
1771 s_soundNotificationChanged -= value;
1772 if (s_soundNotificationChanged == null)
1774 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotification);
1775 if (ret != SystemSettingsError.None)
1777 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1783 private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationRepetitionPeriodChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1785 int soundNotificationRepetitionPeriod = SystemSettings.SoundNotificationRepetitionPeriod;
1786 SoundNotificationRepetitionPeriodChangedEventArgs eventArgs = new SoundNotificationRepetitionPeriodChangedEventArgs(soundNotificationRepetitionPeriod);
1787 s_soundNotificationRepetitionPeriodChanged?.Invoke(null, eventArgs);
1789 private static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> s_soundNotificationRepetitionPeriodChanged;
1791 /// The SoundNotificationRepetitionPeriodChanged event is triggered when the time period for notification repetitions is changed.
1793 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1794 /// <privlevel>platform</privlevel>
1795 public static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> SoundNotificationRepetitionPeriodChanged
1799 if (s_soundNotificationRepetitionPeriodChanged == null)
1801 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback, IntPtr.Zero);
1802 if (ret != SystemSettingsError.None)
1804 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1807 s_soundNotificationRepetitionPeriodChanged += value;
1812 s_soundNotificationRepetitionPeriodChanged -= value;
1813 if (s_soundNotificationRepetitionPeriodChanged == null)
1815 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod);
1816 if (ret != SystemSettingsError.None)
1818 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1824 private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockStateChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1826 SystemSettingsIdleLockState lockState = SystemSettings.LockState;
1827 LockStateChangedEventArgs eventArgs = new LockStateChangedEventArgs(lockState);
1828 s_lockStateChanged?.Invoke(null, eventArgs);
1830 private static event EventHandler<LockStateChangedEventArgs> s_lockStateChanged;
1832 /// The LockStateChanged event is triggered when the current lock state is changed.
1834 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1835 /// <privlevel>platform</privlevel>
1836 public static event EventHandler<LockStateChangedEventArgs> LockStateChanged
1840 if (s_lockStateChanged == null)
1842 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback, IntPtr.Zero);
1843 if (ret != SystemSettingsError.None)
1845 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1848 s_lockStateChanged += value;
1853 s_lockStateChanged -= value;
1854 if (s_lockStateChanged == null)
1856 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockState);
1857 if (ret != SystemSettingsError.None)
1859 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1865 private static readonly Interop.Settings.SystemSettingsChangedCallback s_adsIdChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1867 string adsId = SystemSettings.AdsId;
1868 AdsIdChangedEventArgs eventArgs = new AdsIdChangedEventArgs(adsId);
1869 s_adsIdChanged?.Invoke(null, eventArgs);
1871 private static event EventHandler<AdsIdChangedEventArgs> s_adsIdChanged;
1873 /// The AdsIdChanged event is triggered when the current ADS ID state is changed.
1875 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1876 /// <privlevel>platform</privlevel>
1877 public static event EventHandler<AdsIdChangedEventArgs> AdsIdChanged
1881 if (s_adsIdChanged == null)
1883 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback, IntPtr.Zero);
1884 if (ret != SystemSettingsError.None)
1886 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1889 s_adsIdChanged += value;
1894 s_adsIdChanged -= value;
1895 if (s_adsIdChanged == null)
1897 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AdsId);
1898 if (ret != SystemSettingsError.None)
1900 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1906 private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSaveChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1908 SystemSettingsUdsState ultraDataSave = SystemSettings.UltraDataSave;
1909 UltraDataSaveChangedEventArgs eventArgs = new UltraDataSaveChangedEventArgs(ultraDataSave);
1910 s_ultraDataSaveChanged?.Invoke(null, eventArgs);
1912 private static event EventHandler<UltraDataSaveChangedEventArgs> s_ultraDataSaveChanged;
1914 /// The UltraDataSaveChanged event is triggered when the current Ultra Data Save state is changed.
1916 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1917 /// <privlevel>platform</privlevel>
1918 public static event EventHandler<UltraDataSaveChangedEventArgs> UltraDataSaveChanged
1922 if (s_ultraDataSaveChanged == null)
1924 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback, IntPtr.Zero);
1925 if (ret != SystemSettingsError.None)
1927 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1930 s_ultraDataSaveChanged += value;
1935 s_ultraDataSaveChanged -= value;
1936 if (s_ultraDataSaveChanged == null)
1938 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSave);
1939 if (ret != SystemSettingsError.None)
1941 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1947 private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSavePackageListChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1949 string ultraDataSavePackageList = "None";
1950 UltraDataSavePackageListChangedEventArgs eventArgs = new UltraDataSavePackageListChangedEventArgs(ultraDataSavePackageList);
1951 s_ultraDataSavePackageListChanged?.Invoke(null, eventArgs);
1953 private static event EventHandler<UltraDataSavePackageListChangedEventArgs> s_ultraDataSavePackageListChanged;
1955 /// The UltraDataSavePackageListChanged event is triggered when the current ADS ID state is changed.
1957 /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1958 /// <privlevel>platform</privlevel>
1959 public static event EventHandler<UltraDataSavePackageListChangedEventArgs> UltraDataSavePackageListChanged
1963 if (s_ultraDataSavePackageListChanged == null)
1965 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback, IntPtr.Zero);
1966 if (ret != SystemSettingsError.None)
1968 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1971 s_ultraDataSavePackageListChanged += value;
1976 s_ultraDataSavePackageListChanged -= value;
1977 if (s_ultraDataSavePackageListChanged == null)
1979 SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSavePackageList);
1980 if (ret != SystemSettingsError.None)
1982 throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");