Added the Error code "BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION".
Change-Id: I303860eff6a5df40dccf641df390552d2c4cdb43
Signed-off-by: h.sandeep <h.sandeep@samsung.com>
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_HSP, NULL) == BT_DPM_RESTRICTED &&
_bt_check_dpm(BT_DPM_A2DP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use HSP / A2DP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
} else if (_bt_check_dpm(BT_DPM_HSP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use HSP profile");
service_function = BT_AV_CONNECT;
if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
BT_ERR("Reject a authorization due to MDM Policy");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_HSP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use HSP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
BT_ERR("Reject a authorization due to MDM Policy");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_A2DP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use A2DP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
BT_ERR("Reject a authorization due to MDM Policy");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_A2DP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use A2DP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_HSP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use HSP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, remote_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use AVRCP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_PAIRING, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to pair the device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)device_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, device_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_UUID, BT_HID_UUID) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist uuid");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
char *uuid = NULL;
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)device_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
switch (role) {
if (_bt_check_dpm(BT_DPM_UUID, uuid) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist uuid");
g_free(uuid);
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
- if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
+ if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
char address[BT_ADDRESS_STRING_SIZE] = { 0 };
bluetooth_device_class_t dev_class;
if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
BT_ERR("Reject a authorization due to MDM Policy");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
}
g_free(uuid);
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, remote_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_OPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to send files");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
BT_ERR("Reject a authorization due to MDM Policy");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_bt_address) == BT_DPM_RESTRICTED) {
BT_ERR("Blacklist device");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED ||
_bt_check_dpm(BT_DPM_HF_ONLY, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to connect the RFCOMM service");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
BT_ERR("Reject a authorization due to MDM Policy");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
}
#endif
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED ||
_bt_check_dpm(BT_DPM_HF_ONLY, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to write RFCOMM data");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use SPP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use SPP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use SPP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use SPP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use SPP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#ifdef TIZEN_DPM_ENABLE
if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
BT_ERR("Not allow to use SPP profile");
- return BLUETOOTH_ERROR_ACCESS_DENIED;
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
}
#endif
#define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
/**< Not initialized */
+#define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x27)
+ /**< Device Policy Restricted */
+
/**
* Device disconnect reason
*/
BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
- BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
+ BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
} bt_dpm_result_t;
typedef enum {
BLUETOOTH_DPM_STATUS_ERROR = -1,
- BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
+ BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
- BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
+ BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */