SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(requires "dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info alarm-service")
+SET(requires "dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info alarm-service uuid")
SET(pc_requires "capi-base-common")
SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, /**< (string) The file path of the current lock screen wallpaper */
SYSTEM_SETTINGS_KEY_FONT_SIZE, /**< (int) The current system font size */
SYSTEM_SETTINGS_KEY_FONT_TYPE, /**< (string) The current system font type */
-
SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, /**< (bool) Indicates whether the motion service is activated */
SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, /**< (string) The file path of the current email alert ringtone */
SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED, /**< (bool) Indicates whether the USB debugging is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, /**< bool) Indicates whether the 3G data network is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP = SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED+2, /**< (string) Indicates lockscreen app pkg name */
-
SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE,/**< (string) The current system default font type (only support Get) */
SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, /**< (string) Indicates the 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) Indicates the 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) Indicates whether the 24-hour clock is used. If the value is @c false, the 12-hour clock is used. */
SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, /**< (string) Indicates the current time zone. */
-
SYSTEM_SETTINGS_KEY_TIME_CHANGED, /**< (int) Once System changes time, this event occurs to notify time change. */
SYSTEM_SETTINGS_KEY_SOUND_LOCK, /**< GET (bool) Indicates whether the screen lock sound is enabled on the device. ex) LCD on/off sound */
SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, /**< GET (bool) Indicates whether the device is in the silent mode. */
SYSTEM_SETTINGS_KEY_SOUND_TOUCH, /**< GET (bool) Indicates whether the screen touch sound is enabled on the device. */
SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, /**< GET (bool) Indicates whether rotation control is automatic.*/
-
SYSTEM_SETTINGS_KEY_DEVICE_NAME, /**< GET (string) Indicates device name. */
SYSTEM_SETTINGS_KEY_MOTION_ENABLED, /**< GET (bool) Indicates whether the device user has enabled the motion feature. */
SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, /**< GET (bool) Indicates whether Wi-Fi-related notifications are enabled on the device. */
SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, /**< GET (bool) Indicates whether the device is in the flight mode. */
SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, /**< (int) Indicates the backlight time (in seconds). @internal The following values can be used: 15, 30, 60, 120, 300, and 600. */
-
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, /**< (string) Indicates the file path of the current notification tone set by the user. */
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, /**< (int) Indicates the time period for notification repetitions. */
SYSTEM_SETTINGS_KEY_LOCK_STATE, /**< (int) Indicates the current lock state */
+ SYSTEM_SETTINGS_KEY_ADS_ID, /**< (string) Indicates Ads ID for each device (Since 3.0) */
SYSTEM_SETTINGS_KEY_MAX,
-
} system_settings_key_e;
/**
*/
int system_setting_unset_changed_callback_lock_state(system_settings_key_e key);
+/**
+ * @internal
+ * @brief get current ADS ID
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_get_ads_id(system_settings_key_e key, system_setting_data_type_e data_type, void **value);
+
+/**
+ * @internal
+ * @brief set ADS ID
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_set_ads_id(system_settings_key_e key, system_setting_data_type_e data_type, void *value);
+
+/**
+ * @internal
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_set_changed_callback_ads_id(system_settings_key_e key, system_settings_changed_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_unset_changed_callback_ads_id(system_settings_key_e key);
/*// */
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(alarm-service)
+BuildRequires: pkgconfig(uuid)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
}
/* LCOV_EXCL_STOP */
+//----------------------------------------------------------------------------------------------------------------------------
+
+#define DEFAULT_ADS_ID "00000000-0000-0000-0000-000000000000"
+
+int system_setting_get_ads_id(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ SETTING_TRACE_BEGIN;
+ int optout_value = 0;
+ if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_AD_ID_OPT_OUT, &optout_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ if (optout_value == 1) {
+ *value = strdup(DEFAULT_ADS_ID);
+ return SYSTEM_SETTINGS_ERROR_NONE;
+ }
+
+ char *vconf_value = NULL;
+ if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_AD_ID, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ *value = vconf_value;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+
+#if 0
+void make_ad_id(void)
+{
+ uuid_t uuid_value;
+ char uuid_unparsed[50] = {0};
+ uuid_generate(uuid_value);
+ uuid_unparse(uuid_value, uuid_unparsed);
+ system_setting_set_ad_id(key, uuid_unparsed); //example of setting the value
+}
+#endif
+/* LCOV_EXCL_START */
+int system_setting_set_ads_id(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ char *vconf_value = NULL;
+ vconf_value = (char *)value;
+
+ if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_AD_ID, vconf_value))
+ {
+ SETTING_TRACE("Setting VCONFKEY_SETAPPL_AD_ID failed");
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+/* LCOV_EXCL_STOP */
+
+int system_setting_set_changed_callback_ads_id(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_AD_ID, SYSTEM_SETTINGS_KEY_ADS_ID, 0, user_data);
+}
+
+int system_setting_unset_changed_callback_ads_id(system_settings_key_e key)
+{
+ SETTING_TRACE_BEGIN;
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_AD_ID, 0);
+}
+
NULL /* user data */
},
{
+ SYSTEM_SETTINGS_KEY_ADS_ID,
+ SYSTEM_SETTING_DATA_TYPE_STRING,
+ system_setting_get_ads_id,
+ system_setting_set_ads_id,
+ system_setting_set_changed_callback_ads_id,
+ system_setting_unset_changed_callback_ads_id,
+ NULL,
+ NULL /* user data */
+ },
+ {
SYSTEM_SETTINGS_MAX, -1, NULL, NULL, NULL, NULL, NULL, NULL
}
};