mirror of
https://gitee.com/openharmony/base_location
synced 2024-11-23 14:59:51 +00:00
!971 删除lastlocation中缓存刷新逻辑
Merge pull request !971 from liuxinbing/master
This commit is contained in:
commit
115bfe8e3e
@ -109,7 +109,6 @@ const uint32_t REQUEST_DEFAULT_TIMEOUT_SECOUND = 5 * 60;
|
||||
const int LOCATIONHUB_STATE_UNLOAD = 0;
|
||||
const int LOCATIONHUB_STATE_LOAD = 1;
|
||||
const int MAX_SIZE = 100;
|
||||
static constexpr int LASTLOCATION_CACHED_TIME = 10 * 60;
|
||||
|
||||
LocatorAbility* LocatorAbility::GetInstance()
|
||||
{
|
||||
@ -1131,11 +1130,6 @@ LocationErrCode LocatorAbility::GetCacheLocation(std::unique_ptr<Location>& loc,
|
||||
locatorHandler_->SendHighPriorityEvent(EVENT_UPDATE_LASTLOCATION_REQUESTNUM, 0, 1)) {
|
||||
LBSLOGD(LOCATOR, "%{public}s: EVENT_UPDATE_LASTLOCATION_REQUESTNUM Send Success", __func__);
|
||||
}
|
||||
int64_t curTime = CommonUtils::GetCurrentTimeStamp();
|
||||
if (lastLocation == nullptr || (lastLocation != nullptr &&
|
||||
(curTime - lastLocation->GetTimeStamp() / MILLI_PER_SEC) > LASTLOCATION_CACHED_TIME)) {
|
||||
SelfRequestManager::GetInstance()->StartSelfRequest();
|
||||
}
|
||||
std::unique_ptr<RequestConfig> requestConfig = std::make_unique<RequestConfig>();
|
||||
sptr<ILocatorCallback> callback;
|
||||
std::shared_ptr<Request> request = std::make_shared<Request>(requestConfig, callback, identity);
|
||||
|
Loading…
Reference in New Issue
Block a user