System Settings
Tizen provides functions for getting the system configuration related to user preferences.
The main features of the System Settings API include accessing system-wide configurations, such as ringtone, wallpaper, and font.
The system_settings_key_e enumerator defines all enumerations that work as arguments for the System Settings API.
The System Settings API provides 2 function types listed in the following table. Certain functions support both types, whereas others only support the getter function.
Function type | Methods | Description |
---|---|---|
GETTER |
system_settings_get_value_bool
system_settings_get_value_int system_settings_get_value_string |
Get the user-defined values by data type (bool, int, or string). |
NOTIFIER |
system_settings_set_changed_cb system_settings_unset_changed_cb |
Register and unregister callback functions when the SETTER related to the key is called. |
The following table lists the system settings details.
Key | Type | Supporting API type | Description |
---|---|---|---|
SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE | string | GETTER | Current system default font type. |
SYSTEM_SETTINGS_KEY_DEVICE_NAME | string | GETTER, NOTIFIER | Device name. |
SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO | bool | GETTER, NOTIFIER | Indicates whether rotation control is automatic. |
SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE | string | GETTER, NOTIFIER | File path of the current email alert ringtone. |
SYSTEM_SETTINGS_KEY_FONT_SIZE | int | GETTER, NOTIFIER | Current system font size. |
SYSTEM_SETTINGS_KEY_FONT_TYPE | string | GETTER, NOTIFIER | Current system font type. |
SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE | string | GETTER, NOTIFIER | File path of the current ringtone. |
SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY | string | GETTER, NOTIFIER | Current country setting in the <LANGUAGE>_<REGION> syntax. The country setting is in the ISO 639-2 format, and the region setting is in the ISO 3166-1 alpha-2 format. |
SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE | string | GETTER, NOTIFIER | Current language setting in the <LANGUAGE>_<REGION> syntax. The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format. |
SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR | bool | GETTER, NOTIFIER | Indicates whether the 24-hour clock is used. If the value is false, the 12-hour clock is used. |
SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE | string | GETTER, NOTIFIER | Current time zone. |
SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION | bool | GETTER, NOTIFIER | Indicates whether the motion service is activated. |
SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE | bool | GETTER, NOTIFIER | Indicates whether the device is in the flight mode. |
SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION | bool | GETTER, NOTIFIER | Indicates whether Wi-Fi-related notifications are enabled on the device. |
SYSTEM_SETTINGS_KEY_SOUND_LOCK | bool | GETTER, NOTIFIER | Indicates whether the screen lock sound is enabled on the device (for example, whether the LCD on/off sound is enabled). |
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION | string | GETTER, NOTIFIER | File path of the current notification tone set by the user. |
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD | int | GETTER, NOTIFIER | Time period for notification repetitions. |
SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE | bool | GETTER, NOTIFIER | Indicates whether the device is in the silent mode. |
SYSTEM_SETTINGS_KEY_SOUND_TOUCH | bool | GETTER, NOTIFIER | Indicates whether the screen touch sound is enabled on the device. |
SYSTEM_SETTINGS_KEY_TIME_CHANGED | int | NOTIFIER | Event that occurs when the system changes time to notify you about the time change. |
SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED | bool | GETTER, NOTIFIER | Indicates whether the USB debugging is enabled. |
SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN | string | GETTER, NOTIFIER | File path of the current home screen wallpaper. |
SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN | string | GETTER, NOTIFIER | File path of the current lock screen wallpaper. |
The following example shows a typical use case: An application sees the name of the current wallpaper and you want to print out a message when the wallpaper changes:
void _img_cb (system_settings_key_e key, void *user_data) { printf("THIS IS CALLED BY USER APPLICATION WHEN THE WALLPAPER CHANGES \n"); } // NOTIFIER 1 - Registering a callback function system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, _img_cb, NULL); char * path; // GETTER system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &path); printf ("path of the current wallpaper is %s \n", path); // NOTIFIER 2 - Deregistering a callback function system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN);