Knox Tizen Wearable SDK
location.h
1 /*
2  * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of
7  * SAMSUNG ELECTRONICS ("Confidential Information").
8  * You shall not disclose such Confidential Information and shall
9  * use it only in accordance with the terms of the license agreement
10  * you entered into with SAMSUNG ELECTRONICS.
11  * SAMSUNG make no representations or warranties about the suitability
12  * of the software, either express or implied, including but not
13  * limited to the implied warranties of merchantability, fitness for
14  * a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  */
18 
19 /*
20  *@brief This file serves as interface between the Application and MDM server daemon.
21  */
22 
23 #ifndef LIBMDM_MDM_LOCATION_H
24 #define LIBMDM_MDM_LOCATION_H
25 
26 #include <stdbool.h>
27 #include <stdio.h>
28 #include "mdm_client_type.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
73 mdm_result_t mdm_start_gps(bool start);
74 
75 
107 
108 /*
109  * @brief Function to allow or restrict end user permission to change GPS settings.
110  *
111  * @since_mdm 2.2.0
112  *
113  * @since_tizen 3.0.0.1
114  *
115  * @feature %http://developer.samsung.com/tizen/feature/mdm
116  *
117  * @par Usage:
118  *
119  * Use this API to set end user permission to access GPS settings. The API call blocks changes from any sources when
120  restriction is enabled.
121  *
122  * @remark
123  * GPS change restriction #mdm_status_t is written to #MDM_POLICY_ON_GPS_CHANGE notification file.
124  * You can register a callback for this event using #mdm_register_policy_receiver.
125  *
126  * @code{.c}
127  mdm_result_t result = knox_mdm_set_allow_gps_change(MDM_RESTRICTED);
128  if(result == MDM_RESULT_SUCCESS) {
129  // Success
130  ...
131  } else {
132  // Error
133  ...
134  }
135  * @endcode
136  * @param[in] status #MDM_RESTRICTED — End users are not allowed to change GPS settings.
137  * \n #MDM_ALLOWED — End users are allowed to change GPS settings.
138  *
139  *
140  * @privlevel public
141  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
142  *
143  * @return #mdm_result_t : MDM_RESULT_SUCCESS upon successful configuration of end user permission to access GPS
144  settings, or an error code from the values listed below upon failure.
145  *
146  * @retval #MDM_RESULT_SUCCESS Successful
147  * @retval #MDM_RESULT_FAIL General failure
148  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
149  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
150  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
151  *
152  * @see knox_mdm_get_allow_gps_change
153  */
154 mdm_result_t knox_mdm_set_allow_gps_change(const mdm_status_t status);
155 
156 /*
157  * @brief Function checks if the end user is allowed to make changes to GPS settings.
158  *
159  * @since_mdm 2.2.0
160  *
161  * @since_tizen 3.0.0.1
162  *
163  * @feature %http://developer.samsung.com/tizen/feature/mdm
164  *
165  * @par Usage:
166  * Use this API to check if end users are allowed to make changes to GPS settings.
167  *
168  * @code{.c}
169  mdm_status_t status = knox_mdm_get_allow_gps_change();
170  if(result == MDM_RESTRICTED) {
171  // Changes are blocked
172  ...
173  } else if(result == MDM_ALLOWED) {
174  // Changes are allowed
175  ...
176  }
177  else
178  {
179  // ERROR
180  ...
181  }
182  * @endcode
183  *
184  * @return #mdm_status_t : The current prevention status.
185  * @retval #MDM_RESTRICTED End users are not allowed to change GPS settings.
186  * @retval #MDM_ALLOWED End users are allowed to change GPS settings.
187  * @retval #MDM_STATUS_ERROR On any error.
188  *
189  * @see knox_mdm_set_allow_gps_change
190  */
191 mdm_status_t knox_mdm_get_allow_gps_change(void);
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 
201 #endif // LIBMDM_MDM_LOCATION_H
mdm_status_t
MDM Policy status.
mdm_status_t mdm_is_gps_on(void)
Function to status of GPS.
mdm_result_t
MDM API result.
mdm_result_t mdm_start_gps(bool start)
Function on/off GPS on the device.