From: Hyuk Lee Date: Wed, 1 Jun 2016 09:56:35 +0000 (+0900) Subject: Add the privilege check for async GATT connection X-Git-Tag: accepted/tizen/common/20160603.150552^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F72527%2F1;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Add the privilege check for async GATT connection Change-Id: Ia5b7b6d28bd3a928298785bc3b6c017144e63672 Signed-off-by: Hyuk Lee --- diff --git a/bt-api/bt-device.c b/bt-api/bt-device.c index d6bf2da..c3563e3 100644 --- a/bt-api/bt-device.c +++ b/bt-api/bt-device.c @@ -335,6 +335,12 @@ BT_EXPORT_API int bluetooth_connect_le(const bluetooth_device_address_t *device_ BT_CHECK_PARAMETER(device_address, return); BT_CHECK_ENABLED_ANY(return); + if (_bt_check_privilege(BT_CHECK_PRIVILEGE, BT_CONNECT_LE) + == BLUETOOTH_ERROR_PERMISSION_DEINED) { + BT_ERR("Don't have a privilege to use this API"); + return BLUETOOTH_ERROR_PERMISSION_DEINED; + } + BT_INIT_PARAMS(); BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param); diff --git a/bt-api/bt-hdp.c b/bt-api/bt-hdp.c index da56684..715a216 100755 --- a/bt-api/bt-hdp.c +++ b/bt-api/bt-hdp.c @@ -217,7 +217,7 @@ static int __bt_hdp_internal_create_application(unsigned int data_type, if (err) { BT_ERR("%s", err->message); if (g_strrstr(err->message, BT_ACCESS_DENIED_MSG)) - ret = BLUETOOTH_ERROR_ACCESS_DENIED; + ret = BLUETOOTH_ERROR_PERMISSION_DEINED; else ret = BLUETOOTH_ERROR_INTERNAL; g_clear_error(&err);