!971 删除lastlocation中缓存刷新逻辑

Merge pull request !971 from liuxinbing/master
This commit is contained in:
openharmony_ci 2024-11-01 06:08:31 +00:00 committed by Gitee
commit 115bfe8e3e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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);