X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fstc-restriction.c;h=2f44459a14d3c2e0bd2236a77a3dd91301cfea5e;hb=bafd064cd4e4530782b5e4fd8e3f8cd6fb4a4284;hp=d4353ea2d5af205159e05405c4414a85299440a6;hpb=ba9186f949073543fcecf5f1d517a21b5141e7f0;p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git diff --git a/src/stc-restriction.c b/src/stc-restriction.c index d4353ea..2f44459 100644 --- a/src/stc-restriction.c +++ b/src/stc-restriction.c @@ -46,8 +46,11 @@ void __initialize_rstn_rule(table_restrictions_info *rule) rule->ifname = NULL; rule->iftype = STC_IFACE_ALL; rule->rstn_type = STC_RSTN_TYPE_UNKNOWN; - rule->data_limit = 0; - rule->data_warn_limit = 0; + rule->data_limit = -1; + rule->data_warn_limit = -1; + rule->monthly_limit = -1; + rule->weekly_limit = -1; + rule->daily_limit = -1; rule->roaming = STC_ROAMING_DISABLE; rule->subscriber_id = NULL; } @@ -114,6 +117,18 @@ void __stc_restriction_app_info_builder_add(GVariantBuilder *builder, g_variant_builder_add(builder, "{sv}", "data_warn_limit", g_variant_new_int64(info->data_warn_limit)); + g_variant_builder_add(builder, "{sv}", "month_start_date", + g_variant_new_int32(info->month_start_date)); + + g_variant_builder_add(builder, "{sv}", "monthly_limit", + g_variant_new_int64(info->monthly_limit)); + + g_variant_builder_add(builder, "{sv}", "weekly_limit", + g_variant_new_int64(info->weekly_limit)); + + g_variant_builder_add(builder, "{sv}", "daily_limit", + g_variant_new_int64(info->daily_limit)); + g_variant_builder_add(builder, "{sv}", "roaming", g_variant_new_uint16(info->roaming)); @@ -165,8 +180,6 @@ stc_cb_ret_e __table_restrictions_per_app_cb(const table_restrictions_info *info static void __stc_extract_restriction_rule(const char *key, GVariant *value, void *user_data) { - __STC_LOG_FUNC_ENTER__; - table_restrictions_info *rule = (table_restrictions_info *) user_data; if (rule == NULL) { @@ -198,6 +211,22 @@ static void __stc_extract_restriction_rule(const char *key, GVariant *value, rule->data_warn_limit = g_variant_get_int64(value); STC_LOGD("data_warn_limit: [%lld]", rule->data_warn_limit); + } else if (!g_strcmp0(key, "month_start_date")) { + rule->month_start_date = g_variant_get_int32(value); + STC_LOGD("month_start_date: [%d]", rule->month_start_date); + + } else if (!g_strcmp0(key, "monthly_limit")) { + rule->monthly_limit = g_variant_get_int64(value); + STC_LOGD("monthly_limit: [%lld]", rule->monthly_limit); + + } else if (!g_strcmp0(key, "weekly_limit")) { + rule->weekly_limit = g_variant_get_int64(value); + STC_LOGD("weekly_limit: [%lld]", rule->weekly_limit); + + } else if (!g_strcmp0(key, "daily_limit")) { + rule->daily_limit = g_variant_get_int64(value); + STC_LOGD("daily_limit: [%lld]", rule->daily_limit); + } else if (!g_strcmp0(key, "roaming")) { rule->roaming = g_variant_get_uint16(value); STC_LOGD("roaming: [%u]", rule->roaming); @@ -208,15 +237,13 @@ static void __stc_extract_restriction_rule(const char *key, GVariant *value, rule->subscriber_id = g_strdup(str); STC_LOGD("subscriber_id: [%s]", rule->subscriber_id); - } else if (!g_strcmp0(key, "type")) { + } else if (!g_strcmp0(key, "rstn_type")) { rule->rstn_type = g_variant_get_uint16(value); STC_LOGD("type: [%u]", (unsigned int) rule->rstn_type); } else { STC_LOGD("Unknown select rule"); //LCOV_EXCL_LINE } - - __STC_LOG_FUNC_EXIT__; } gboolean handle_restriction_set(StcRestriction *object,