diff options
Diffstat (limited to 'src/policy_manager/zipc/dummy_stm.c')
-rw-r--r-- | src/policy_manager/zipc/dummy_stm.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/src/policy_manager/zipc/dummy_stm.c b/src/policy_manager/zipc/dummy_stm.c index 146176f..0b2120a 100644 --- a/src/policy_manager/zipc/dummy_stm.c +++ b/src/policy_manager/zipc/dummy_stm.c @@ -43,7 +43,7 @@ const char* gStmCategoryName[] = { "map", "general", "splitable", - "popup", + "pop_up", "system_alert", "restriction", "system", @@ -66,7 +66,7 @@ const char* gStmAreaName[] = { "normal", "split.main", "split.sub", - "onscreen", + "pop_up", "restriction.normal", "restriction.split.main", "restriction.split.sub", @@ -78,7 +78,7 @@ const int gStmAreaNo[] = { STM_ARA_NO_NORMAL, STM_ARA_NO_SPLIT_MAIN, STM_ARA_NO_SPLIT_SUB, - STM_ARA_NO_ON_SCREEN, + STM_ARA_NO_POP_UP, STM_ARA_NO_RESTRICTION_NORMAL, STM_ARA_NO_RESTRICTION_SPLIT_MAIN, STM_ARA_NO_RESTRICTION_SPLIT_SUB, @@ -166,6 +166,7 @@ const char** gStmCarStateNameList[] = { stm_state_t g_crr_state; stm_state_t g_prv_state; +int g_prv_on_screen_state_car_stop = 0; int g_prv_restriction_state_car_stop = 0; int g_prv_apps_state_car_stop = 0; int g_map_is_activated = STM_FALSE; @@ -192,7 +193,7 @@ void stmInitialize() { int stmTransitionState(int event, stm_state_t* state) { int event_no, category_no, area_no; - int restriction_state, apps_state; + int on_screen_state, restriction_state, apps_state; int trans_gear_state, parking_brake_state, lightstatus_brake_state, accel_pedal_state, car_state, lamp_state, restriction_mode_state; event_no = event & STM_MSK_EVT_NO; @@ -203,6 +204,7 @@ int stmTransitionState(int event, stm_state_t* state) { g_prv_state = g_crr_state; // Get previous state + on_screen_state = g_prv_state.layer[gStmLayerNoOnScreen].state; restriction_state = g_prv_state.layer[gStmLayerNoRestriction].state; apps_state = g_prv_state.layer[gStmLayerNoApps].state; trans_gear_state = g_prv_state.car_element[gStmCarElementNoTransGear].state; @@ -329,6 +331,11 @@ int stmTransitionState(int event, stm_state_t* state) { g_crr_state.car_element[gStmCarElementNoRestrictionMode].state = gStmRestrictionModeStateNoOn; g_crr_state.car_element[gStmCarElementNoRestrictionMode].changed = STM_TRUE; + // Update on screen layer + g_prv_on_screen_state_car_stop = on_screen_state; + g_crr_state.layer[gStmLayerNoOnScreen].state = gStmLayoutNoNone; + g_crr_state.layer[gStmLayerNoOnScreen].changed = STM_TRUE; + // Update restriction layer g_prv_restriction_state_car_stop = restriction_state; g_crr_state.layer[gStmLayerNoRestriction].state = gStmLayoutNoNone; @@ -350,6 +357,10 @@ int stmTransitionState(int event, stm_state_t* state) { g_crr_state.car_element[gStmCarElementNoRestrictionMode].state = gStmRestrictionModeStateNoOff; g_crr_state.car_element[gStmCarElementNoRestrictionMode].changed = STM_TRUE; + // Update on screen layer + g_crr_state.layer[gStmLayerNoOnScreen].state = g_prv_on_screen_state_car_stop; + g_crr_state.layer[gStmLayerNoOnScreen].changed = STM_TRUE; + // Update restriction layer g_crr_state.layer[gStmLayerNoRestriction].state = g_prv_restriction_state_car_stop; g_crr_state.layer[gStmLayerNoRestriction].changed = STM_TRUE; @@ -669,6 +680,32 @@ int stmTransitionState(int event, stm_state_t* state) { } } + // Set on screen layer + if (STM_CTG_NO_POPUP == category_no) { + if (STM_EVT_NO_ACTIVATE == event_no) { + switch (on_screen_state) { + case gStmLayoutNoNone: + g_crr_state.layer[gStmLayerNoOnScreen].state = gStmLayoutNoPu; + g_crr_state.layer[gStmLayerNoOnScreen].changed = STM_TRUE; + break; + default: + // nop + break; + } + } + else if (STM_EVT_NO_DEACTIVATE == event_no) { + switch (on_screen_state) { + case gStmLayoutNoPu: + g_crr_state.layer[gStmLayerNoOnScreen].state = gStmLayoutNoNone; + g_crr_state.layer[gStmLayerNoOnScreen].changed = STM_TRUE; + break; + default: + // nop + break; + } + } + } + // Copy current state for return memcpy(state, &g_crr_state, sizeof(g_crr_state)); |