Remove Blacklist related APIs from Bluetooth Test 61/68861/1
authorSeok Hong <seok85.hong@samsung.com>
Tue, 10 May 2016 06:42:46 +0000 (15:42 +0900)
committerSeok Hong <seok85.hong@samsung.com>
Tue, 10 May 2016 06:42:46 +0000 (15:42 +0900)
Device/UUID Blasklist related APIs had been removed from Bluetooth Test.
These APIs should be added again after Tizen 3.0 beta release by DPM Policy plan

Change-Id: Id100cc0504f32d1b240623721245372ac0840c3e
Signed-off-by: Seok Hong <seok85.hong@samsung.com>
data/test.xml
src/bluetooth.c

index 5ae3779..8d8bfca 100755 (executable)
        </policy-group>
 
        <policy-group id="BLUETOOTH">
-               <policy id="ADD_DEVICE_TO_BLACKLIST" desc="Add device MAC address to blacklist" status="ON" default="e8:11:32:30:78:9c">
-               </policy>
-               <policy id="REMOVE_DEVICE_FROM_BLACKLIST" desc="Remove device MAC address from blacklist" status="ON" default="e8:11:32:30:78:9c">
-               </policy>
                <policy id="SET_DEVICE_RESTRICTION" desc="Set device restriction" status="ON">
                </policy>
                <policy id="IS_DEVICE_RESTRICTED" desc="Check device restriction" status="ON">
                </policy>
-               <policy id="ADD_UUID_TO_BLACKLIST" desc="Add uuid to blacklist" status="ON" default="0030290f-0300-1000-8001-00805f9b34fb">
-               </policy>
-               <policy id="REMOVE_UUID_FROM_BLACKLIST" desc="Remove uuid from blacklist" status="ON" default="0030290f-0300-1000-8001-00805f9b34fb">
-               </policy>
                <policy id="SET_UUID_RESTRICTION" desc="Set uuid restriction" status="ON">
                </policy>
                <policy id="IS_UUID_RESTRICTED" desc="Check uuid restriction" status="ON">
index 8d6cdc2..e7d2bd3 100644 (file)
@@ -3,84 +3,6 @@
 #include "dpm-toolkit.h"
 #include <dpm/bluetooth.h>
 
-int add_device_to_blacklist_handler(struct dpm_toolkit_entity *self)
-{
-       dlog_print(DLOG_DEBUG, LOG_TAG, "add_device_from_blacklist_handler");
-
-       char *mac_address = NULL;
-       handler_display_input_popup((char *)xmlGetProp(self->model, (xmlChar *) "desc"), self);
-       mac_address = self->entry_input;
-       if (mac_address == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "can not get mac_address");
-       return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_h context;
-       context = dpm_context_create();
-       if (context == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to create client context");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_bluetooth_policy_h policy = dpm_context_acquire_bluetooth_policy(context);
-       if (policy == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get bluetooth policy interface");
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       if (dpm_bluetooth_add_device_to_blacklist(policy, mac_address) < 0) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to add MAC Address to blacklist");
-               dpm_context_release_bluetooth_policy(context, policy);
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_release_bluetooth_policy(context, policy);
-       dpm_context_destroy(context);
-
-       return POLICY_RESULT_SUCCESS;
-}
-
-int remove_device_from_blacklist_handler(struct dpm_toolkit_entity *self)
-{
-       dlog_print(DLOG_DEBUG, LOG_TAG, "remove_device_from_blacklist_handler");
-
-       char *mac_address = NULL;
-       handler_display_input_popup((char *)xmlGetProp(self->model, (xmlChar *) "desc"), self);
-       mac_address = self->entry_input;
-       if (mac_address == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "can not get mac_address");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_h context;
-       context = dpm_context_create();
-       if (context == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to create client context");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_bluetooth_policy_h policy = dpm_context_acquire_bluetooth_policy(context);
-       if (policy == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get bluetooth policy interface");
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       if (dpm_bluetooth_remove_device_from_blacklist(policy, mac_address) < 0) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to remove MAC address to blacklist");
-               dpm_context_release_bluetooth_policy(context, policy);
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_release_bluetooth_policy(context, policy);
-       dpm_context_destroy(context);
-
-       return POLICY_RESULT_SUCCESS;
-}
-
 int set_device_restriction_handler(struct dpm_toolkit_entity *self)
 {
        dlog_print(DLOG_DEBUG, LOG_TAG, "set_device_restriction_handler");
@@ -165,84 +87,6 @@ int is_device_restricted_handler(struct dpm_toolkit_entity *self)
        return POLICY_RESULT_NONE;
 }
 
-int add_uuid_to_blacklist_handler(struct dpm_toolkit_entity *self)
-{
-       dlog_print(DLOG_DEBUG, LOG_TAG, "add_uuid_to_blacklist_handler");
-
-       char *uuid = NULL;
-       handler_display_input_popup((char *)xmlGetProp(self->model, (xmlChar *) "desc"), self);
-       uuid = self->entry_input;
-       if (uuid == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "can not get uuid");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_h context;
-       context = dpm_context_create();
-       if (context == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to create client context");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_bluetooth_policy_h policy = dpm_context_acquire_bluetooth_policy(context);
-       if (policy == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get bluetooth policy interface");
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       if (dpm_bluetooth_add_uuid_to_blacklist(policy, uuid) < 0) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to add UUID to blacklist");
-               dpm_context_release_bluetooth_policy(context, policy);
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_release_bluetooth_policy(context, policy);
-       dpm_context_destroy(context);
-
-       return POLICY_RESULT_SUCCESS;
-}
-
-int remove_uuid_from_blacklist_handler(struct dpm_toolkit_entity *self)
-{
-       dlog_print(DLOG_DEBUG, LOG_TAG, "remove_uuid_from_blacklist_handler");
-
-       char *uuid = NULL;
-       handler_display_input_popup((char *)xmlGetProp(self->model, (xmlChar *) "desc"), self);
-       uuid = self->entry_input;
-       if (uuid == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "can not get uuid");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_h context;
-       context = dpm_context_create();
-       if (context == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to create client context");
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_bluetooth_policy_h policy = dpm_context_acquire_bluetooth_policy(context);
-       if (policy == NULL) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to get bluetooth policy interface");
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       if (dpm_bluetooth_remove_uuid_from_blacklist(policy, uuid) < 0) {
-               dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to remove UUID to blacklist");
-               dpm_context_release_bluetooth_policy(context, policy);
-               dpm_context_destroy(context);
-               return POLICY_RESULT_FAIL;
-       }
-
-       dpm_context_release_bluetooth_policy(context, policy);
-       dpm_context_destroy(context);
-
-       return POLICY_RESULT_SUCCESS;
-}
-
 int set_uuid_restriction_handler(struct dpm_toolkit_entity *self)
 {
        dlog_print(DLOG_DEBUG, LOG_TAG, "set_uuid_restriction_handler");
@@ -327,14 +171,6 @@ int is_uuid_restricted_handler(struct dpm_toolkit_entity *self)
 
 dpm_toolkit_entity_t dpm_toolkit_bluetooth_policy[] = {
        {
-               .id = "ADD_DEVICE_TO_BLACKLIST",
-               .handler = add_device_to_blacklist_handler
-       },
-       {
-               .id = "REMOVE_DEVICE_FROM_BLACKLIST",
-               .handler = remove_device_from_blacklist_handler
-       },
-       {
                .id = "SET_DEVICE_RESTRICTION",
                .handler = set_device_restriction_handler
        },
@@ -343,14 +179,6 @@ dpm_toolkit_entity_t dpm_toolkit_bluetooth_policy[] = {
                .handler = is_device_restricted_handler
        },
        {
-               .id = "ADD_UUID_TO_BLACKLIST",
-               .handler = add_uuid_to_blacklist_handler
-       },
-       {
-               .id = "REMOVE_UUID_FROM_BLACKLIST",
-               .handler = remove_uuid_from_blacklist_handler
-       },
-       {
                .id = "SET_UUID_RESTRICTION",
                .handler = set_uuid_restriction_handler
        },