Modified the privilege to network.get from network.stc 32/129532/1 accepted/tizen/unified/20170517.125500 submit/tizen/20170517.032711 tizen_4.0.m1_release
authorhyunuktak <hyunuk.tak@samsung.com>
Wed, 17 May 2017 01:01:31 +0000 (10:01 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Wed, 17 May 2017 01:01:34 +0000 (10:01 +0900)
Change-Id: I02fa62b28f20187a59b9754877e454a5878bcda3
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
doc/stc_doc.h
include/stc_internal.h
packaging/capi-network-stc.spec
src/internal/include/stc-private.h
src/internal/include/stc-signal.h
src/internal/include/stc-util.h
src/internal/stc-private.c
src/internal/stc-signal.c
src/stc-manager.c

index 8ae28a6..e55f48d 100755 (executable)
@@ -30,7 +30,7 @@
  * This functions is used to initialize the settings of Smart Traffic Control.
  * @section CAPI_NETWORK_STC_MODULE_FEATURE Related Features
  * This API is related with the following features:\n
- * - http://tizen.org/feature/network.stc\n
+ * - http://tizen.org/feature/network.get\n
  *
  * It is recommended to use features in your application for reliability.\n
  *
@@ -60,7 +60,7 @@
  * - Set / Get / Remove / Exclude the restriction rule
  * @section CAPI_NETWORK_STC_MANAGER_MODULE_FEATURE Related Features
  * This API is related with the following features:\n
- * - http://tizen.org/feature/network.stc\n
+ * - http://tizen.org/feature/network.get\n
  *
  * It is recommended to use features in your application for reliability.\n
  *
@@ -87,7 +87,7 @@
  * The STC statistics API provides functions for managing STC statistics.
  * @section CAPI_NETWORK_STC_STATISTICS_FEATURE Related Features
  * This API is related with the following features:\n
- * - http://tizen.org/feature/network.stc\n
+ * - http://tizen.org/feature/network.get\n
  *
  * It is recommended to use features in your application for reliability.\n
  *
  * The STC restriction API provides functions for managing STC restrictions.
  * @section CAPI_NETWORK_STC_RESTRICTION_MODULE_FEATURE Related Features
  * This API is related with the following features:\n
- * - http://tizen.org/feature/network.stc\n
+ * - http://tizen.org/feature/network.get\n
  *
  * It is recommended to use features in your application for reliability.\n
  *
index c41deb2..0ace400 100755 (executable)
@@ -134,8 +134,11 @@ typedef enum {
  * @see        stc_get_restriction()
  * @see        stc_foreach_restriction()
  */
-typedef stc_callback_ret_e(*stc_restriction_info_cb)(
-               stc_error_e result, stc_restriction_info_h info, void *user_data);
+typedef stc_callback_ret_e(*stc_restriction_info_cb)(stc_error_e result,
+               stc_restriction_info_h info, void *user_data);
+
+typedef stc_callback_ret_e(*stc_threshold_clossed_cb)(stc_restriction_info_h info,
+               void *user_data);
 
 /**
 * @}
@@ -155,7 +158,7 @@ typedef stc_callback_ret_e(*stc_restriction_info_cb)(
  * @brief Resets stats information..
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The reset rule handle
@@ -195,7 +198,7 @@ int stc_reset_stats(stc_h stc, stc_reset_rule_h rule);
  *                     It will creates new restriction or modify existing.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The restriction rule handle
@@ -243,7 +246,7 @@ int stc_set_restriction(stc_h stc, stc_restriction_rule_h rule);
  *                     internet access, in case of whole network restriction.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The restriction rule handle
@@ -291,7 +294,7 @@ int stc_exclude_restriction(stc_h stc, stc_restriction_rule_h rule);
  *                     It will delete restriction rule in kernel.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The restriction rule handle
@@ -338,7 +341,7 @@ int stc_unset_restriction(stc_h stc, stc_restriction_rule_h rule);
  * @details The callback is called for each application that applied restriction.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The restriction rule handle
@@ -385,12 +388,22 @@ int stc_unset_restriction(stc_h stc, stc_restriction_rule_h rule);
 int stc_get_restriction(stc_h stc, stc_restriction_rule_h rule,
                stc_restriction_info_cb info_cb, void *user_data);
 
+int stc_set_restriction_threshold_crossed_cb(stc_h stc,
+               stc_threshold_clossed_cb clossed_cb, void *user_data);
+
+int stc_unset_restriction_threshold_crossed_cb(stc_h stc);
+
+int stc_set_warn_threshold_crossed_cb(stc_h stc,
+               stc_threshold_clossed_cb clossed_cb, void *user_data);
+
+int stc_unset_warn_threshold_crossed_cb(stc_h stc);
+
 /**
  * @brief Gets the restriction information of all application.
  * @details The callback is called for each application that applied restriction.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The restriction rule handle
@@ -441,7 +454,7 @@ int stc_foreach_restriction(stc_h stc, stc_restriction_rule_h rule,
  * @brief Gets the restriction status information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] stc The stc handle
  * @param[in] rule The restriction rule handle
@@ -499,7 +512,7 @@ int stc_get_restriction_status(stc_h stc, stc_restriction_rule_h rule,
  * @brief Creates the reset rule handle.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  * @remarks You must release @a handle using stc_reset_rule_destroy().
  *
  * @param[in] stc The stc handle
@@ -526,7 +539,7 @@ int stc_reset_rule_create(stc_h stc, stc_reset_rule_h *rule);
  * @brief Destroys the reset rule handle.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  *
@@ -549,7 +562,7 @@ int stc_reset_rule_destroy(stc_reset_rule_h rule);
  * @brief Sets the application ID for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[in] app_id The application ID
@@ -575,7 +588,7 @@ int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
  * @brief Sets the imsi for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[in] imsi The imsi
@@ -601,7 +614,7 @@ int stc_reset_rule_set_imsi(stc_reset_rule_h rule, const char *imsi);
  * @brief Sets the interface type for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[in] iface_type The interface type
@@ -629,7 +642,7 @@ int stc_reset_rule_set_iface_type(stc_reset_rule_h rule,
  * @brief Sets the time interval for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[in] from The time interval from
@@ -657,7 +670,7 @@ int stc_reset_rule_set_time_interval(stc_reset_rule_h rule,
  * @brief Sets the connection period for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[in] period The connection period
@@ -685,7 +698,7 @@ int stc_reset_rule_set_connection_period(stc_reset_rule_h rule,
  * @brief Gets the application ID for reset.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[out] app_id The application ID
@@ -711,7 +724,7 @@ int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
  * @brief Gets the imsi for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[out] imsi The imsi
@@ -737,7 +750,7 @@ int stc_reset_rule_get_imsi(stc_reset_rule_h rule, char **imsi);
  * @brief Gets the interface type for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[out] iface_type The interface type
@@ -765,7 +778,7 @@ int stc_reset_rule_get_iface_type(stc_reset_rule_h rule,
  * @brief Gets the time interval for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[out] from The time interval from
@@ -793,7 +806,7 @@ int stc_reset_rule_get_time_interval(stc_reset_rule_h rule,
  * @brief Gets the connection period for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
  * @param[out] period The connection period
@@ -831,7 +844,7 @@ int stc_reset_rule_get_connection_period(stc_reset_rule_h rule,
  * @brief Creates the restriction rule handle.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  * @remarks You must release @a handle using stc_restriction_rule_destroy().
  *
  * @param[in] stc The stc handle
@@ -858,7 +871,7 @@ int stc_restriction_rule_create(stc_h stc, stc_restriction_rule_h *rule);
  * @brief Destroys the restriction rule handle.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  *
@@ -881,7 +894,7 @@ int stc_restriction_rule_destroy(stc_restriction_rule_h rule);
  * @brief Sets the application ID for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] app_id The application ID
@@ -908,7 +921,7 @@ int stc_restriction_rule_set_app_id(stc_restriction_rule_h rule,
  * @brief Sets the interface name for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] iface_name The interface name
@@ -936,7 +949,7 @@ int stc_restriction_rule_set_iface_name(    stc_restriction_rule_h rule,
  * @brief Sets the interface type for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] iface_type The interface type
@@ -964,7 +977,7 @@ int stc_restriction_rule_set_iface_type(stc_restriction_rule_h rule,
  * @brief Sets the limit for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] rx_limit The receive limit
@@ -992,7 +1005,7 @@ int stc_restriction_rule_set_limit(stc_restriction_rule_h rule,
  * @brief Sets the warning limit for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] rx_warning_limit The receive warning limit
@@ -1020,7 +1033,7 @@ int stc_restriction_rule_set_warning_limit(stc_restriction_rule_h rule,
  * @brief Sets the roaming type for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] roaming_type The roaming type
@@ -1048,7 +1061,7 @@ int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule,
  * @brief Sets the imsi for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[in] imsi The imsi
@@ -1074,7 +1087,7 @@ int stc_restriction_rule_set_imsi(stc_restriction_rule_h rule, const char *imsi)
  * @brief Gets the application ID for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] app_id The application ID
@@ -1100,7 +1113,7 @@ int stc_restriction_rule_get_app_id(stc_restriction_rule_h rule, char **app_id);
  * @brief Gets the interface name for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] iface_name The interface name
@@ -1128,7 +1141,7 @@ int stc_restriction_rule_get_iface_name(stc_restriction_rule_h rule,
  * @brief Gets the interface type for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] iface_type The interface type
@@ -1156,7 +1169,7 @@ int stc_restriction_rule_get_iface_type(stc_restriction_rule_h rule,
  * @brief Gets the limit for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] rx_limit The receive limit
@@ -1184,7 +1197,7 @@ int stc_restriction_rule_get_limit(stc_restriction_rule_h rule,
  * @brief Gets the warning limit for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] rx_warning_limit The receive warning limit
@@ -1212,7 +1225,7 @@ int stc_restriction_rule_get_warning_limit(stc_restriction_rule_h rule,
  * @brief Gets the roaming type for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] roaming The roaming type
@@ -1240,7 +1253,7 @@ int stc_restriction_rule_get_roaming_type(stc_restriction_rule_h rule,
  * @brief Gets the imsi for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
  * @param[out] imsi The imsi
@@ -1289,7 +1302,7 @@ int stc_stats_info_get_imsi(stc_stats_info_h info, char **imsi);
  * @brief Gets the application ID for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] app_id The application ID
@@ -1313,7 +1326,7 @@ int stc_restriction_info_get_app_id(stc_restriction_info_h info, char **app_id);
  * @brief Gets the interface name for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] iface_name The interface name
@@ -1338,7 +1351,7 @@ int stc_restriction_info_get_iface_name(stc_restriction_info_h info,
  * @brief Gets the imsi for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] imsi The imsi
@@ -1362,7 +1375,7 @@ int stc_restriction_info_get_imsi(stc_restriction_info_h info, char **imsi);
  * @brief Gets the restriction status for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] status The restriction status
@@ -1388,7 +1401,7 @@ int stc_restriction_info_get_status(stc_restriction_info_h info,
  * @brief Gets the interface type for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] iface_type The interface type
@@ -1414,7 +1427,7 @@ int stc_restriction_info_get_iface_type(stc_restriction_info_h info,
  * @brief Gets the limit for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] rx_limit The receive limit
@@ -1440,7 +1453,7 @@ int stc_restriction_info_get_limit(stc_restriction_info_h info,
  * @brief Gets the warning limit for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] rx_warning_limit The receive warning limit
@@ -1466,7 +1479,7 @@ int stc_restriction_info_get_warning_limit(stc_restriction_info_h info,
  * @brief Gets the roaming type for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
- * @privilege %http://tizen.org/privilege/network.stc
+ * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
  * @param[out] roaming The roaming type
index 4e01f85..5fa9244 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-network-stc
 Summary:    A Smart Traffic Control (STC) libraries in Native API
-Version:    0.0.5
+Version:    0.0.6
 Release:    1
 Group:      Network & Connectivity/API
 License:    Apache-2.0
index 95700b9..48ab79a 100755 (executable)
@@ -69,6 +69,11 @@ typedef struct {
        void *restriction_user_data;
        stc_restriction_info_cb restriction_all_cb;
        void *restriction_all_user_data;
+
+       stc_threshold_clossed_cb restriction_crossed_cb;
+       void *restriction_crossed_user_data;
+       stc_threshold_clossed_cb warn_crossed_cb;
+       void *warn_crossed_user_data;
 } stc_handle_s;
 
 /**
@@ -120,6 +125,11 @@ void _stc_callback_set_restriction_info(stc_h stc,
 void _stc_callback_set_restriction_all_info(stc_h stc,
                        stc_restriction_info_cb user_cb, void *user_data);
 
+void _stc_callback_set_restriction_threshold_crossed(stc_h stc,
+                       stc_threshold_clossed_cb user_cb, void *user_data);
+void _stc_callback_set_warn_threshold_crossed(stc_h stc,
+                       stc_threshold_clossed_cb user_cb, void *user_data);
+
 #ifdef __cplusplus
 }
 #endif
index 447c066..11a325d 100755 (executable)
@@ -47,8 +47,10 @@ extern "C" {
 /*****************************************************************************
  *  Macros and Typedefs
  *****************************************************************************/
-#define STC_MANAGER_SIGNAL_STATS                       "Statistics"
-#define STC_MANAGER_SIGNAL_RESTRICTION         "Restriction"
+#define STC_SIGNAL_STATS                                       "Statistics"
+#define STC_SIGNAL_RESTRICTION                         "Restriction"
+#define STC_SIGNAL_WARN_THRESHOLD_CROSSED      "WarnThresholdCrossed"
+#define STC_SIGNAL_RESTRICTION_THRESHOLD_CROSSED "RestrictionThresholdCrossed"
 
 /*****************************************************************************
  *  Global Variables
index 754d48c..bdf648f 100755 (executable)
@@ -56,7 +56,7 @@
        } \
 } while (0)
 
-#define TIZEN_FEATURE_STC "tizen.org/feature/network.stc"
+#define TIZEN_FEATURE_STC "tizen.org/feature/network.get"
 
 #if 0
 #define CHECK_FEATURE_SUPPORTED(feature_name)\
index e05f99d..e556270 100755 (executable)
@@ -511,3 +511,21 @@ void _stc_callback_set_restriction_all_info(stc_h stc,
        handle->restriction_all_user_data = user_data;
 }
 
+void _stc_callback_set_restriction_threshold_crossed(stc_h stc,
+                       stc_threshold_clossed_cb user_cb, void *user_data)
+{
+       stc_handle_s *handle = (stc_handle_s *)stc;
+
+       handle->restriction_crossed_cb = user_cb;
+       handle->restriction_crossed_user_data = user_data;
+}
+
+void _stc_callback_set_warn_threshold_crossed(stc_h stc,
+                       stc_threshold_clossed_cb user_cb, void *user_data)
+{
+       stc_handle_s *handle = (stc_handle_s *)stc;
+
+       handle->warn_crossed_cb = user_cb;
+       handle->warn_crossed_user_data = user_data;
+}
+
index 2eef46e..a44c00c 100755 (executable)
@@ -75,7 +75,7 @@ static void __stc_stats_signal_filter(GDBusConnection *conn,
                const gchar *name, const gchar *path, const gchar *interface,
                const gchar *sig, GVariant *param, gpointer user_data)
 {
-       if (g_strcmp0(sig, STC_MANAGER_SIGNAL_STATS) == 0)
+       if (g_strcmp0(sig, STC_SIGNAL_STATS) == 0)
                __stc_handle_stats(param);
 }
 
@@ -83,7 +83,7 @@ static void __stc_restriction_signal_filter(GDBusConnection *conn,
                const gchar *name, const gchar *path, const gchar *interface,
                const gchar *sig, GVariant *param, gpointer user_data)
 {
-       if (g_strcmp0(sig, STC_MANAGER_SIGNAL_RESTRICTION) == 0)
+       if (g_strcmp0(sig, STC_SIGNAL_RESTRICTION) == 0)
                __stc_handle_restriction(param);
 }
 
index 5a086f3..387de52 100755 (executable)
@@ -327,6 +327,74 @@ EXPORT_API int stc_get_restriction(stc_h stc, stc_restriction_rule_h rule,
        return STC_ERROR_NONE;
 }
 
+EXPORT_API int stc_set_restriction_threshold_crossed_cb(stc_h stc,
+               stc_threshold_clossed_cb clossed_cb, void *user_data)
+{
+       CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
+
+       if (!(_stc_handle_check_validity(stc))) {
+               STC_LOGE("Invalid parameter");
+               return STC_ERROR_INVALID_PARAMETER;
+       }
+
+       if (clossed_cb == NULL) {
+               STC_LOGE("Invalid parameter");
+               return STC_ERROR_INVALID_PARAMETER;
+       }
+
+       _stc_callback_set_restriction_threshold_crossed(stc, clossed_cb, user_data);
+
+       return STC_ERROR_NONE;
+}
+
+EXPORT_API int stc_unset_restriction_threshold_crossed_cb(stc_h stc)
+{
+       CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
+
+       if (!(_stc_handle_check_validity(stc))) {
+               STC_LOGE("Invalid parameter");
+               return STC_ERROR_INVALID_PARAMETER;
+       }
+
+       _stc_callback_set_restriction_threshold_crossed(stc, NULL, NULL);
+
+       return STC_ERROR_NONE;
+}
+
+EXPORT_API int stc_set_warn_threshold_crossed_cb(stc_h stc,
+               stc_threshold_clossed_cb clossed_cb, void *user_data)
+{
+       CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
+
+       if (!(_stc_handle_check_validity(stc))) {
+               STC_LOGE("Invalid parameter");
+               return STC_ERROR_INVALID_PARAMETER;
+       }
+
+       if (clossed_cb == NULL) {
+               STC_LOGE("Invalid parameter");
+               return STC_ERROR_INVALID_PARAMETER;
+       }
+
+       _stc_callback_set_warn_threshold_crossed(stc, clossed_cb, user_data);
+
+       return STC_ERROR_NONE;
+}
+
+EXPORT_API int stc_unset_warn_threshold_crossed_cb(stc_h stc)
+{
+       CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
+
+       if (!(_stc_handle_check_validity(stc))) {
+               STC_LOGE("Invalid parameter");
+               return STC_ERROR_INVALID_PARAMETER;
+       }
+
+       _stc_callback_set_warn_threshold_crossed(stc, NULL, NULL);
+
+       return STC_ERROR_NONE;
+}
+
 EXPORT_API int stc_foreach_restriction(stc_h stc, stc_restriction_rule_h rule,
                stc_restriction_info_cb info_cb, void *user_data)
 {