summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-06-27 12:02:09 +0300
committerAKalinich-Luxoft <AKalinich@luxoft.com>2017-12-12 14:11:47 +0200
commit7ab0ffe3fad16f019c644ee4caecc95e295b2ef2 (patch)
treed97a2ace1cbe0dbf65fb315a58f1843b6a4c21d4 /src/components/application_manager/src
parent13c5685d110e2a0c6623e0217a54b4466792657f (diff)
downloadsdl_core-7ab0ffe3fad16f019c644ee4caecc95e295b2ef2.tar.gz
Renamed methods, updated briefs, removed deep nesting
Diffstat (limited to 'src/components/application_manager/src')
-rw-r--r--src/components/application_manager/src/application_impl.cc12
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc32
2 files changed, 22 insertions, 22 deletions
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index f9cbc72d50..ed730a8c84 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -112,7 +112,7 @@ ApplicationImpl::ApplicationImpl(
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)
, is_voice_communication_application_(false)
, is_resuming_(false)
- , flag_sending_hash_change_after_awake_(false)
+ , is_hash_changed_during_suspend_(false)
, video_stream_retry_number_(0)
, audio_stream_retry_number_(0)
, video_stream_suspend_timer_(
@@ -877,16 +877,16 @@ void ApplicationImpl::UpdateHash() {
if (!application_manager_.resume_controller().is_suspended()) {
MessageHelper::SendHashUpdateNotification(app_id(), application_manager_);
} else {
- flag_sending_hash_change_after_awake_ = true;
+ is_hash_changed_during_suspend_ = true;
}
}
-bool ApplicationImpl::flag_sending_hash_change_after_awake() const {
- return flag_sending_hash_change_after_awake_;
+bool ApplicationImpl::IsHashChangedAfterAwake() const {
+ return is_hash_changed_during_suspend_;
}
-void ApplicationImpl::set_flag_sending_hash_change_after_awake(bool flag) {
- flag_sending_hash_change_after_awake_ = flag;
+void ApplicationImpl::SetHashChangedAfterAwake(const bool state) {
+ is_hash_changed_during_suspend_ = state;
}
void ApplicationImpl::CleanupFiles() {
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
index 3db61cf177..7454451cbd 100644
--- a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
+++ b/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
@@ -47,25 +47,25 @@ OnAwakeSDLNotification::~OnAwakeSDLNotification() {}
void OnAwakeSDLNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- if (application_manager_.resume_controller().is_suspended()) {
- {
- application_manager_.resume_controller().set_is_suspended(false);
- DataAccessor<ApplicationSet> accessor =
- application_manager_.applications();
- ApplicationSetIt it = accessor.GetData().begin();
- ApplicationSetIt itEnd = accessor.GetData().end();
- for (; it != itEnd; ++it) {
- if ((*it).get()) {
- if ((*it)->flag_sending_hash_change_after_awake()) {
- MessageHelper::SendHashUpdateNotification((*it)->app_id(),
- application_manager_);
- (*it)->set_flag_sending_hash_change_after_awake(false);
- }
- }
+ if (!application_manager_.resume_controller().is_suspended()) {
+ return;
+ }
+
+ {
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetIt itBegin = accessor.GetData().begin();
+ ApplicationSetIt itEnd = accessor.GetData().end();
+ for (; itBegin != itEnd; ++itBegin) {
+ const ApplicationSharedPtr app = *itBegin;
+ if (app && app->IsHashChangedAfterAwake()) {
+ MessageHelper::SendHashUpdateNotification(app->app_id(),
+ application_manager_);
+ app->SetHashChangedAfterAwake(false);
}
}
- application_manager_.resume_controller().OnAwake();
}
+
+ application_manager_.resume_controller().OnAwake();
}
} // namespace commands