Make altitude accuracy be non-negative real number
authorJihye Kang <jye.kang@samsung.com>
Thu, 26 Sep 2013 11:16:42 +0000 (20:16 +0900)
committerJihye Kang <jye.kang@samsung.com>
Mon, 7 Oct 2013 04:58:18 +0000 (13:58 +0900)
[Title] Make altitude accuracy be non-negative real number
[Issue#] N/A
[Problem] Altitude accuracy is -1
[Cause] Chip does not support vertical accuracy
[Solution] Because spec says it should not be a negative value, change -1 to 0

Change-Id: I6c2507b043a2f6cc5d3735f8e2e0b63797d1e68e

Source/WebKit2/UIProcess/API/efl/ewk_geolocation_provider.cpp

index e623683..0fb93d2 100644 (file)
@@ -95,10 +95,13 @@ static void ewkGeolocationProviderPositionChangedCallback(double latitude, doubl
     ret = static_cast<location_error_e>(location_manager_get_velocity(ewkGeolocationProvider->locationManager(), &climb, &direction, &speed, &velocityTimestamp));
     if (ret != LOCATIONS_ERROR_NONE)
         TIZEN_LOGE("location_manager_get_velocity error(0x%08x)", ret);
+
     if (speed)
         speed = speed * 5.0 / 18.0;
     else
         direction = std::numeric_limits<double>::quiet_NaN();
+    if (vertical < 0)
+        vertical = 0;
 
     WKRetainPtr<WKGeolocationPositionRef> position(AdoptWK, WKGeolocationPositionCreate_b(timestamp, latitude, longitude, horizontal, true, altitude, true, vertical, true, direction, true, speed));
     WKGeolocationManagerProviderDidChangePosition(ewkGeolocationProvider->wkGeolocationManager(), position.get());