From: hyunuktak Date: Wed, 19 Sep 2018 00:50:29 +0000 (+0900) Subject: Modified roaming and ground enum X-Git-Tag: submit/tizen/20180919.090201~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77fa516dcfbadc1ab0218fe6a17becfc8ad38b1a;p=platform%2Fcore%2Fapi%2Fsmart-traffic-control.git Modified roaming and ground enum Change-Id: Ia73c2a6396897411cda1f308391cbd949883769b Signed-off-by: hyunuktak --- diff --git a/include/stc.h b/include/stc.h index e5b5339..560a25a 100755 --- a/include/stc.h +++ b/include/stc.h @@ -148,9 +148,8 @@ typedef enum { * @since_tizen 4.0 */ typedef enum { - STC_ROAMING_UNKNOWN, /**< Roaming unknown */ + STC_ROAMING_DISABLED, /**< Not in roaming */ STC_ROAMING_ENABLED, /**< In roaming */ - STC_ROAMING_DISABLED, /**< Not in roaming */ } stc_roaming_type_e; /** @@ -175,9 +174,9 @@ typedef enum { * @since_tizen 4.0 */ typedef enum { - STC_PROCESS_STATE_UNKNOWN = 0, /**< Unknown state */ - STC_PROCESS_STATE_FOREGROUND = 1 << 1, /**< Foreground state */ - STC_PROCESS_STATE_BACKGROUND = 1 << 2, /**< Background state */ + STC_PROCESS_STATE_UNKNOWN, /**< Unknown state */ + STC_PROCESS_STATE_FOREGROUND, /**< Foreground state */ + STC_PROCESS_STATE_BACKGROUND, /**< Background state */ } stc_process_state_e; /** diff --git a/src/internal/stc-private.c b/src/internal/stc-private.c index eb7fbaa..2306c51 100755 --- a/src/internal/stc-private.c +++ b/src/internal/stc-private.c @@ -152,12 +152,10 @@ const char *_stc_convert_iface_type_to_string(stc_iface_type_e type) const char *_stc_convert_roaming_to_string(stc_roaming_type_e type) { switch (type) { - case STC_ROAMING_UNKNOWN: - return "Unknown"; - case STC_ROAMING_ENABLED: - return "Enable"; case STC_ROAMING_DISABLED: return "Disable"; + case STC_ROAMING_ENABLED: + return "Enable"; default: return "Unknown"; } diff --git a/src/stc-restriction.c b/src/stc-restriction.c index b5ad9c3..3ba77fc 100755 --- a/src/stc-restriction.c +++ b/src/stc-restriction.c @@ -234,8 +234,7 @@ static void __stc_restriction_print_rule( if (rule->subscriber_id[0] != '\0') STC_LOGD("Sub_id: [%s]", rule->subscriber_id); - if (rule->roaming_type != STC_ROAMING_UNKNOWN) - STC_LOGD("Roaming: [%s]", _stc_convert_roaming_to_string(rule->roaming_type)); + STC_LOGD("Roaming: [%s]", _stc_convert_roaming_to_string(rule->roaming_type)); if (rule->rstn_type != STC_RSTN_TYPE_UNKNOWN) STC_LOGD("Type: [%s]", _stc_convert_rstn_type_to_string(rule->rstn_type)); @@ -508,8 +507,7 @@ stc_error_e _stc_restriction_validate_rule( restriction_rule->month_start_date); } - STC_RETURN_VAL_IF(restriction_rule->roaming_type <= STC_ROAMING_UNKNOWN || - restriction_rule->roaming_type > STC_ROAMING_DISABLED, + STC_RETURN_VAL_IF(restriction_rule->roaming_type > STC_ROAMING_ENABLED, STC_ERROR_INVALID_PARAMETER, "Roaming type is not valid [%s]", _stc_convert_roaming_to_string(restriction_rule->roaming_type)); @@ -566,8 +564,7 @@ stc_error_e _stc_restriction_check_set_rule( "Invalid month start date [%d]", restriction_rule->month_start_date); - STC_RETURN_VAL_IF(restriction_rule->roaming_type <= STC_ROAMING_UNKNOWN || - restriction_rule->roaming_type > STC_ROAMING_DISABLED, + STC_RETURN_VAL_IF(restriction_rule->roaming_type > STC_ROAMING_ENABLED, STC_ERROR_INVALID_PARAMETER, "Roaming type is not valid [%s]", _stc_convert_roaming_to_string(restriction_rule->roaming_type)); @@ -670,8 +667,7 @@ stc_error_e _stc_restriction_check_remove_rule( "Invalid rx limit [%lld] bytes", restriction_rule->data_warn_limit); - STC_RETURN_VAL_IF(restriction_rule->roaming_type <= STC_ROAMING_UNKNOWN || - restriction_rule->roaming_type > STC_ROAMING_DISABLED, + STC_RETURN_VAL_IF(restriction_rule->roaming_type > STC_ROAMING_ENABLED, STC_ERROR_INVALID_PARAMETER, "Roaming type is not valid [%d]", restriction_rule->roaming_type); @@ -712,8 +708,7 @@ stc_error_e _stc_restriction_check_exclude_rule( "Invalid rx limit [%lld] bytes", restriction_rule->data_warn_limit); - STC_RETURN_VAL_IF(restriction_rule->roaming_type <= STC_ROAMING_UNKNOWN || - restriction_rule->roaming_type > STC_ROAMING_DISABLED, + STC_RETURN_VAL_IF(restriction_rule->roaming_type > STC_ROAMING_ENABLED, STC_ERROR_INVALID_PARAMETER, "Roaming type is not valid [%d]", restriction_rule->roaming_type); @@ -1123,9 +1118,8 @@ EXPORT_API int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule (stc_restriction_rule_s *)rule; switch (roaming_type) { - case STC_ROAMING_UNKNOWN: - case STC_ROAMING_ENABLED: case STC_ROAMING_DISABLED: + case STC_ROAMING_ENABLED: restriction_rule->roaming_type = roaming_type; break; default: diff --git a/src/stc-statistics.c b/src/stc-statistics.c index 678785b..d4476ed 100755 --- a/src/stc-statistics.c +++ b/src/stc-statistics.c @@ -245,8 +245,7 @@ static void __stc_stats_print_info(stc_stats_info_s *info) if (info->subscriber_id[0] != '\0') STC_LOGD("Sub_id: [%s]", info->subscriber_id); - if (info->roaming_type != STC_ROAMING_UNKNOWN) - STC_LOGD("Roaming: [%d]", info->roaming_type); + STC_LOGD("Roaming: [%d]", info->roaming_type); STC_LOGD("Received: [%lld]", info->cnt.incoming_bytes); STC_LOGD("Sent: [%lld]", info->cnt.outgoing_bytes); diff --git a/test/restriction.c b/test/restriction.c index 201533d..1682f34 100755 --- a/test/restriction.c +++ b/test/restriction.c @@ -217,7 +217,7 @@ static int __test_stc_set_restriction_rule(MManager *mm, struct menu_data *menu) return ret; } - if (roaming > STC_ROAMING_UNKNOWN && roaming <= STC_ROAMING_DISABLED) { + if (roaming <= STC_ROAMING_ENABLED) { ret = stc_restriction_rule_set_roaming_type(g_restriction_rule, roaming); if (ret == STC_ERROR_NONE) msg(LOG_GREEN "Success to set roaming type" LOG_END); @@ -555,7 +555,7 @@ static struct menu_data menu_restriction_rule[] = { { "2", "Subscriber ID", NULL, NULL, g_subscriber_id}, { "3", "Interface type(1.Tel/2.Wifi/3.Wired/4.BT/5.All)", NULL, NULL, g_iface_type}, { "4", "Interface name", NULL, NULL, g_iface_name}, - { "5", "Roaming(1.Enable/2.Disable)", NULL, NULL, g_roaming}, + { "5", "Roaming(0.Disable/1.Enable)", NULL, NULL, g_roaming}, { "6", "Type(1.Accept/2.Drop)", NULL, NULL, g_rstn_type}, { "7", "Data limit", NULL, NULL, g_data_limit}, { "8", "Warn limit", NULL, NULL, g_data_warn_limit}, diff --git a/test/stc_test.c b/test/stc_test.c index 88a3638..54f01bf 100755 --- a/test/stc_test.c +++ b/test/stc_test.c @@ -109,12 +109,10 @@ const char *test_stc_convert_iface_type_to_string(stc_iface_type_e type) const char *test_stc_convert_roaming_to_string(stc_roaming_type_e type) { switch (type) { - case STC_ROAMING_UNKNOWN: - return "Unknown"; - case STC_ROAMING_ENABLED: - return "Enable"; case STC_ROAMING_DISABLED: return "Disable"; + case STC_ROAMING_ENABLED: + return "Enable"; default: return "Unknown"; }