diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-05-23 13:34:13 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-05-23 13:34:13 +0900 |
commit | 0b276469c2b1d58bf849b6bd1aeb7362e90f45e1 (patch) | |
tree | ee0f92db2489095faeee1fabeb8210a744e590a7 /src/policy_manager | |
parent | bfdd87a4db2b3441866905ac6ac3cf3039a1b20e (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>
Diffstat (limited to 'src/policy_manager')
-rw-r--r-- | src/policy_manager/zipc/dummy_stm.c | 21 |
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; } |