From: h.sandeep Date: Thu, 12 May 2016 06:32:57 +0000 (+0530) Subject: DPM: Modify Discoverable policy handling. X-Git-Tag: accepted/tizen/common/20160530.131853~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F69283%2F2;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git DPM: Modify Discoverable policy handling. Change-Id: I26df964a4203ede38c4dcad1e513ff144b058bb5 Signed-off-by: h.sandeep --- diff --git a/bt-service/bt-service-dpm.c b/bt-service/bt-service-dpm.c index e45c128..63c4891 100644 --- a/bt-service/bt-service-dpm.c +++ b/bt-service/bt-service-dpm.c @@ -28,6 +28,7 @@ #include "bt-internal-types.h" #include "bt-service-common.h" +#include "bt-service-adapter.h" #include "bt-service-dpm.h" static dpm_policy_t policy_table[DPM_POLICY_END] = { @@ -522,6 +523,11 @@ dpm_status_t _bt_dpm_set_bluetooth_discoverable_state(dpm_status_t value) if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED) return DPM_RESTRICTED; + if (value == DPM_RESTRICTED) { + /* Since Discoverable mode is restricted, stop the ongoing discoverable mode */ + _bt_set_discoverable_mode(BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, 0); + } + policy_table[DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE].value = value; return DPM_RESULT_SUCCESS; @@ -544,6 +550,11 @@ dpm_status_t _bt_dpm_set_bluetooth_limited_discoverable_state(dpm_status_t value if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED) return DPM_RESTRICTED; + if (value == DPM_RESTRICTED) { + /* Since Discoverable mode is restricted, stop the ongoing discoverable mode */ + _bt_set_discoverable_mode(BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, 0); + } + policy_table[DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE].value = value; return DPM_RESULT_SUCCESS;