+ int ret = 0;
+ if (LOCATIONS_METHOD_HYBRID == method) {
+ if (__is_gps_supported() == LOCATIONS_ERROR_NONE) {
+ ret = location_enable_method(LOCATION_METHOD_GPS, enable);
+ if (ret != LOCATIONS_ERROR_NONE) return __convert_error_code(ret);
+ }
+ if (__is_wps_supported() == LOCATIONS_ERROR_NONE) {
+ ret = location_enable_method(LOCATION_METHOD_WPS, enable);
+ return __convert_error_code(ret);
+ }
+ return LOCATIONS_ERROR_NONE;
+
+ } else {
+ if ((LOCATIONS_METHOD_GPS == method) && (__is_gps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED)) {
+ LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x)", LOCATIONS_ERROR_NOT_SUPPORTED);
+ return LOCATIONS_ERROR_NOT_SUPPORTED;
+ }
+ else if ((LOCATIONS_METHOD_WPS == method) && (__is_wps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED)) {
+ LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x)", LOCATIONS_ERROR_NOT_SUPPORTED);
+ return LOCATIONS_ERROR_NOT_SUPPORTED;
+ }
+
+ LocationMethod _method = __convert_LocationMethod(method);
+
+ int ret = location_enable_method(_method, enable);