Remove a parameter to indicate target zone in dpm_context_acquire_*_policy APIs 93/69393/3
authorSungbae Yoo <sungbae.yoo@samsung.com>
Fri, 13 May 2016 04:59:12 +0000 (13:59 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Fri, 13 May 2016 06:28:28 +0000 (15:28 +0900)
Change-Id: I6cde26b7365a94d2948a681b68e6672ffd9132ee
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
src/password.c
src/wifi.c

index 7a3ae97..ce1a192 100644 (file)
@@ -5,17 +5,16 @@
 /* dpm integration test & radio popup test */
 int set_password_quality_handler(struct dpm_toolkit_entity* self)
 {
-    dlog_print(DLOG_DEBUG, LOG_TAG, "set_password_quality_handler");
+       dlog_print(DLOG_DEBUG, LOG_TAG, "set_password_quality_handler");
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
        char radio_text[][MAX_RADIO_TEXT_LEN] = {"UNSPECIFIED", "SIMPLE_PASSWORD", "SOMETHING", "NUMERIC", "ALPHABETIC", "ALPHANUMERIC"};
        int radio_num = sizeof(radio_text) / sizeof(radio_text[0]);
        dpm_password_quality_e quality;
-       const char param_zone[] = "owner";
 
        handler_display_radio_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"), selected_policy, radio_text, radio_num);
-       
+
        dlog_print(DLOG_DEBUG, LOG_TAG, "radio index: %d", selected_policy->radio_index);
 
        switch(selected_policy->radio_index) {
@@ -40,7 +39,7 @@ int set_password_quality_handler(struct dpm_toolkit_entity* self)
                default:
                        quality = DPM_PASSWORD_QUALITY_UNSPECIFIED;
                        break;
-    }
+       }
 
        dlog_print(DLOG_DEBUG, LOG_TAG, "Password Quality: %s", radio_text[selected_policy->radio_index]);
 
@@ -50,19 +49,19 @@ int set_password_quality_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_quality(password_policy_handle, quality) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                return POLICY_RESULT_SUCCESS;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -73,9 +72,8 @@ int set_password_min_length_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int min_length;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -90,21 +88,21 @@ int set_password_min_length_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_minimum_length(password_policy_handle, min_length) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -115,9 +113,8 @@ int set_password_min_complex_chars_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int min_complex_chars;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -132,21 +129,21 @@ int set_password_min_complex_chars_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_min_complex_chars(password_policy_handle, min_complex_chars) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -157,9 +154,8 @@ int set_password_max_failed_attempts_for_wipe_handler(struct dpm_toolkit_entity*
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int max_failed_attempts;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -174,21 +170,21 @@ int set_password_max_failed_attempts_for_wipe_handler(struct dpm_toolkit_entity*
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_maximum_failed_attempts_for_wipe(password_policy_handle, max_failed_attempts) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -199,9 +195,8 @@ int set_password_expires_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int expired_day;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -216,21 +211,21 @@ int set_password_expires_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_expires(password_policy_handle, expired_day) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -241,9 +236,8 @@ int set_password_history_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int history;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -258,21 +252,21 @@ int set_password_history_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_history(password_policy_handle, history) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -283,8 +277,7 @@ int set_password_pattern_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
-       const char param_zone[] = "owner";
+       char* input;
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -297,21 +290,21 @@ int set_password_pattern_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_pattern(password_policy_handle, input) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -322,8 +315,7 @@ int reset_password_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
-       const char param_zone[] = "owner";
+       char* input;
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -336,21 +328,21 @@ int reset_password_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_reset(password_policy_handle, input) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -360,27 +352,26 @@ int enforce_password_change_handler(struct dpm_toolkit_entity* self)
        dlog_print(DLOG_DEBUG, LOG_TAG, "enforce_password_change_handler");
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
-       const char param_zone[] = "owner";
 
        handle = dpm_context_create();
        if (handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_enforce_change(password_policy_handle) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                return POLICY_RESULT_SUCCESS;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -391,9 +382,8 @@ int set_max_inactivity_time_device_lock_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int max_inactivity_time;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -408,21 +398,21 @@ int set_max_inactivity_time_device_lock_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_max_inactivity_time_device_lock(password_policy_handle, max_inactivity_time) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -435,29 +425,28 @@ int get_max_inactivity_time_device_lock_handler(struct dpm_toolkit_entity* self)
        dpm_toolkit_entity_t* selected_policy = self;
        char num_text[10];
        int max_inactivity_time;
-       const char param_zone[] = "owner";
 
        handle = dpm_context_create();
        if (handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_get_max_inactivity_time_device_lock(password_policy_handle, &max_inactivity_time) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                snprintf(num_text,sizeof(num_text),"%d",max_inactivity_time);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"), num_text);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -468,9 +457,8 @@ int set_password_status_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int status;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -485,21 +473,21 @@ int set_password_status_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_status(password_policy_handle, status) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -509,27 +497,26 @@ int delete_password_pattern_handler(struct dpm_toolkit_entity* self)
        dlog_print(DLOG_DEBUG, LOG_TAG, "delete_password_pattern_handler");
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
-       const char param_zone[] = "owner";
 
        handle = dpm_context_create();
        if (handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_delete_pattern(password_policy_handle) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                return POLICY_RESULT_SUCCESS;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -540,24 +527,23 @@ int get_password_pattern_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* password_pattern;
-       const char param_zone[] = "owner";
+       char* password_pattern;
 
        handle = dpm_context_create();
        if (handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
-    dlog_print(DLOG_DEBUG, LOG_TAG, "dpm_password_get_pattern_in");
+       dlog_print(DLOG_DEBUG, LOG_TAG, "dpm_password_get_pattern_in");
        if (dpm_password_get_pattern(password_policy_handle, &password_pattern) == 0) {
-        dlog_print(DLOG_DEBUG, LOG_TAG, "dpm_password_get_pattern_out");
+               dlog_print(DLOG_DEBUG, LOG_TAG, "dpm_password_get_pattern_out");
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"), password_pattern);
                free(password_pattern);
                dpm_context_release_password_policy(handle, password_policy_handle);
@@ -565,7 +551,7 @@ int get_password_pattern_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -576,9 +562,8 @@ int set_max_char_occurrences_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int max_char_occur;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -593,21 +578,21 @@ int set_max_char_occurrences_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_maximum_character_occurrences(password_policy_handle, max_char_occur) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -620,29 +605,28 @@ int get_max_char_occurrences_handler(struct dpm_toolkit_entity* self)
        dpm_toolkit_entity_t* selected_policy = self;
        char num_text[10];
        int max_char_occur;
-       const char param_zone[] = "owner";
 
        handle = dpm_context_create();
        if (handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_get_maximum_character_occurrences(password_policy_handle, &max_char_occur) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                snprintf(num_text,sizeof(num_text),"%d",max_char_occur);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"), num_text);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -653,9 +637,8 @@ int set_max_numeric_sequence_length_handler(struct dpm_toolkit_entity* self)
        dpm_context_h handle;
        dpm_password_policy_h password_policy_handle;
        dpm_toolkit_entity_t* selected_policy = self;
-    char* input;
+       char* input;
        int max_numeric_seq_length;
-       const char param_zone[] = "owner";
 
        handler_display_input_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),selected_policy);
 
@@ -670,21 +653,21 @@ int set_max_numeric_sequence_length_handler(struct dpm_toolkit_entity* self)
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_set_maximum_numeric_sequence_length(password_policy_handle, max_numeric_seq_length) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"),input);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
@@ -697,29 +680,28 @@ int get_max_numeric_sequence_length_handler(struct dpm_toolkit_entity* self)
        dpm_toolkit_entity_t* selected_policy = self;
        char num_text[10];
        int max_numeric_seq_length;
-       const char param_zone[] = "owner";
 
        handle = dpm_context_create();
        if (handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create client handle");
                return POLICY_RESULT_FAIL;
        }
-       
-       password_policy_handle = dpm_context_acquire_password_policy(handle, param_zone);
+
+       password_policy_handle = dpm_context_acquire_password_policy(handle);
        if (password_policy_handle == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create password policy handle");
                return POLICY_RESULT_FAIL;
        }
 
        if (dpm_password_get_maximum_numeric_sequence_length(password_policy_handle, &max_numeric_seq_length) == 0) {
-        dpm_context_release_password_policy(handle, password_policy_handle);
+               dpm_context_release_password_policy(handle, password_policy_handle);
                dpm_context_destroy(handle);
                snprintf(num_text,sizeof(num_text),"%d",max_numeric_seq_length);
                display_result_popup((char *)xmlGetProp(selected_policy->model, (xmlChar *) "desc"), num_text);
                return POLICY_RESULT_NONE;
        }
 
-    dpm_context_release_password_policy(handle, password_policy_handle);
+       dpm_context_release_password_policy(handle, password_policy_handle);
        dpm_context_destroy(handle);
        return POLICY_RESULT_FAIL;
 }
index cf435d0..7e955f3 100755 (executable)
@@ -8,7 +8,6 @@ int wifi_set_profile_change_restriction_handler(struct dpm_toolkit_entity* self)
 {
        dpm_wifi_policy_h policy;
        dpm_context_h context;
-        char *zone;
        int ret;
 
        dlog_print(DLOG_DEBUG, LOG_TAG, __func__);
@@ -21,10 +20,7 @@ int wifi_set_profile_change_restriction_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-        zone = get_now_zone();
-       policy = dpm_context_acquire_wifi_policy(context, zone);
-        free(zone);
-
+       policy = dpm_context_acquire_wifi_policy(context);
        if (policy == NULL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get wifi policy interface");
                dpm_context_destroy(context);
@@ -42,7 +38,6 @@ int wifi_set_profile_change_restriction_handler(struct dpm_toolkit_entity* self)
 int wifi_is_profile_change_restricted_handler(struct dpm_toolkit_entity* self)
 {      dpm_wifi_policy_h policy;
        dpm_context_h context;
-        char *zone;
        int state, ret;
 
        dlog_print(DLOG_DEBUG, LOG_TAG, __func__);
@@ -53,10 +48,7 @@ int wifi_is_profile_change_restricted_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-        zone = get_now_zone();
-       policy = dpm_context_acquire_wifi_policy(context, zone);
-        free(zone);
-
+       policy = dpm_context_acquire_wifi_policy(context);
        if (policy == NULL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get wifi policy interface");
                dpm_context_destroy(context);
@@ -81,7 +73,6 @@ int wifi_set_network_access_restriction_handler(struct dpm_toolkit_entity* self)
 {
        dpm_wifi_policy_h policy;
        dpm_context_h context;
-        char *zone;
        int ret;
 
        dlog_print(DLOG_DEBUG, LOG_TAG, __func__);
@@ -94,10 +85,7 @@ int wifi_set_network_access_restriction_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-        zone = get_now_zone();
-       policy = dpm_context_acquire_wifi_policy(context, zone);
-        free(zone);
-
+       policy = dpm_context_acquire_wifi_policy(context);
        if (policy == NULL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get wifi policy interface");
                dpm_context_destroy(context);
@@ -116,7 +104,6 @@ int wifi_is_network_access_restricted_handler(struct dpm_toolkit_entity* self)
 {
        dpm_wifi_policy_h policy;
        dpm_context_h context;
-        char *zone;
        int state, ret;
 
        dlog_print(DLOG_DEBUG, LOG_TAG, __func__);
@@ -127,9 +114,7 @@ int wifi_is_network_access_restricted_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-        zone = get_now_zone();
-       policy = dpm_context_acquire_wifi_policy(context, zone);
-        free(zone);
+       policy = dpm_context_acquire_wifi_policy(context);
 
        if (policy == NULL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get wifi policy interface");
@@ -155,7 +140,6 @@ int wifi_add_ssid_to_blocklist_handler(struct dpm_toolkit_entity* self)
 {
        dpm_wifi_policy_h policy;
        dpm_context_h context;
-        char *zone;
        int ret;
 
        dlog_print(DLOG_DEBUG, LOG_TAG, __func__);
@@ -168,10 +152,7 @@ int wifi_add_ssid_to_blocklist_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-        zone = get_now_zone();
-       policy = dpm_context_acquire_wifi_policy(context, zone);
-        free(zone);
-
+       policy = dpm_context_acquire_wifi_policy(context);
        if (policy == NULL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get wifi policy interface");
                dpm_context_destroy(context);
@@ -190,7 +171,6 @@ int wifi_remove_ssid_from_blocklist_handler(struct dpm_toolkit_entity* self)
 {
        dpm_wifi_policy_h policy;
        dpm_context_h context;
-        char *zone;
        int ret;
 
        dlog_print(DLOG_DEBUG, LOG_TAG, __func__);
@@ -203,10 +183,7 @@ int wifi_remove_ssid_from_blocklist_handler(struct dpm_toolkit_entity* self)
                return POLICY_RESULT_FAIL;
        }
 
-        zone = get_now_zone();
-       policy = dpm_context_acquire_wifi_policy(context, zone);
-        free(zone);
-
+       policy = dpm_context_acquire_wifi_policy(context);
        if (policy == NULL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get wifi policy interface");
                dpm_context_destroy(context);