summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Nosach <ANosach@luxoft.com>2016-04-05 17:07:38 +0300
committerArtem Nosach <ANosach@luxoft.com>2016-04-06 09:55:59 +0300
commitff04bd99755d6f15e22f97ea40be5b5571ead4a7 (patch)
tree8477ef1416f84950b354121ca5d7567c4419bbf9
parent16cf7f086d33f49824972a2d114b82a7eddd5b48 (diff)
downloadsdl_core-ff04bd99755d6f15e22f97ea40be5b5571ead4a7.tar.gz
Update Timer class usages
Implements: APPLINK-22281
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h1
-rw-r--r--src/components/application_manager/src/application_impl.cc4
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc14
-rw-r--r--src/components/application_manager/src/request_controller.cc5
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl.cc10
-rw-r--r--src/components/policy/src/policy/src/policy_manager_impl.cc10
-rw-r--r--src/components/policy/src/policy/usage_statistics/src/counter.cc2
7 files changed, 20 insertions, 26 deletions
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h
index 98022516be..1e713c11d1 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -282,7 +282,6 @@ class RequestController {
* timer for checking requests timeout
*/
timer::Timer timer_;
- static const uint32_t default_sleep_time_ = UINT_MAX;
bool is_low_voltage_;
DISALLOW_COPY_AND_ASSIGN(RequestController);
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 67221d192d..8800d608d4 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -492,7 +492,7 @@ void ApplicationImpl::WakeUpStreaming(
MessageHelper::SendOnDataStreaming(ServiceType::kMobileNav, true);
video_streaming_suspended_ = false;
}
- video_stream_suspend_timer_.Start(video_stream_suspend_timeout_, true);
+ video_stream_suspend_timer_.Start(video_stream_suspend_timeout_, false);
} else if (ServiceType::kAudio == service_type) {
sync_primitives::AutoLock lock(audio_streaming_suspended_lock_);
if (audio_streaming_suspended_) {
@@ -501,7 +501,7 @@ void ApplicationImpl::WakeUpStreaming(
MessageHelper::SendOnDataStreaming(ServiceType::kAudio, true);
audio_streaming_suspended_ = false;
}
- audio_stream_suspend_timer_.Start(audio_stream_suspend_timeout_, true);
+ audio_stream_suspend_timer_.Start(audio_stream_suspend_timeout_, false);
}
}
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 0ff63d702e..9b6959bbc2 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -153,7 +153,7 @@ ApplicationManagerImpl::ApplicationManagerImpl()
this,
&ApplicationManagerImpl::ClearTimerPool)));
const uint32_t timeout_ms = 10000u;
- clearing_timer->Start(timeout_ms, true);
+ clearing_timer->Start(timeout_ms, false);
timer_pool_.push_back(clearing_timer);
}
@@ -442,7 +442,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
GetPolicyHandler().OnAppsSearchStarted();
uint32_t timeout =
profile::Profile::instance()->application_list_update_timeout();
- application_list_update_timer_.Start(timeout, false);
+ application_list_update_timer_.Start(timeout, true);
if (!is_all_apps_allowed_) {
LOG4CXX_WARN(logger_,
@@ -954,7 +954,7 @@ void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
LOG4CXX_DEBUG(logger_, "Starting application list update timer");
uint32_t timeout =
profile::Profile::instance()->application_list_update_timeout();
- application_list_update_timer_.Start(timeout, false);
+ application_list_update_timer_.Start(timeout, true);
GetPolicyHandler().OnAppsSearchStarted();
}
@@ -2929,7 +2929,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
new TimerTaskImpl<ApplicationManagerImpl>(
this,
&ApplicationManagerImpl::CloseNaviApp)));
- close_timer->Start(navi_close_app_timeout_, false);
+ close_timer->Start(navi_close_app_timeout_, true);
sync_primitives::AutoLock lock(timer_pool_lock_);
timer_pool_.push_back(close_timer);
@@ -2972,7 +2972,7 @@ void ApplicationManagerImpl::OnHMILevelChanged(uint32_t app_id,
this,
&ApplicationManagerImpl::EndNaviStreaming)
));
- end_stream_timer->Start(navi_end_stream_timeout_, false);
+ end_stream_timer->Start(navi_end_stream_timeout_, true);
sync_primitives::AutoLock lock(timer_pool_lock_);
timer_pool_.push_back(end_stream_timer);
@@ -3023,7 +3023,7 @@ void ApplicationManagerImpl::ClearTimerPool() {
new_timer_pool.push_back(timer_pool_[0]);
for (size_t i = 1; i < timer_pool_.size(); ++i) {
- if (timer_pool_[i]->IsRunning()) {
+ if (timer_pool_[i]->is_running()) {
new_timer_pool.push_back(timer_pool_[i]);
}
}
@@ -3251,7 +3251,7 @@ void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
LOG4CXX_INFO(logger_, "Start tts_global_properties_timer_");
tts_global_properties_app_list_lock_.Release();
const uint32_t timeout_ms = 1000;
- tts_global_properties_timer_.Start(timeout_ms, true);
+ tts_global_properties_timer_.Start(timeout_ms, false);
return;
}
tts_global_properties_app_list_lock_.Release();
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index 97f26e24cc..da05f43858 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -56,7 +56,6 @@ RequestController::RequestController()
is_low_voltage_(false) {
LOG4CXX_AUTO_TRACE(logger_);
InitializeThreadpool();
- timer_.Start(default_sleep_time_, true);
}
RequestController::~RequestController() {
@@ -498,10 +497,6 @@ void RequestController::UpdateTimer() {
<< front->timeout_msec()/date_time::DateTime::MILLISECONDS_IN_SECOND);
timer_.Start(0u, true);
}
- } else {
- LOG4CXX_DEBUG(logger_, "Sleep for default sleep time "
- << default_sleep_time_ << " milliseconds.");
- timer_.Start(default_sleep_time_, true);
}
}
diff --git a/src/components/application_manager/src/resumption/resume_ctrl.cc b/src/components/application_manager/src/resumption/resume_ctrl.cc
index 84dd9a13e8..0c98c89aba 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl.cc
@@ -105,7 +105,7 @@ bool ResumeCtrl::Init(resumption::LastState& last_state) {
save_persistent_data_timer_.Start(
profile::Profile::instance()
->app_resumption_save_persistent_data_timeout(),
- true);
+ false);
return true;
}
@@ -269,17 +269,17 @@ void ResumeCtrl::OnAwake() {
void ResumeCtrl::StartSavePersistentDataTimer() {
LOG4CXX_AUTO_TRACE(logger_);
- if (!save_persistent_data_timer_.IsRunning()) {
+ if (!save_persistent_data_timer_.is_running()) {
save_persistent_data_timer_.Start(
profile::Profile::instance()
->app_resumption_save_persistent_data_timeout(),
- true);
+ false);
}
}
void ResumeCtrl::StopSavePersistentDataTimer() {
LOG4CXX_AUTO_TRACE(logger_);
- if (save_persistent_data_timer_.IsRunning()) {
+ if (save_persistent_data_timer_.is_running()) {
save_persistent_data_timer_.Stop();
}
}
@@ -731,7 +731,7 @@ void ResumeCtrl::AddToResumptionTimerQueue(uint32_t app_id) {
if (!is_resumption_active_) {
is_resumption_active_ = true;
restore_hmi_level_timer_.Start(
- profile::Profile::instance()->app_resuming_timeout(), false);
+ profile::Profile::instance()->app_resuming_timeout(), true);
}
}
diff --git a/src/components/policy/src/policy/src/policy_manager_impl.cc b/src/components/policy/src/policy/src/policy_manager_impl.cc
index f76d8c04a2..bb2d6e1760 100644
--- a/src/components/policy/src/policy/src/policy_manager_impl.cc
+++ b/src/components/policy/src/policy/src/policy_manager_impl.cc
@@ -161,7 +161,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
cache_->SaveUpdateRequired(false);
// Update finished, no need retry
- if (timer_retry_sequence_.IsRunning()) {
+ if (timer_retry_sequence_.is_running()) {
LOG4CXX_INFO(logger_, "Stop retry sequence");
timer_retry_sequence_.Stop();
}
@@ -302,9 +302,9 @@ void PolicyManagerImpl::StartPTExchange() {
}
if (update_status_manager_.IsUpdateRequired()) {
- if (RequestPTUpdate() && !timer_retry_sequence_.IsRunning()) {
+ if (RequestPTUpdate() && !timer_retry_sequence_.is_running()) {
// Start retry sequency
- timer_retry_sequence_.Start(NextRetryTimeout(), true);
+ timer_retry_sequence_.Start(NextRetryTimeout(), false);
}
}
}
@@ -999,12 +999,12 @@ void PolicyManagerImpl::RetrySequence() {
uint32_t timeout = NextRetryTimeout();
- if (!timeout && timer_retry_sequence_.IsRunning()) {
+ if (!timeout && timer_retry_sequence_.is_running()) {
timer_retry_sequence_.Stop();
return;
}
- timer_retry_sequence_.Start(timeout, true);
+ timer_retry_sequence_.Start(timeout, false);
}
} // namespace policy
diff --git a/src/components/policy/src/policy/usage_statistics/src/counter.cc b/src/components/policy/src/policy/usage_statistics/src/counter.cc
index 4da0e469fc..4280aa0f67 100644
--- a/src/components/policy/src/policy/usage_statistics/src/counter.cc
+++ b/src/components/policy/src/policy/usage_statistics/src/counter.cc
@@ -103,7 +103,7 @@ AppStopwatchImpl::AppStopwatchImpl(
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND, true);
+ timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND, false);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {