diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2018-08-28 15:12:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-28 15:12:52 -0400 |
commit | 721fcfec20f26ff86dcbd652d12e7cc26e355b7f (patch) | |
tree | 4b6475b012a40c40e1e88d91f3598ae19abe1cf0 /src/components/policy/policy_external | |
parent | ae9551d6d4c567caa88a206f6975ad8cb6ecf2c1 (diff) | |
parent | 84113996315adc1424199e13b69137fcb269f294 (diff) | |
download | sdl_core-721fcfec20f26ff86dcbd652d12e7cc26e355b7f.tar.gz |
Merge pull request #2278 from smartdevicelink/feature/boost_datetime_implementation
Feature/boost datetime implementation
Diffstat (limited to 'src/components/policy/policy_external')
6 files changed, 11 insertions, 12 deletions
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 5387a7700a..e4a4151fa4 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1117,8 +1117,8 @@ bool CacheManager::SetUserPermissionsForApp( it_group->second != is_allowed) { *out_app_permissions_changed = true; - const TimevalStruct tm = date_time::DateTime::getCurrentTime(); - int64_t current_time_msec = date_time::DateTime::getmSecs(tm); + const date_time::TimeDuration tm = date_time::getCurrentTime(); + int64_t current_time_msec = date_time::getmSecs(tm); ucr.consent_last_updated = current_time_msec; LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec); } @@ -1331,7 +1331,7 @@ int CacheManager::TimeoutResponse() { CACHE_MANAGER_CHECK(0); sync_primitives::AutoLock auto_lock(cache_lock_); return pt_->policy_table.module_config.timeout_after_x_seconds * - date_time::DateTime::MILLISECONDS_IN_SECOND; + date_time::MILLISECONDS_IN_SECOND; } bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) { @@ -2651,8 +2651,8 @@ void CacheManager::SetExternalConsentForApp( (*(*pt_->policy_table.device_data)[permissions.device_id] .user_consent_records)[permissions.policy_app_id]; - const TimevalStruct tm = date_time::DateTime::getCurrentTime(); - int64_t current_time_msec = date_time::DateTime::getmSecs(tm); + const date_time::TimeDuration tm = date_time::getCurrentTime(); + int64_t current_time_msec = date_time::getmSecs(tm); app_consent_records.ext_consent_last_updated = current_time_msec; LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 5f651645d9..c7d814e56e 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -1496,7 +1496,7 @@ void PolicyManagerImpl::CalculateGroupsConsentFromExternalConsent( bool PolicyManagerImpl::ExceededDays() { LOG4CXX_AUTO_TRACE(logger_); - TimevalStruct current_time = date_time::DateTime::getCurrentTime(); + date_time::TimeDuration current_time = date_time::getCurrentTime(); const int kSecondsInDay = 60 * 60 * 24; const int days = current_time.tv_sec / kSecondsInDay; diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index b9b0194199..6b07cc647f 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -235,10 +235,10 @@ int SQLPTRepresentation::TimeoutResponse() { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) { LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence"); - const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND; + const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND; return defaultTimeout; } - return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND; + return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND; } bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) { diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc index a7e8368239..d46f6a315a 100644 --- a/src/components/policy/policy_external/src/usage_statistics/counter.cc +++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc @@ -107,8 +107,7 @@ AppStopwatchImpl::~AppStopwatchImpl() {} void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) { stopwatch_type_ = stopwatch_type; - timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND, - timer::kPeriodic); + timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic); } void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) { diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index 4ef6ed3e10..8d2802c831 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -924,7 +924,7 @@ TEST_F( } uint32_t GetCurrentDaysCount() { - TimevalStruct current_time = date_time::DateTime::getCurrentTime(); + date_time::TimeDuration current_time = date_time::getCurrentTime(); const uint32_t kSecondsInDay = 60 * 60 * 24; return current_time.tv_sec / kSecondsInDay; } diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc index 404991c969..4df4012ad3 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc @@ -69,7 +69,7 @@ TEST_F( // To set UP_TO_DATE before registration GetPTU(kValidSdlPtUpdateJson); - const TimevalStruct current_time = date_time::DateTime::getCurrentTime(); + const date_time::TimeDuration current_time = date_time::getCurrentTime(); const int kSecondsInDay = 60 * 60 * 24; const int days_after_epoch = current_time.tv_sec / kSecondsInDay; |