diff options
author | Nandan SR <nandan.sr@samsung.com> | 2013-07-01 15:54:28 +0530 |
---|---|---|
committer | Nandan SR <nandan.sr@samsung.com> | 2013-07-01 16:00:39 +0530 |
commit | dee3204be2ddb8a6b44bf90e7674183793ef835a (patch) | |
tree | 565c2aa3d8e3c4c5703aee1ce85a3ae721db8ad5 | |
parent | 8c567f56c5f1365fa8364c3dc02f92a8744a500d (diff) | |
download | locations-dee3204be2ddb8a6b44bf90e7674183793ef835a.tar.gz locations-dee3204be2ddb8a6b44bf90e7674183793ef835a.tar.bz2 locations-dee3204be2ddb8a6b44bf90e7674183793ef835a.zip |
Fix the issue where raw accuracy value is not used and Usage of 10s timer in case of FINEST and TEN_METER accuracy
Change-Id: Iae6812094b58b8907165468b0cd5c63a0bd97d31
Signed-off-by: Nandan SR <nandan.sr@samsung.com>
-rw-r--r-- | packaging/osp-locations.changes | 3 | ||||
-rw-r--r-- | packaging/osp-locations.spec | 2 | ||||
-rw-r--r-- | src/FLoc_LocationManager.cpp | 16 | ||||
-rw-r--r-- | src/FLoc_LocationProviderImpl.cpp | 7 |
4 files changed, 19 insertions, 9 deletions
diff --git a/packaging/osp-locations.changes b/packaging/osp-locations.changes new file mode 100644 index 0000000..d21a7c3 --- /dev/null +++ b/packaging/osp-locations.changes @@ -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. diff --git a/packaging/osp-locations.spec b/packaging/osp-locations.spec index b6678c0..f4fb081 100644 --- a/packaging/osp-locations.spec +++ b/packaging/osp-locations.spec @@ -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 diff --git a/src/FLoc_LocationManager.cpp b/src/FLoc_LocationManager.cpp index c85d4d1..2a23afd 100644 --- a/src/FLoc_LocationManager.cpp +++ b/src/FLoc_LocationManager.cpp @@ -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; } } diff --git a/src/FLoc_LocationProviderImpl.cpp b/src/FLoc_LocationProviderImpl.cpp index f37894a..57700ee 100644 --- a/src/FLoc_LocationProviderImpl.cpp +++ b/src/FLoc_LocationProviderImpl.cpp @@ -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; } |