*
*/
-#ifdef TIZEN_FEATURE_BT_DPM
#include <vconf.h>
#include "bluetooth-api.h"
#include "bt-event-handler.h"
#include "bt-dpm.h"
-#ifdef TIZEN_FEATURE_BT_DPM
BT_EXPORT_API int bluetooth_dpm_is_mode_allowed(void)
{
int value;
else
return BLUETOOTH_ERROR_PERMISSION_DEINED;
}
-#endif
-
-#if 0
-static bt_dpm_status_e _bt_check_dpm_allow_restriction(void)
-{
- bt_dpm_allow_t mode;
-
- bluetooth_dpm_get_allow_mode(&mode);
-
- return (mode == BLUETOOTH_DPM_BT_RESTRICTED) ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED;
-}
-#endif
static bt_dpm_status_e _bt_check_dpm_handsfree_only(void)
{
return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
}
-#if 0
-static bt_dpm_status_e _bt_check_dpm_visible_restriction(void)
-{
- bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
-
- bluetooth_dpm_get_desktop_connectivity_state(&dpm_status);
-
- return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
-}
-
-static bt_dpm_status_e _bt_check_dpm_limited_discoverable_mode(void)
-{
- bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
-
- bluetooth_dpm_get_limited_discoverable_state(&dpm_status);
-
- return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
-}
-#endif
-
static bt_dpm_status_e _bt_check_dpm_blacklist_device(bluetooth_device_address_t *address)
{
int ret = BLUETOOTH_DPM_RESULT_SUCCESS;
BT_EXPORT_API int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value)
{
int result = BLUETOOTH_ERROR_NONE;
-#ifdef TIZEN_FEATURE_BT_DPM
int bt_status;
-#endif
-#ifdef TIZEN_FEATURE_BT_DPM
if (value >= BLUETOOTH_DPM_BT_ALLOWED &&
value <= BLUETOOTH_DPM_BT_RESTRICTED) {
if (vconf_set_int(VCONFKEY_BT_DPM_STATUS, value) != 0) {
result = bluetooth_disable_adapter();
}
}
-#else
- BT_INIT_PARAMS();
- BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
- g_array_append_vals(in_param1, &value, sizeof(int));
-
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_SET_ALLOW_BT_MODE,
- in_param1, in_param2, in_param3, in_param4, &out_param);
-
- BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-#endif
return result;
{
int result;
-#ifdef TIZEN_FEATURE_BT_DPM
if (vconf_get_int(VCONFKEY_BT_DPM_STATUS, value) != 0) {
BT_ERR("fail to get vconf key!");
return BLUETOOTH_ERROR_INTERNAL;
}
result = BLUETOOTH_ERROR_NONE;
-#else
- BT_CHECK_ENABLED_ANY(return);
-
- BT_INIT_PARAMS();
- BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_ALLOW_BT_MODE,
- in_param1, in_param2, in_param3, in_param4, &out_param);
-
- if (result == BLUETOOTH_ERROR_NONE) {
- if (out_param->len > 0) {
- *value = g_array_index(out_param,
- int, 0);
- } else {
- BT_ERR("out_param length is 0!!");
- }
- }
-
- BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-#endif
return result;
}
return result;
}
-#endif /* #ifdef TIZEN_FEATURE_BT_DPM */