remove some bt enable checks 47/32347/2 accepted/tizen/common/20141222.111329 accepted/tizen/ivi/20141223.020116 accepted/tizen/mobile/20141222.135414 accepted/tizen/tv/20141222.133837 accepted/tizen/wearable/20141222.134738 submit/tizen/20141222.094713
authorCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Wed, 10 Dec 2014 17:18:06 +0000 (18:18 +0100)
committerCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Thu, 18 Dec 2014 09:57:28 +0000 (01:57 -0800)
bluetooth adapter doesn't need to be powered on for gettting
adapter properties.

Remove those checks allows to retrieve adapter properties from
tizen.bluetooth.getDefaultAdapter() Web API call even if adapter
is powered off.

It helps to fix TC-1994.

Change-Id: If41ca8ac5a23a73c22e776cf2a19e4c4b0a819c9
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
bt-api/bt-adapter.c

index acd5f2a2684f992098430484d5468ccafc2aaa6e..b4794c9a74cb6be1198746b4df8adb8ea5e1762f 100644 (file)
@@ -134,7 +134,6 @@ BT_EXPORT_API int bluetooth_get_local_address(bluetooth_device_address_t *local_
        int result;
 
        BT_CHECK_PARAMETER(local_address, return);
-       BT_CHECK_ENABLED(return);
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -157,7 +156,6 @@ BT_EXPORT_API int bluetooth_get_local_name(bluetooth_device_name_t *local_name)
        int result;
 
        BT_CHECK_PARAMETER(local_name, return);
-       BT_CHECK_ENABLED(return);
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -231,22 +229,6 @@ BT_EXPORT_API int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t
 
        BT_CHECK_PARAMETER(discoverable_mode_ptr, return);
 
-       /* Requirement in OSP */
-       if (bluetooth_check_adapter() == BLUETOOTH_ADAPTER_DISABLED) {
-               if (vconf_get_int(BT_FILE_VISIBLE_TIME, &timeout) != 0) {
-                       BT_ERR("Fail to get the timeout value");
-                       return BLUETOOTH_ERROR_INTERNAL;
-               }
-
-               if (timeout == -1) {
-                       *discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE;
-               } else {
-                       *discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE;
-               }
-
-               return BLUETOOTH_ERROR_NONE;
-       }
-
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);