return false;
}
- set_last_result(LOCATIONS_ERROR_NONE);
- return location_is_supported_method(_method);
+ gboolean ret = location_is_supported_method(_method);
+ if (ret) {
+ set_last_result(LOCATIONS_ERROR_NONE);
+ return true;
+ } else {
+ set_last_result(LOCATIONS_ERROR_NOT_SUPPORTED);
+ return false;
+ }
}
EXPORT_API int location_manager_is_enabled_method(location_method_e method, bool *enable)
{
LOCATIONS_LOGD("location_manager_create (method : %d)", method);
- if (method == LOCATIONS_METHOD_HYBRID) {
+ if (method == LOCATIONS_METHOD_HYBRID)
+ LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
+ else if (method == LOCATIONS_METHOD_GPS)
+ LOCATIONS_NOT_SUPPORTED_CHECK(__is_gps_supported());
+ else if (method == LOCATIONS_METHOD_WPS)
+ LOCATIONS_NOT_SUPPORTED_CHECK(__is_wps_supported());
+ else if (method == LOCATIONS_METHOD_PASSIVE)
LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
- } else if (method == LOCATIONS_METHOD_GPS) {
- if (__is_gps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
- LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x) : fail to location feature", LOCATIONS_ERROR_NOT_SUPPORTED);
- return LOCATIONS_ERROR_NOT_SUPPORTED;
- }
- } else if (method == LOCATIONS_METHOD_WPS) {
- if (__is_wps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
- LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x) : fail to location feature", LOCATIONS_ERROR_NOT_SUPPORTED);
- return LOCATIONS_ERROR_NOT_SUPPORTED;
- }
- } else if (method == LOCATIONS_METHOD_PASSIVE) {
- if (__is_location_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
- LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x) : fail to location feature", LOCATIONS_ERROR_NOT_SUPPORTED);
- return LOCATIONS_ERROR_NOT_SUPPORTED;
- }
- }
LocationMethod _method = __convert_LocationMethod(method);
if (_method == LOCATION_METHOD_NONE) {
memset(handle, 0, sizeof(location_manager_s));
- handle->object = location_new(_method);
+ handle->object = location_new(_method, FALSE);
if (handle->object == NULL) {
LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : fail to location_new", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
free(handle);
if (!handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED])
handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED] = g_signal_connect(handle->object, "service-disabled", G_CALLBACK(__cb_service_disabled), handle);
-#if 0
- if (!handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED])
- handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED] = g_signal_connect(handle->object, "status-changed", G_CALLBACK(__cb_service_status_changed), handle);
-#endif
-
*manager = (location_manager_h) handle;
return LOCATIONS_ERROR_NONE;
}
handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED] = 0;
}
- int ret = location_free(handle->object);
+ int ret = location_free(handle->object, FALSE);
if (ret != LOCATIONS_ERROR_NONE)
return __convert_error_code(ret);