summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtrunov <dtrunov@luxoft.com>2015-05-29 11:39:39 +0300
committerdtrunov <dtrunov@luxoft.com>2015-07-17 11:34:19 +0300
commit914fe7958ef5e4ae1483070d5be3d38e142998f5 (patch)
tree7c3eaaeff9bf80226c88d147775ec22aa2feb798
parentf6a30dda295c715c4b9180f3133f98302e4efd96 (diff)
downloadsmartdevicelink-914fe7958ef5e4ae1483070d5be3d38e142998f5.tar.gz
Fixed comments after review
-rw-r--r--src/components/application_manager/include/application_manager/state_controller.h16
-rw-r--r--src/components/application_manager/src/state_controller.cc3
2 files changed, 18 insertions, 1 deletions
diff --git a/src/components/application_manager/include/application_manager/state_controller.h b/src/components/application_manager/include/application_manager/state_controller.h
index d4a2b9fc8..fc10597a6 100644
--- a/src/components/application_manager/include/application_manager/state_controller.h
+++ b/src/components/application_manager/include/application_manager/state_controller.h
@@ -58,6 +58,9 @@ class StateController : public event_engine::EventObserver {
template <bool SendActivateApp>
void SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state) {
+ if (!app) {
+ return;
+ }
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
@@ -89,6 +92,9 @@ class StateController : public event_engine::EventObserver {
void SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state) {
+ if (!app) {
+ return;
+ }
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
@@ -109,6 +115,9 @@ class StateController : public event_engine::EventObserver {
template <bool SendActivateApp>
void SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level) {
+ if (!app) {
+ return;
+ }
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
@@ -132,6 +141,9 @@ class StateController : public event_engine::EventObserver {
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::SystemContext::eType system_context) {
+ if (!app) {
+ return;
+ }
HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
HmiState::StateID::STATE_ID_REGULAR);
@@ -149,7 +161,9 @@ class StateController : public event_engine::EventObserver {
*/
void SetRegularState(ApplicationSharedPtr app,
const mobile_apis::SystemContext::eType system_context) {
-
+ if (!app) {
+ return;
+ }
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
diff --git a/src/components/application_manager/src/state_controller.cc b/src/components/application_manager/src/state_controller.cc
index 1c335d710..720312adb 100644
--- a/src/components/application_manager/src/state_controller.cc
+++ b/src/components/application_manager/src/state_controller.cc
@@ -60,6 +60,9 @@ StateController::StateController():EventObserver() {
void StateController::SetRegularState(ApplicationSharedPtr app,
const mobile_apis::AudioStreamingState::eType audio_state) {
+ if (!app) {
+ return;
+ }
HmiStatePtr prev_state = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr hmi_state = CreateHmiState(app->app_id(),