add SYSTEM_SETTINGS_KEY_ADS_ID key 39/91439/11 accepted/tizen/3.0/common/20161114.105322 accepted/tizen/3.0/ivi/20161028.123018 accepted/tizen/3.0/mobile/20161028.122318 accepted/tizen/3.0/tv/20161028.122610 accepted/tizen/3.0/wearable/20161028.122856 accepted/tizen/common/20161018.175238 accepted/tizen/ivi/20161019.043959 accepted/tizen/mobile/20161019.043910 accepted/tizen/tv/20161019.043924 accepted/tizen/wearable/20161019.043945 submit/tizen/20161018.064127 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082323 submit/tizen_3.0_common/20161104.104000
authorMyoungJune Park <mj2004.park@samsung.com>
Fri, 7 Oct 2016 11:18:39 +0000 (20:18 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Thu, 13 Oct 2016 06:50:14 +0000 (15:50 +0900)
- append Since 3.0 as adviced

Change-Id: I87559316d648eaecef79da171076df766773c30a
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
CMakeLists.txt
include/system_settings.h
include/system_settings_private.h
packaging/capi-system-system-settings.spec
src/system_setting_platform.c
src/system_settings.c

index 31eff6d..7aa94cf 100755 (executable)
@@ -14,7 +14,7 @@ SET(LIBDIR "${CMAKE_LIBDIR}")
 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")
 
 
index da12fcc..4fee4a2 100644 (file)
@@ -63,36 +63,31 @@ typedef enum {
        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;
 
 /**
index 80734e7..1972e91 100644 (file)
@@ -1272,6 +1272,47 @@ int system_setting_set_changed_callback_lock_state(system_settings_key_e key, sy
  */
 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);
 
 /*// */
 
index 66efd50..3de6801 100755 (executable)
@@ -16,6 +16,7 @@ BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(alarm-service)
+BuildRequires:  pkgconfig(uuid)
 
 Requires(post): /sbin/ldconfig  
 Requires(postun): /sbin/ldconfig
index 5e3bdaa..863d029 100644 (file)
@@ -1879,4 +1879,70 @@ int system_setting_unset_changed_callback_lock_state(system_settings_key_e key)
 }
 /*  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);
+}
+
 
index ebcd240..4130032 100644 (file)
@@ -326,6 +326,16 @@ system_setting_s system_setting_table[] = {
                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
        }
 };