Add bt-driver-insmod.service trigger logic
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-adapter-le.c
index 8cbb29d..d96c32a 100644 (file)
@@ -127,8 +127,7 @@ BT_EXPORT_API int bluetooth_stop_le_discovery(void)
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE)
-               _bt_set_le_scan_status(FALSE);
+       _bt_set_le_scan_status(FALSE);
 
        return result;
 }
@@ -243,7 +242,6 @@ BT_EXPORT_API int bluetooth_unregister_all_scan_filters(void)
        return result;
 }
 
-#ifdef TIZEN_PROFILE_WEARABLE
 gboolean __bluetooth_is_privileged_process(void)
 {
        FILE *fp = NULL;
@@ -265,18 +263,16 @@ gboolean __bluetooth_is_privileged_process(void)
        fclose(fp);
        return FALSE;
 }
-#endif
 
 BT_EXPORT_API int bluetooth_set_advertising(int handle, gboolean enable)
 {
        int result;
-       gboolean use_reserved_slot = FALSE;
+       gboolean use_reserved_slot = TRUE;
 
        BT_CHECK_ENABLED_ANY(return);
 
-#ifdef TIZEN_PROFILE_WEARABLE
-       use_reserved_slot = __bluetooth_is_privileged_process();
-#endif
+       if (TIZEN_PROFILE_WEARABLE)
+               use_reserved_slot = __bluetooth_is_privileged_process();
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -297,13 +293,12 @@ BT_EXPORT_API int bluetooth_set_custom_advertising(int handle, gboolean enable,
                                                bluetooth_advertising_params_t *params)
 {
        int result;
-       gboolean use_reserved_slot = FALSE;
+       gboolean use_reserved_slot = TRUE;
 
        BT_CHECK_ENABLED_ANY(return);
 
-#ifdef TIZEN_PROFILE_WEARABLE
+       if (TIZEN_PROFILE_WEARABLE)
        use_reserved_slot = __bluetooth_is_privileged_process();
-#endif
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -352,7 +347,7 @@ BT_EXPORT_API int bluetooth_get_advertising_data(bluetooth_advertising_data_t *a
 BT_EXPORT_API int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length)
 {
        int result;
-       gboolean use_reserved_slot = FALSE;
+       gboolean use_reserved_slot = TRUE;
 
        BT_CHECK_PARAMETER(value, return);
        BT_CHECK_ENABLED_ANY(return);
@@ -360,9 +355,8 @@ BT_EXPORT_API int bluetooth_set_advertising_data(int handle, const bluetooth_adv
        if (length > BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX - 3)
                return BLUETOOTH_ERROR_INVALID_PARAM;
 
-#ifdef TIZEN_PROFILE_WEARABLE
-       use_reserved_slot = __bluetooth_is_privileged_process();
-#endif
+       if (TIZEN_PROFILE_WEARABLE)
+               use_reserved_slot = __bluetooth_is_privileged_process();
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -412,7 +406,7 @@ BT_EXPORT_API int bluetooth_set_scan_response_data(int handle,
                        const bluetooth_scan_resp_data_t *value, int length)
 {
        int result;
-       gboolean use_reserved_slot = FALSE;
+       gboolean use_reserved_slot = TRUE;
 
        BT_CHECK_PARAMETER(value, return);
        BT_CHECK_ENABLED_ANY(return);
@@ -420,9 +414,8 @@ BT_EXPORT_API int bluetooth_set_scan_response_data(int handle,
        if (length > BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX)
                return BLUETOOTH_ERROR_INVALID_PARAM;
 
-#ifdef TIZEN_PROFILE_WEARABLE
-       use_reserved_slot = __bluetooth_is_privileged_process();
-#endif
+       if (TIZEN_PROFILE_WEARABLE)
+               use_reserved_slot = __bluetooth_is_privileged_process();
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);