Apply changes of capi-netwok-stc 06/178406/1 accepted/tizen/unified/20180510.134343 submit/tizen/20180510.023945
authorKiseok Chang <kiso.chang@samsung.com>
Thu, 10 May 2018 02:19:33 +0000 (11:19 +0900)
committerKiseok Chang <kiso.chang@samsung.com>
Thu, 10 May 2018 02:21:18 +0000 (11:21 +0900)
Change-Id: Idf9975dac52723ac10401e11aee71c52f26d98b3
Signed-off-by: Kiseok Chang <kiso.chang@samsung.com>
setting-smartmanager/smartmanager-data/include/smartmanager-utils.h [changed mode: 0644->0755]
setting-smartmanager/smartmanager-data/src/smartmanager-data-usage-mobile-settings.c
setting-smartmanager/smartmanager-data/src/smartmanager-data.c
setting-smartmanager/smartmanager-data/src/smartmanager-utils.c

old mode 100644 (file)
new mode 100755 (executable)
index 3b2a11b..c2b2c57
@@ -120,8 +120,8 @@ bool get_sim_apps_list(stc_h stc, stc_stats_info_cb stats_cb,
 bool get_wifi_apps_list(stc_h stc, stc_stats_info_cb stats_cb, time_t t_from,
                                                time_t t_to);
 
-bool get_sim_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb);
-bool get_wifi_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb);
+bool get_sim_restrictions(stc_h stc, stc_restriction_rule_cb restrictions_cb);
+bool get_wifi_restrictions(stc_h stc, stc_restriction_rule_cb restrictions_cb);
 bool get_subscriber_id_from_telephony_handle(telephony_h handle,
                                                                                                char **subscriber_id);
 bool compare_subscriber_ids(const char *id_a, const char *id_b);
@@ -132,7 +132,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        stc_restriction_rule_h rule, const char *subscriber_id, int64_t limit,
        int64_t warning_limit);
 bool unset_mobile_limit_restrictions(stc_h stc_handle,
-       stc_restriction_info_cb restrictions_cb, void *data);
+       stc_restriction_rule_cb restrictions_cb, void *data);
 
 bool write_sim_1_cycle_start(int cycle_start_value);
 bool write_sim_1_cycle_interval(int cycle_interval_value);
index 7ff200c80abe7b463eb5a8b5f17c08c3c64e7202..a1cbd24ad5c2153cb59d7c47ed5fc102f7492e68 100755 (executable)
@@ -248,7 +248,7 @@ static void create_toast_popup(Evas_Object *parent, char *text)
 }
 
 static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
-       stc_error_e result, stc_restriction_info_h info, void *user_data)
+       stc_error_e result, stc_restriction_rule_h rule, void *user_data)
 {
        int ret = STC_ERROR_NONE;
        char *app_id = NULL;
@@ -256,8 +256,8 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        int64_t limit = 0;
        int64_t warning_limit = 0;
        stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
-       stc_restriction_status_e status = STC_RESTRICTION_UNKNOWN;
-       stc_restriction_rule_h rule = NULL;
+       stc_restriction_type_e type = STC_RSTN_TYPE_UNKNOWN;
+       stc_restriction_rule_h mobile_rule = NULL;
        restrictions_result restrictions_res = RESTRICTIONS_ERROR;
        SmartMgrData *smd = (SmartMgrData *)user_data;
 
@@ -268,7 +268,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
                return STC_CALLBACK_CONTINUE;
        }
 
-       ret = stc_restriction_info_get_app_id(info, &app_id);
+       ret = stc_restriction_rule_get_app_id(rule, &app_id);
        if (STC_ERROR_NONE != ret || !app_id || strcmp("TOTAL_DATACALL", app_id)) {
                free(app_id);
                return STC_CALLBACK_CONTINUE;
@@ -276,16 +276,16 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        free(app_id);
 
-       ret = stc_restriction_info_get_status(info, &status);
+       ret = stc_restriction_rule_get_type(rule, &type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_info_get_status error: %s",
+               SETTING_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
                                                        get_error_message(ret));
                return STC_CALLBACK_CONTINUE;
        }
 
-       ret = stc_restriction_info_get_iface_type(info, &iface_type);
+       ret = stc_restriction_rule_get_iface_type(rule, &iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_info_get_iface_type error: %s",
+               SETTING_TRACE_ERROR("stc_restriction_rule_get_iface_type error: %s",
                                                        get_error_message(ret));
                return STC_CALLBACK_CONTINUE;
        }
@@ -293,33 +293,33 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        if (iface_type != STC_IFACE_DATACALL)
                return STC_CALLBACK_CONTINUE;
 
-       ret = stc_restriction_info_get_subscriber_id(info, &subscriber_id);
+       ret = stc_restriction_rule_get_subscriber_id(rule, &subscriber_id);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_info_get_subscriber_id error: %s",
+               SETTING_TRACE_ERROR("stc_restriction_rule_get_subscriber_id error: %s",
                        get_error_message(ret));
                return STC_CALLBACK_CONTINUE;
        }
 
        if (compare_subscriber_ids(smd->selected_sim_subscriber_id,
                subscriber_id)) {
-               ret = stc_restriction_info_get_limit(info, &limit);
+               ret = stc_restriction_rule_get_limit(rule, &limit);
                if (STC_ERROR_NONE != ret) {
-                       SETTING_TRACE_ERROR("stc_restriction_info_get_limit() error: %s",
+                       SETTING_TRACE_ERROR("stc_restriction_rule_get_limit() error: %s",
                                get_error_message(ret));
                        free(subscriber_id);
                        return STC_CALLBACK_CONTINUE;
                }
 
-               ret = stc_restriction_info_get_warning_limit(info, &warning_limit);
+               ret = stc_restriction_rule_get_warning_limit(rule, &warning_limit);
                if (STC_ERROR_NONE != ret) {
                        SETTING_TRACE_ERROR(
-                               "stc_restriction_info_get_warning_limit() error: %s",
+                               "stc_restriction_rule_get_warning_limit() error: %s",
                                get_error_message(ret));
                        free(subscriber_id);
                        return STC_CALLBACK_CONTINUE;
                }
 
-               ret = stc_restriction_rule_create(smd->stc, &rule);
+               ret = stc_restriction_rule_create(smd->stc, &mobile_rule);
                if (STC_ERROR_NONE != ret) {
                        SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                                                get_error_message(ret));
@@ -327,7 +327,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
                        return STC_CALLBACK_CONTINUE;
                }
 
-               restrictions_res = set_mobile_restriction_rule_parameters(rule,
+               restrictions_res = set_mobile_restriction_rule_parameters(mobile_rule,
                        subscriber_id, limit, warning_limit);
                if (restrictions_res != RESTRICTIONS_OK) {
                        SETTING_TRACE_ERROR(
@@ -336,7 +336,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
                        return STC_CALLBACK_CONTINUE;
                }
 
-               ret = stc_unset_restriction(smd->stc, rule);
+               ret = stc_unset_restriction(smd->stc, mobile_rule);
                if (STC_ERROR_NONE != ret) {
                        SETTING_TRACE_ERROR("stc_unset_restriction() error: %s",
                                                                                get_error_message(ret));
index 073b021664b6213e23b96d5f2045ad2ad83aee28..9e023635ace3a3231e0ee789398b6238883c5425 100755 (executable)
@@ -24,7 +24,7 @@ static stc_callback_ret_e _stc_stats_info_cb(stc_error_e result,
 static stc_callback_ret_e _total_stats_cb(stc_error_e result,
                                                                stc_stats_info_h info, void *user_data);
 static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
-                                                               stc_restriction_info_h info, void *user_data);
+                                                               stc_restriction_rule_h rule, void *user_data);
 
 static void _initialize_cycle(Data_Limits_T *limits);
 static void _read_all_stat_cycles(void);
@@ -640,13 +640,13 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
 }
 
 static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
-                                                               stc_restriction_info_h info, void *user_data)
+                                                               stc_restriction_rule_h rule, void *user_data)
 {
        int ret = STC_ERROR_NONE;
        char *app_id = NULL;
        char *subscriber_id = NULL;
        stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
-       stc_restriction_status_e status = STC_RESTRICTION_UNKNOWN;
+       stc_restriction_type_e type = STC_RSTN_TYPE_UNKNOWN;
 
        SETTING_TRACE_DEBUG("restriction cb:");
        if (STC_ERROR_NONE != result) {
@@ -655,7 +655,7 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
                return STC_CALLBACK_CONTINUE;
        }
 
-       (void)stc_restriction_info_get_app_id(info, &app_id);
+       (void)stc_restriction_rule_get_app_id(rule, &app_id);
        if (!app_id ||
                (strcmp("TOTAL_DATACALL", app_id) && strcmp("TOTAL_WIFI", app_id))) {
                free(app_id);
@@ -664,47 +664,47 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
        SETTING_TRACE_DEBUG("Obtaining restrictions for: %s", app_id);
        free(app_id);
 
-       ret = stc_restriction_info_get_status(info, &status);
+       ret = stc_restriction_rule_get_type(rule, &type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_info_get_status error: %s",
+               SETTING_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
                                                        get_error_message(ret));
                return STC_CALLBACK_CONTINUE;
        }
 
-       (void)stc_restriction_info_get_iface_type(info, &iface_type);
+       (void)stc_restriction_rule_get_iface_type(rule, &iface_type);
        SETTING_TRACE_DEBUG("Obtained iface: %d", iface_type);
        if (iface_type == STC_IFACE_DATACALL) {
 
-               ret = stc_restriction_info_get_subscriber_id(info, &subscriber_id);
+               ret = stc_restriction_rule_get_subscriber_id(rule, &subscriber_id);
 
                if (STC_ERROR_NONE == ret) {
                        SETTING_TRACE_DEBUG("Obtained Subscriber ID: %s", subscriber_id);
                        if (compare_subscriber_ids(ad.subscriber_id_1, subscriber_id)) {
-                               (void)stc_restriction_info_get_limit(info,
+                               stc_restriction_rule_get_limit(rule,
                                                                                                        &(ad.sim_1_limits.limit));
-                               (void)stc_restriction_info_get_warning_limit(info,
+                               stc_restriction_rule_get_warning_limit(rule,
                                                                                                        &(ad.sim_1_limits.warning));
                                ad.main_view_update_type = MV_UPDATE_SIM_1_WARN_N_LIMIT;
                        }
                        if (compare_subscriber_ids(ad.subscriber_id_2, subscriber_id)) {
-                               (void)stc_restriction_info_get_limit(info,
+                               stc_restriction_rule_get_limit(rule,
                                                                                                        &(ad.sim_2_limits.limit));
-                               (void)stc_restriction_info_get_warning_limit(info,
+                               stc_restriction_rule_get_warning_limit(rule,
                                                                                                        &(ad.sim_2_limits.warning));
                                ad.main_view_update_type = MV_UPDATE_SIM_2_WARN_N_LIMIT;
                        }
                        setting_view_update(ad.main_view, &ad);
                } else {
-                       SETTING_TRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
+                       SETTING_TRACE_ERROR("stc_stats_rule_get_subscriber_id() error: %s",
                                                                                get_error_message(ret));
                }
                free(subscriber_id);
        }
 
        if (iface_type == STC_IFACE_WIFI) {
-               (void)stc_restriction_info_get_limit(info,
+               stc_restriction_rule_get_limit(rule,
                                                                                                &(ad.wifi_limits.limit));
-               (void)stc_restriction_info_get_warning_limit(info,
+               stc_restriction_rule_get_warning_limit(rule,
                                                                                                &(ad.wifi_limits.warning));
                ad.main_view_update_type = MV_UPDATE_WIFI_WARN_N_LIMIT;
                setting_view_update(ad.main_view, &ad);
index 4212e95a7d7d7e030669df67dcb54191f7d4da4b..59ecfe5e06353e57ee54a475d75ce7b4fcc08af8 100755 (executable)
@@ -20,7 +20,7 @@ static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
                                                                stc_stats_info_cb stats_cb, void *cb_data,
                                                                time_t t_from, time_t t_to);
 static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
-                                                               stc_restriction_info_cb restrictions_cb,
+                                                               stc_restriction_rule_cb restrictions_cb,
                                                                void *restriction_info_cb_data);
 
 int get_days_in_current_month()
@@ -170,12 +170,12 @@ bool get_wifi_apps_list(stc_h stc, stc_stats_info_cb stats_cb, time_t t_from,
                                                                NULL, t_from, t_to);
 }
 
-bool get_sim_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb)
+bool get_sim_restrictions(stc_h stc, stc_restriction_rule_cb restrictions_cb)
 {
        return _get_restrictions(stc, STC_IFACE_DATACALL, restrictions_cb, NULL);
 }
 
-bool get_wifi_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb)
+bool get_wifi_restrictions(stc_h stc, stc_restriction_rule_cb restrictions_cb)
 {
        return _get_restrictions(stc, STC_IFACE_WIFI, restrictions_cb, NULL);
 }
@@ -278,7 +278,7 @@ static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
 }
 
 static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
-                                                               stc_restriction_info_cb restrictions_cb,
+                                                               stc_restriction_rule_cb restrictions_cb,
                                                                void *restriction_info_cb_data)
 {
        int ret = STC_ERROR_NONE;
@@ -439,7 +439,7 @@ restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
 }
 
 bool unset_mobile_limit_restrictions(stc_h stc_handle,
-       stc_restriction_info_cb _get_and_unset_limit_restrictions_cb, void *data)
+       stc_restriction_rule_cb _get_and_unset_limit_restrictions_cb, void *data)
 {
        return _get_restrictions(stc_handle, STC_IFACE_DATACALL,
                                                        _get_and_unset_limit_restrictions_cb, data);