Add LCOV comment for deprecated functions
[platform/core/api/runtime-info.git] / src / runtime_info_location.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20
21 #include <vconf.h>
22 #include <dlog.h>
23
24 #include <runtime_info.h>
25 #include <runtime_info_private.h>
26
27 #include <system_info.h>
28
29 #ifdef LOG_TAG
30 #undef LOG_TAG
31 #endif
32
33 #define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
34
35 static const char *VCONF_LOCATION_SERVICE_ENABLED = VCONFKEY_LOCATION_ENABLED;
36 static const char *VCONF_LOCATION_NETWORK_ENABLED = VCONFKEY_LOCATION_NETWORK_ENABLED;
37
38 //LCOV_EXCL_START : deprecated feature
39 int runtime_info_location_service_get_value(runtime_info_value_h value)
40 {
41         int vconf_value;
42         int ret;
43
44         LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED is deprecated and will be removed from next release.");
45
46         ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value);
47         if (ret == RUNTIME_INFO_ERROR_NONE)
48                 value->b = vconf_value;
49
50         return ret;
51 }
52
53 int runtime_info_location_service_set_event_cb()
54 {
55         LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED is deprecated and will be removed from next release.");
56
57         return runtime_info_vconf_set_event_cb(VCONF_LOCATION_SERVICE_ENABLED, RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED, 0);
58 }
59
60 void runtime_info_location_service_unset_event_cb()
61 {
62         LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED is deprecated and will be removed from next release.");
63
64         runtime_info_vconf_unset_event_cb(VCONF_LOCATION_SERVICE_ENABLED, 0);
65 }
66
67 int runtime_info_location_network_get_value(runtime_info_value_h value)
68 {
69         int vconf_value;
70         int ret;
71         bool supported;
72
73         LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED is deprecated and will be removed from next release.");
74
75         ret = system_info_get_platform_bool("http://tizen.org/feature/location.wps", &supported);
76         if (ret != SYSTEM_INFO_ERROR_NONE)
77                 return RUNTIME_INFO_ERROR_IO_ERROR;
78
79         if (!supported)
80                 return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
81
82         ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_NETWORK_ENABLED, &vconf_value);
83         if (ret == RUNTIME_INFO_ERROR_NONE)
84                 value->b = vconf_value;
85
86         return ret;
87 }
88
89 int runtime_info_location_network_set_event_cb()
90 {
91         LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED is deprecated and will be removed from next release.");
92
93         return runtime_info_vconf_set_event_cb(VCONF_LOCATION_NETWORK_ENABLED, RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED, 0);
94 }
95
96 void runtime_info_location_network_unset_event_cb()
97 {
98         LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED is deprecated and will be removed from next release.");
99
100         runtime_info_vconf_unset_event_cb(VCONF_LOCATION_NETWORK_ENABLED, 0);
101 }
102 //LCOV_EXCL_STOP