aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-23 13:34:13 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-23 14:07:42 +0900
commitbd9da3d1c82b1638c2f14056e83d0906e31667e0 (patch)
treea19690199e35bb5d4fbf94b435ea41641dc09c30
parentf3212c29d4e060bc5cc1ee60f9c034b22b6b4039 (diff)
Bugfix: Occur segmentation fault when steping on the accelerator before navi app is started
Change-Id: I5d1218c5eee9001725c14e7f20d05466b073bcfb Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
-rw-r--r--src/policy_manager/zipc/dummy_stm.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/policy_manager/zipc/dummy_stm.c b/src/policy_manager/zipc/dummy_stm.c
index fc92c3e..2e31712 100644
--- a/src/policy_manager/zipc/dummy_stm.c
+++ b/src/policy_manager/zipc/dummy_stm.c
@@ -126,6 +126,7 @@ stm_state_t g_crr_state;
stm_state_t g_prv_state;
int g_prv_restriction_state_car_stop = 0;
int g_prv_apps_state_car_stop = 0;
+int g_map_is_activated = STM_FALSE;
void stmInitialize() {
// Initialize previous state
@@ -271,8 +272,10 @@ int stmTransitionState(int event, stm_state_t* state) {
// Update apps layer
g_prv_apps_state_car_stop = apps_state;
- g_crr_state.layer.apps.state = gStmLayoutNoM1;
- g_crr_state.layer.apps.is_changed = STM_TRUE;
+ if (STM_TRUE == g_map_is_activated) {
+ g_crr_state.layer.apps.state = gStmLayoutNoM1;
+ g_crr_state.layer.apps.is_changed = STM_TRUE;
+ }
}
}
else {
@@ -286,8 +289,10 @@ int stmTransitionState(int event, stm_state_t* state) {
g_crr_state.layer.restriction.is_changed = STM_TRUE;
// Update apps layer
- g_crr_state.layer.apps.state = g_prv_apps_state_car_stop;
- g_crr_state.layer.apps.is_changed = STM_TRUE;
+ if (STM_TRUE == g_map_is_activated) {
+ g_crr_state.layer.apps.state = g_prv_apps_state_car_stop;
+ g_crr_state.layer.apps.is_changed = STM_TRUE;
+ }
}
}
}
@@ -538,5 +543,13 @@ int stmTransitionState(int event, stm_state_t* state) {
// Copy current state for return
memcpy(state, &g_crr_state, sizeof(g_crr_state));
+ if ((STM_FALSE == g_map_is_activated)
+ && (STM_TRUE == g_crr_state.layer.apps.is_changed)
+ && ((gStmLayoutNoM1 == g_crr_state.layer.apps.state)
+ || (gStmLayoutNoM2 == g_crr_state.layer.apps.state)
+ || (gStmLayoutNoMf == g_crr_state.layer.apps.state))) {
+ g_map_is_activated = STM_TRUE;
+ }
+
return 0;
}