[SM][Mobile] Set IMSI in restriction rule 26/147026/3
authorPawel Aksiutowicz <p.aksiutowic@partner.samsung.com>
Thu, 31 Aug 2017 16:06:33 +0000 (18:06 +0200)
committerPawel Aksiutowicz <p.aksiutowic@partner.samsung.com>
Mon, 4 Sep 2017 13:47:57 +0000 (15:47 +0200)
Change-Id: I83cfb8cc31d0709ab6ef4d8dab4de2a24b544f34
Signed-off-by: Pawel Aksiutowicz <p.aksiutowic@partner.samsung.com>
setting-smartmanager/smartmanager-data/include/smartmanager-utils.h
setting-smartmanager/smartmanager-data/src/smartmanager-data-usage-mobile-settings.c
setting-smartmanager/smartmanager-data/src/smartmanager-utils.c

index 87a998ee6c9b72675edec582b7683d1b048085e0..0751726645510e9a8a41ed2b788a1b34e10fc282 100644 (file)
@@ -51,6 +51,6 @@ bool get_imsi_from_telephony_handle(telephony_h handle,
                                                                        char out_buff[], int len_max);
 bool compare_imsis(const char *imsi_a, const char *imsi_b);
 
-restrictions_result set_mobile_limit_restrictions(stc_h stc_handle, int64_t limit, int64_t warning_limit);
+restrictions_result set_mobile_limit_restrictions(stc_h stc_handle, const char *imsi, int64_t limit, int64_t warning_limit);
 
 #endif /* SMARTMANAGER_UTILS_H_ */
index 90fe8715026ff37873bb3f194f819fd1e2beca3b..8225aa2ac075201ca8892717fb3c12f133e7ce1a 100644 (file)
@@ -331,12 +331,14 @@ static void _popup_done_cb(void *data, Evas_Object *obj, void *event_info)
        if (limit_popup_data->element_type == ELEMENT_TYPE_WARNING) {
                res = set_mobile_limit_restrictions(
                                                                        limit_popup_data->smd->stc,
+                                                                       limit_popup_data->smd->selected_sim_imsi,
                                                                        limit_popup_data->smd->selected_sim_limits->limit,
                                                                        (int64_t)value);
 
        } else if (limit_popup_data->element_type == ELEMENT_TYPE_LIMIT) {
                res = set_mobile_limit_restrictions(
                                                                        limit_popup_data->smd->stc,
+                                                                       limit_popup_data->smd->selected_sim_imsi,
                                                                        (int64_t)value,
                                                                        limit_popup_data->smd->selected_sim_limits->warning);
        } else {
index ed18bbe0aab3d82cb3b920d66c751f52e24f3de0..903747042f4a1ddd49685b8004c5027ed6a55b96 100644 (file)
@@ -242,7 +242,7 @@ bool compare_imsis(const char *imsi_a, const char *imsi_b)
        return (0 == safeStrNCmp(imsi_a, imsi_b, 15));
 }
 
-restrictions_result set_mobile_limit_restrictions(stc_h stc_handle, int64_t limit, int64_t warning_limit)
+restrictions_result set_mobile_limit_restrictions(stc_h stc_handle, const char *imsi, int64_t limit, int64_t warning_limit)
 {
        SETTING_TRACE_BEGIN;
        int ret = STC_ERROR_NONE;
@@ -275,6 +275,14 @@ restrictions_result set_mobile_limit_restrictions(stc_h stc_handle, int64_t limi
                return RESTRICTIONS_VALUE_HIGHTER_THAN_MAX;
        }
 
+       ret = stc_restriction_rule_set_imsi(rule, imsi);
+       if (STC_ERROR_NONE != ret) {
+               (void)(void)stc_restriction_rule_destroy(rule);
+               SETTING_TRACE_ERROR("stc_restriction_rule_set_imsi() error: %s",
+                                                                                       get_error_message(ret));
+               return RESTRICTIONS_OTHER_ERROR;
+       }
+
        ret = stc_restriction_rule_set_limit(rule, limit);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);