Fix the issue where raw accuracy value is not used and Usage of 10s timer in case... submit/tizen_2.2/20130714.152954
authorNandan SR <nandan.sr@samsung.com>
Mon, 1 Jul 2013 10:24:28 +0000 (15:54 +0530)
committerNandan SR <nandan.sr@samsung.com>
Mon, 1 Jul 2013 10:30:39 +0000 (16:00 +0530)
Change-Id: Iae6812094b58b8907165468b0cd5c63a0bd97d31
Signed-off-by: Nandan SR <nandan.sr@samsung.com>
packaging/osp-locations.changes [new file with mode: 0644]
packaging/osp-locations.spec
src/FLoc_LocationManager.cpp
src/FLoc_LocationProviderImpl.cpp

diff --git a/packaging/osp-locations.changes b/packaging/osp-locations.changes
new file mode 100644 (file)
index 0000000..d21a7c3
--- /dev/null
@@ -0,0 +1,3 @@
+version: 1.2.2.1
+Author: Nandan S R (nandan.sr@samsung.com)
+Change: 1) In region Monitoring, use the core accuracy value, instead of LocationAccuracy enum. 2) During WPS positioning, when accuracy is not met by WPS and GPS is not available, the timer value changed to 10 sec if the requested accuracy is FINEST or TEN_METERS.
index b6678c0..f4fb081 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:          osp-locations
 Summary:       The Locations library of OSP
-Version:       1.2.2.0
+Version:       1.2.2.1
 Release:       2
 Group:         System/Libraries
 License:       Apache License, Version 2
index c85d4d1..2a23afd 100644 (file)
@@ -1188,16 +1188,20 @@ _LocationManager::HandleWpsOnlyState(void)
                                if (__locMgrStatus.locMgrSubState != LM_SS_WPS_ONLY_SENSING)
                                {
                                        SysLog(NID_LOC, "The number of GPS failures is (%d)", __locMgrStatus.gpsFailCount);
-                                       double timerVal = Math::Pow(2, (__locMgrStatus.gpsFailCount - 1)) * 10;
-                                       if (timerVal > MAX_TIMER_VALUE_DURING_WPS_POSITIONING)
+                                       const int SUB_STATE_TIMER_VALUE = 10;
+                                       double timerVal = SUB_STATE_TIMER_VALUE;
+                                       if (__minRequestedAccuracy > LOC_ACCURACY_TEN_METERS)
                                        {
-                                               timerVal = MAX_TIMER_VALUE_DURING_WPS_POSITIONING;
+                                               timerVal = Math::Pow(2, (__locMgrStatus.gpsFailCount - 1)) * 10;
+                                               if (timerVal > MAX_TIMER_VALUE_DURING_WPS_POSITIONING)
+                                               {
+                                                       timerVal = MAX_TIMER_VALUE_DURING_WPS_POSITIONING;
+                                               }
                                        }
-                                       const int SUB_STATE_TIMER_VALUE = (int) timerVal;
-                                       result r = RestartSubStateTimer(SUB_STATE_TIMER_VALUE);
+                                       result r = RestartSubStateTimer((int)timerVal);
                                        if (!IsFailed(r))
                                        {
-                                               SysLog(NID_LOC, "Started the sub state timer for (%d) seconds in LOC_MGR_STATE_WPS_ONLY mode when last GPS session has failed.");
+                                               SysLog(NID_LOC, "Started the sub state timer for (%d) seconds in LOC_MGR_STATE_WPS_ONLY mode when last GPS session has failed.", timerVal);
                                                __locMgrStatus.locMgrSubState = LM_SS_WPS_ONLY_SENSING;
                                        }
                                }
index f37894a..57700ee 100644 (file)
@@ -431,7 +431,6 @@ _LocationProviderImpl::OnLocationEventReceivedN(RequestId reqId, Tizen::Location
        bool isNew = false;
        bool isPrivilegeDenied = false;
        LocationAccuracy currentAccuracy = LOC_ACCURACY_INVALID;
-       LocationAccuracy lastLocAccuracy = __lastLocationAccuracy;
        long long lastLocationTime = 0;
 
        Location* pLocation = &location;
@@ -483,7 +482,11 @@ _LocationProviderImpl::OnLocationEventReceivedN(RequestId reqId, Tizen::Location
 
                        __regionMonitor.speed = location.GetSpeed() * 0.2777778;
 
-                       if (currentAccuracy <= lastLocAccuracy || timeDifference > DEFAULT_THRESHOLD_LOC_VALIDITY_TIME_OUT)     // Copy the location only if it is new and accuracy is better than before.
+                       double currentHorAcc = pLocation->GetHorizontalAccuracy();
+                       double previousHorAcc = __regionMonitor.pLocation->GetHorizontalAccuracy();
+                       
+
+                       if (Double::IsNaN(previousHorAcc) || (!Double::IsNaN(currentHorAcc) &&  currentHorAcc <= previousHorAcc) || timeDifference > DEFAULT_THRESHOLD_LOC_VALIDITY_TIME_OUT)     // Copy the location only if it is new and accuracy is better than before.
                        {
                                *__regionMonitor.pLocation = location;
                        }