summaryrefslogtreecommitdiffstats
path: root/demo3/common/agl-service-windowmanager/policy_manager
diff options
context:
space:
mode:
Diffstat (limited to 'demo3/common/agl-service-windowmanager/policy_manager')
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/CMakeLists.txt104
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/config/layouts.json371
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/config/roles.json52
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc52
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc.split151
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/policy_manager.cpp1677
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/policy_manager.hpp174
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/stm.c176
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/stm.h233
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/stub/CMakeLists.txt44
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.c185
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.h27
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/CMakeLists.txt95
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/Event.h6
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/MisraCType.h16
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/ZCommonInclude.h16
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.c117
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.h41
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.c45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.h14
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.c1991
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.h123
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.c128
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.h22
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.c154
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.h45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.c45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.h14
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.c112
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.h39
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.c45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.h14
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.c117
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.h41
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.c45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.h14
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.c65
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.h16
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.c220
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.h53
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.c72
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.h17
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.c718
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.h82
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.c1003
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.h94
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.c81
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.h18
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c117
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h41
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h14
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_def.h15
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.c178
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.h13
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.c56
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.h20
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_include.h39
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.c1456
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.h111
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_master_apps_def.h15
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_master_remote_def.h15
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.c206
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.h45
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_inner.h22
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.c63
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.h11
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.c29
-rw-r--r--demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.h4
69 files changed, 11499 insertions, 0 deletions
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/CMakeLists.txt b/demo3/common/agl-service-windowmanager/policy_manager/CMakeLists.txt
new file mode 100644
index 0000000..5903340
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/CMakeLists.txt
@@ -0,0 +1,104 @@
+#
+# Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include(FindPkgConfig)
+pkg_check_modules(AFB REQUIRED afb-daemon)
+pkg_check_modules(SD REQUIRED libsystemd>=222)
+
+# Set name of STM
+#set(STM_DIR stub)
+set(STM_DIR zipc)
+
+# Select roles.json
+if(zipc MATCHES ${STM_DIR})
+ # if trying to show split layout, change from OFF to ON
+ set(TRY_SPLIT_LAYOUT ON CACHE BOOL "Enable to show split layout")
+
+ if(${TRY_SPLIT_LAYOUT})
+ set(ROLES_CONFIG_FILE_NAME roles.json.zipc.split)
+ else()
+ set(ROLES_CONFIG_FILE_NAME roles.json.zipc)
+ endif()
+else()
+ set(ROLES_CONFIG_FILE_NAME roles.json)
+endif()
+
+# Add STM directory
+add_subdirectory(stm/${STM_DIR})
+
+set(TARGETS_PM ${PLUGIN_PM})
+
+add_library(${TARGETS_PM}
+ SHARED
+ policy_manager.cpp
+ stm/stm.c
+ ../src/util.cpp
+)
+
+target_include_directories(${TARGETS_PM}
+ PRIVATE
+ ${AFB_INCLUDE_DIRS}
+ ${SD_INCLUDE_DIRS}
+ ../include
+ ../src
+ ./
+ ./stm
+ ./stm/${STM_DIR}
+)
+
+target_link_libraries(${TARGETS_PM}
+ PRIVATE
+ ${AFB_LIBRARIES}
+ ${SD_LIBRARIES}
+ pmstm
+)
+
+target_compile_definitions(${TARGETS_PM}
+ PRIVATE
+ _GNU_SOURCE
+)
+
+target_compile_options(${TARGETS_PM}
+ PRIVATE
+ -Wall -Wextra -Wno-unused-parameter -Wno-comment)
+
+set_target_properties(${TARGETS_PM}
+ PROPERTIES
+ CXX_EXTENSIONS OFF
+ CXX_STANDARD 14
+ CXX_STANDARD_REQUIRED ON
+
+ C_EXTENSIONS OFF
+ C_STANDARD 99
+ C_STANDARD_REQUIRED ON
+
+ LINK_FLAGS "-Wl,-rpath,'$ORIGIN'"
+)
+
+if (LINK_LIBCXX)
+ set_target_properties(${TARGETS_PM}
+ PROPERTIES
+ LINK_FLAGS "-lc++ -Wl,-rpath,'$ORIGIN'"
+ )
+endif()
+
+add_custom_command(TARGET ${TARGETS_PM} POST_BUILD
+ COMMAND mkdir -p ${PROJECT_BINARY_DIR}/package/root/lib
+ COMMAND cp -f ${PROJECT_BINARY_DIR}/${PLUGIN_PM}/lib${PLUGIN_PM}.so ${PROJECT_BINARY_DIR}/package/root/lib
+ COMMAND mkdir -p ${PROJECT_BINARY_DIR}/package/root/etc
+ COMMAND cp -f ${PROJECT_SOURCE_DIR}/${PLUGIN_PM}/config/layouts.json ${PROJECT_BINARY_DIR}/package/root/etc
+ COMMAND cp -f ${PROJECT_SOURCE_DIR}/${PLUGIN_PM}/config/${ROLES_CONFIG_FILE_NAME} ${PROJECT_BINARY_DIR}/package/root/etc/roles.json
+)
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/config/layouts.json b/demo3/common/agl-service-windowmanager/policy_manager/config/layouts.json
new file mode 100644
index 0000000..b12bce1
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/config/layouts.json
@@ -0,0 +1,371 @@
+{
+ "ecus": [
+ {
+ "name": "master",
+ "layouts": [
+ {
+ "name": "homescreen",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "homescreen"
+ }
+ ]
+ },
+ {
+ "name": "splitable.split",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "splitable_main"
+ },
+ {
+ "name": "split.sub",
+ "category": "splitable_sub"
+ }
+ ]
+ },
+ {
+ "name": "general.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "general"
+ }
+ ]
+ },
+ {
+ "name": "software_keyboard",
+ "areas": [
+ {
+ "name": "software_keyboard",
+ "category": "software_keyboard"
+ }
+ ]
+ },
+ {
+ "name": "pop_up",
+ "areas": [
+ {
+ "name": "on_screen",
+ "category": "pop_up"
+ }
+ ]
+ },
+ {
+ "name": "system_alert",
+ "areas": [
+ {
+ "name": "on_screen",
+ "category": "system_alert"
+ }
+ ]
+ },
+ {
+ "name": "tbt",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "tbt"
+ }
+ ]
+ },
+ {
+ "name": "remote_tbt",
+ "areas": [
+ {
+ "name": "master.split.sub",
+ "category": "tbt"
+ }
+ ]
+ },
+ {
+ "name": "meter.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "meter"
+ }
+ ]
+ },
+ {
+ "name": "meter_receiver",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "meter"
+ },
+ {
+ "name": "split.sub",
+ "category": "receiver"
+ }
+ ]
+ },
+ {
+ "name": "meter_splitable",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "meter"
+ },
+ {
+ "name": "split.sub",
+ "category": "splitable_sub"
+ }
+ ]
+ },
+ {
+ "name": "splitable_receiver",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "splitable_main"
+ },
+ {
+ "name": "split.sub",
+ "category": "receiver"
+ }
+ ]
+ },
+ {
+ "name": "receiver.split",
+ "areas": [
+ {
+ "name": "split.sub",
+ "category": "receiver"
+ }
+ ]
+ },
+ {
+ "name": "debug.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "debug"
+ }
+ ]
+ },
+ {
+ "name": "debug.split.main",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "debug"
+ }
+ ]
+ },
+ {
+ "name": "debug.split.sub",
+ "areas": [
+ {
+ "name": "split.sub",
+ "category": "debug"
+ }
+ ]
+ },
+ {
+ "name": "debug.fullscreen",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "debug"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "slave",
+ "layouts": [
+ {
+ "name": "homescreen",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "homescreen"
+ }
+ ]
+ },
+ {
+ "name": "map.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "map"
+ }
+ ]
+ },
+ {
+ "name": "map.split",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "map"
+ },
+ {
+ "name": "split.sub",
+ "category": "splitable"
+ }
+ ]
+ },
+ {
+ "name": "map.fullscreen",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "map"
+ }
+ ]
+ },
+ {
+ "name": "splitable.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "splitable"
+ }
+ ]
+ },
+ {
+ "name": "splitable.split",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "splitable"
+ },
+ {
+ "name": "split.sub",
+ "category": "splitable"
+ }
+ ]
+ },
+ {
+ "name": "general.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "general"
+ }
+ ]
+ },
+ {
+ "name": "system.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "system"
+ }
+ ]
+ },
+ {
+ "name": "software_keyboard",
+ "areas": [
+ {
+ "name": "software_keyboard",
+ "category": "software_keyboard"
+ }
+ ]
+ },
+ {
+ "name": "restriction.normal",
+ "areas": [
+ {
+ "name": "restriction.normal",
+ "category": "restriction"
+ }
+ ]
+ },
+ {
+ "name": "restriction.split.main",
+ "areas": [
+ {
+ "name": "restriction.split.main",
+ "category": "restriction"
+ }
+ ]
+ },
+ {
+ "name": "restriction.split.sub",
+ "areas": [
+ {
+ "name": "restriction.split.sub",
+ "category": "restriction"
+ }
+ ]
+ },
+ {
+ "name": "pop_up",
+ "areas": [
+ {
+ "name": "on_screen",
+ "category": "pop_up"
+ }
+ ]
+ },
+ {
+ "name": "system_alert",
+ "areas": [
+ {
+ "name": "on_screen",
+ "category": "system_alert"
+ }
+ ]
+ },
+ {
+ "name": "tbt",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "tbt"
+ }
+ ]
+ },
+ {
+ "name": "remote_tbt",
+ "areas": [
+ {
+ "name": "master.split.sub",
+ "category": "tbt"
+ }
+ ]
+ },
+ {
+ "name": "debug.normal",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "debug"
+ }
+ ]
+ },
+ {
+ "name": "debug.split.main",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "debug"
+ }
+ ]
+ },
+ {
+ "name": "debug.split.sub",
+ "areas": [
+ {
+ "name": "split.sub",
+ "category": "debug"
+ }
+ ]
+ },
+ {
+ "name": "debug.fullscreen",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "debug"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json b/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json
new file mode 100644
index 0000000..c657fec
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json
@@ -0,0 +1,52 @@
+{
+ "roles":[
+ {
+ "category": "homescreen",
+ "role": "homescreen",
+ "area": "fullscreen",
+ "layer": "homescreen",
+ },
+ {
+ "category": "debug",
+ "role": "launcher | map | poi | browser | sdl | mixer | radio | hvac | debug | phone | video | music | settings | dashboard | fallback",
+ "area": "normal.full | split.main | split.sub | fullscreen",
+ "layer": "apps",
+ },
+ {
+ "category": "software_keyboard",
+ "role": "software_keyboard",
+ "area": "software_keyboard",
+ "layer": "near_homescreen",
+ },
+ {
+ "category": "restriction",
+ "role": "restriction",
+ "area": "restriction.normal | restriction.split.main | restriction.split.sub",
+ "layer": "restriction",
+ },
+ {
+ "category": "pop_up",
+ "role": "on_screen | on_screen_phone",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "system_alert",
+ "role": "system_alert",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "tbt",
+ "role": "tbt",
+ "area": "normal.full | master.split.sub",
+ "layer": "remote",
+ },
+ {
+ "category": "receiver",
+ "role": "receiver",
+ "area": "normal.full | split.main | split.sub",
+ "layer": "apps",
+ }
+ ]
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc b/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc
new file mode 100644
index 0000000..facb1d8
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc
@@ -0,0 +1,52 @@
+{
+ "roles":[
+ {
+ "category": "homescreen",
+ "role": "homescreen",
+ "area": "fullscreen",
+ "layer": "homescreen",
+ },
+ {
+ "category": "map",
+ "role": "map",
+ "area": "normal.full | split.main",
+ "layer": "apps",
+ },
+ {
+ "category": "general",
+ "role": "launcher | poi | browser | sdl | mixer | radio | hvac | debug | phone | video | music | fallback",
+ "area": "normal.full",
+ "layer": "apps",
+ },
+ {
+ "category": "system",
+ "role": "settings | dashboard",
+ "area": "normal.full",
+ "layer": "apps",
+ },
+ {
+ "category": "software_keyboard",
+ "role": "software_keyboard",
+ "area": "software_keyboard",
+ "layer": "near_homescreen",
+ },
+ {
+ "category": "restriction",
+ "role": "restriction",
+ "area": "restriction.normal | restriction.split.main | restriction.split.sub",
+ "layer": "restriction",
+ },
+ {
+ "category": "pop_up",
+ "role": "on_screen | on_screen_phone",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "system_alert",
+ "role": "system_alert",
+ "area": "on_screen",
+ "layer": "on_screen",
+ }
+ ]
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc.split b/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc.split
new file mode 100644
index 0000000..e21e961
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/config/roles.json.zipc.split
@@ -0,0 +1,151 @@
+{
+ "ecus": [
+ {
+ "name": "master",
+ "roles":[
+ {
+ "category": "homescreen",
+ "role": "homescreen",
+ "area": "fullscreen",
+ "layer": "homescreen",
+ },
+ {
+ "category": "general",
+ "role": "launcher | browser | debug | settings | hvac | dashboard | fallback",
+ "area": "normal.full",
+ "description": "For split test, video and music are moved to category:splitable",
+ "layer": "apps",
+ },
+ {
+ "category": "splitable_main",
+ "role": "mixer | video | phone",
+ "area": "split.main",
+ "description": "For split test, video and music are included here",
+ "layer": "apps",
+ },
+ {
+ "category": "splitable_sub",
+ "role": "music | radio | poi",
+ "area": "split.sub",
+ "description": "For split test, video and music are included here",
+ "layer": "apps",
+ },
+ {
+ "category": "software_keyboard",
+ "role": "software_keyboard",
+ "area": "software_keyboard",
+ "layer": "near_homescreen",
+ },
+ {
+ "category": "pop_up",
+ "role": "on_screen | on_screen_phone | onscreen",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "system_alert",
+ "role": "system_alert",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "tbt",
+ "role": "tbtnavi",
+ "area": "master.split.sub",
+ "layer": "remote",
+ },
+ {
+ "category": "meter",
+ "role": "tachometer",
+ "area": "split.main | normal.full",
+ "layer": "apps",
+ },
+ {
+ "category": "receiver",
+ "role": "receiver",
+ "area": "split.sub | normal.full",
+ "layer": "apps",
+ }
+ ]
+ },
+ {
+ "name": "slave",
+ "roles":[
+ {
+ "category": "homescreen",
+ "role": "homescreen",
+ "area": "fullscreen",
+ "layer": "homescreen",
+ },
+ {
+ "category": "map",
+ "role": "navigation",
+ "area": "normal.full | split.main | fullscreen",
+ "layer": "apps",
+ },
+ {
+ "category": "general",
+ "role": "launcher | poi | browser | mixer | radio | hvac | debug | phone | fallback",
+ "area": "normal.full",
+ "description": "For split test, video and music are moved to category:splitable",
+ "layer": "apps",
+ },
+ {
+ "category": "system",
+ "role": "settings | dashboard",
+ "area": "normal.full",
+ "layer": "apps",
+ },
+ {
+ "category": "splitable",
+ "role": "video | music | sdl | webbrowser | eb",
+ "area": "normal.full | split.main | split.sub",
+ "description": "For split test, video and music are included here",
+ "layer": "apps",
+ },
+ {
+ "category": "software_keyboard",
+ "role": "software_keyboard",
+ "area": "software_keyboard",
+ "layer": "near_homescreen",
+ },
+ {
+ "category": "restriction",
+ "role": "restriction",
+ "area": "restriction.normal | restriction.split.main | restriction.split.sub",
+ "layer": "restriction",
+ },
+ {
+ "category": "pop_up",
+ "role": "on_screen | on_screen_phone | onscreen",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "system_alert",
+ "role": "system_alert",
+ "area": "on_screen",
+ "layer": "on_screen",
+ },
+ {
+ "category": "tbt",
+ "role": "tbtnavi",
+ "area": "master.split.sub",
+ "layer": "remote",
+ },
+ {
+ "category": "meter",
+ "role": "tachometer",
+ "area": "split.main | normal.full",
+ "layer": "apps",
+ },
+ {
+ "category": "receiver",
+ "role": "receiver",
+ "area": "split.sub | normal.full",
+ "layer": "apps",
+ }
+ ]
+ }
+ ]
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/policy_manager.cpp b/demo3/common/agl-service-windowmanager/policy_manager/policy_manager.cpp
new file mode 100644
index 0000000..05f2ccb
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/policy_manager.cpp
@@ -0,0 +1,1677 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <fstream>
+#include <sstream>
+#include <istream>
+#include <thread>
+#include <map>
+#include <algorithm>
+#include <json-c/json.h>
+#include "policy_manager.hpp"
+#include "util.hpp"
+
+extern "C"
+{
+#define AFB_BINDING_VERSION 2
+#include <afb/afb-binding.h>
+#include <systemd/sd-event.h>
+#include "stm.h"
+}
+
+namespace pm
+{
+static const char kPathRolesConfigFile[] = "/etc/roles.json";
+static const char kPathLayoutsConfigFile[] = "/etc/layouts.json";
+
+static const int kInvisibleRoleHistoryNum = 5;
+
+static PolicyManager *g_context;
+
+static int transitionStateWrapper(sd_event_source *source, void *data)
+{
+ int ret = g_context->transitionState(source, data);
+ return ret;
+}
+
+static int timerEventWrapper(sd_event_source *source, uint64_t usec, void *data)
+{
+ int ret = g_context->timerEvent(source, usec, data);
+ return ret;
+}
+
+} // namespace pm
+
+PolicyManager::PolicyManager()
+ : eventname2no(),
+ categoryname2no(),
+ areaname2no(),
+ role2category(),
+ category2role(),
+ category2areas()
+{
+ this->p_crr_state = new (StmState);
+ this->p_prv_state = new (StmState);
+}
+
+PolicyManager::~PolicyManager()
+{
+ delete this->p_crr_state;
+ delete this->p_prv_state;
+}
+
+int PolicyManager::initialize(std::string ecu_name)
+{
+ int ret = 0;
+
+ // Set ECU name
+ this->ecu_name = ecu_name;
+
+ // Create convert map
+ for (int i = StmEvtNoMin; i <= StmEvtNoMax; i++)
+ {
+ HMI_DEBUG("event name:%s no:%d", kStmEventName[i], i);
+ this->eventname2no[kStmEventName[i]] = i;
+ }
+
+ for (int i = StmCtgNoMin; i <= StmCtgNoMax; i++)
+ {
+ HMI_DEBUG("category name:%s no:%d", kStmCategoryName[i], i);
+ this->categoryname2no[kStmCategoryName[i]] = i;
+ }
+
+ for (int i = StmAreaNoMin; i <= StmAreaNoMax; i++)
+ {
+ HMI_DEBUG("area name:%s no:%d", kStmAreaName[i], i);
+ this->areaname2no[kStmAreaName[i]] = i;
+ }
+
+ // Load roles config
+ ret = this->loadRolesConfigFile();
+ if (0 > ret)
+ {
+ HMI_ERROR("Load roles config file Error!!");
+ return ret;
+ }
+
+ // Load layouts config
+ ret = this->loadLayoutsConfigFile();
+ if (0 > ret)
+ {
+ HMI_ERROR("Load layouts config file Error!!");
+ return ret;
+ }
+
+ // Initialize state which is managed by PolicyManager
+ this->initializeState();
+
+ // Initialize StateTransitioner
+ stmInitialize(ecu_name.c_str());
+
+ // Store instance
+ pm::g_context = this;
+
+ return ret;
+}
+
+void PolicyManager::registerCallback(CallbackTable callback)
+{
+ this->callback.onStateTransitioned = callback.onStateTransitioned;
+ this->callback.onError = callback.onError;
+}
+
+int PolicyManager::setInputEventData(json_object *json_in)
+{
+ // Check arguments
+ if (nullptr == json_in)
+ {
+ HMI_ERROR("Argument is NULL!!");
+ return -1;
+ }
+
+ // Get event from json_object
+ const char *event = this->getStringFromJson(json_in, "event");
+ int event_no = StmEvtNoNone;
+ if (nullptr != event)
+ {
+ // Convert name to number
+ auto itr = this->eventname2no.find(event);
+ if (this->eventname2no.end() != itr)
+ {
+ event_no = this->eventname2no[event];
+ HMI_DEBUG("event(%s:%d)", event, event_no);
+ }
+ else
+ {
+ HMI_ERROR("Invalid event name!!");
+ return -1;
+ }
+ }
+ else
+ {
+ HMI_ERROR("Event is not set!!");
+ return -1;
+ }
+
+ // Get role from json_object
+ const char *role = this->getStringFromJson(json_in, "role");
+ std::string category = "";
+ int category_no = StmCtgNoNone;
+ if (nullptr != role)
+ {
+ HMI_DEBUG("role(%s)", role);
+
+ // Convert role to category
+ auto itr = this->role2category.find(role);
+ if (this->role2category.end() != itr)
+ {
+ category = this->role2category[role];
+ }
+ else
+ {
+ itr = this->role2category.find("fallback");
+ if (this->role2category.end() != itr)
+ {
+ HMI_DEBUG("Role:%s is not registered in roles config file, fallback as normal app", role);
+ category = this->role2category["fallback"];
+ }
+ }
+
+ if ("" != category)
+ {
+ // Convert name to number
+ category_no = categoryname2no[category];
+ HMI_DEBUG("category(%s:%d)", category.c_str(), category_no);
+ }
+ }
+ if (StmCtgNoNone == category_no)
+ {
+ role = "";
+ }
+
+ // Get area from json_object
+ const char *area = this->getStringFromJson(json_in, "area");
+ int area_no = StmAreaNoNone;
+ if ((nullptr != area) && (StmCtgNoNone != category_no))
+ {
+ for (const auto &x : this->category2areas[category])
+ {
+ if (x == std::string(area))
+ {
+ area_no = this->areaname2no[area];
+ break;
+ }
+ }
+ if (StmAreaNoNone == area_no)
+ {
+ area = this->category2areas[category].front().c_str();
+ area_no = this->areaname2no[area];
+ }
+ HMI_DEBUG("area(%s:%d)", area, area_no);
+ }
+
+ // Set event info to the queue
+ EventInfo event_info;
+ int event_id = STM_CREATE_EVENT_ID(event_no, category_no, area_no);
+ event_info.event = event_id;
+ event_info.role = std::string(role);
+ event_info.delay = 0;
+ this->event_info_queue.push(event_info);
+
+ return 0;
+}
+
+int PolicyManager::executeStateTransition()
+{
+ int ret;
+ EventInfo event_info;
+
+ // Get event info from queue and delete
+ event_info = this->event_info_queue.front();
+ this->event_info_queue.pop();
+
+ // Set event info to check policy
+ ret = this->setStateTransitionProcessToSystemd(event_info.event,
+ event_info.delay,
+ event_info.role);
+ return ret;
+}
+
+void PolicyManager::undoState()
+{
+ HMI_DEBUG("Undo State !!!");
+
+ // Undo state of STM
+ stmUndoState();
+
+ HMI_DEBUG(">>>>>>>>>> BEFORE UNDO");
+ this->dumpLayerState(this->crr_layers);
+
+ this->crr_layers = this->prv_layers;
+ this->crr_invisible_role_history = this->prv_invisible_role_history;
+
+ HMI_DEBUG(">>>>>>>>>> AFTER UNDO");
+ this->dumpLayerState(this->crr_layers);
+}
+
+void PolicyManager::initializeState()
+{
+ this->initializeModeState();
+ this->initializeLayerState();
+}
+
+void PolicyManager::initializeModeState()
+{
+ Mode init_car_ele;
+ init_car_ele.state = "none";
+ init_car_ele.changed = false;
+
+ for (int i = StmCarElementNoMin; i <= StmCarElementNoMax; i++)
+ {
+ const char *car_ele_name = kStmCarElementName[i];
+ this->crr_car_elements[car_ele_name] = init_car_ele;
+ }
+
+ this->prv_car_elements = this->crr_car_elements;
+}
+
+void PolicyManager::initializeLayerState()
+{
+ AreaState init_area;
+ LayoutState init_layout;
+ init_area.name = kStmAreaName[StmAreaNoNone];
+ init_area.category = kStmCategoryName[StmCtgNoNone];
+ init_area.role = "";
+ init_layout.name = kStmLayoutName[StmLayoutNoNone];
+ init_layout.area_list.push_back(init_area);
+
+ for (int i = StmLayerNoMin; i <= StmLayerNoMax; i++)
+ {
+ const char *layer_name = kStmLayerName[i];
+ this->crr_layers[layer_name].name = layer_name;
+ this->crr_layers[layer_name].layout_state = init_layout;
+ this->crr_layers[layer_name].changed = false;
+ }
+
+ this->prv_layers = this->crr_layers;
+}
+
+void PolicyManager::addStateToJson(const char *name, bool changed,
+ std::string state, json_object **json_out)
+{
+ if ((nullptr == name) || (nullptr == json_out))
+ {
+ HMI_ERROR("Invalid argument!!!");
+ return;
+ }
+
+ json_object_object_add(*json_out, "name", json_object_new_string(name));
+ json_object_object_add(*json_out, "state", json_object_new_string(state.c_str()));
+ json_object_object_add(*json_out, "changed", json_object_new_boolean(changed));
+}
+
+void PolicyManager::addStateToJson(const char *layer_name, bool changed,
+ AreaList area_list, json_object **json_out)
+{
+ if ((nullptr == layer_name) || (nullptr == json_out))
+ {
+ HMI_ERROR("Invalid argument!!!");
+ return;
+ }
+
+ json_object *json_areas = json_object_new_array();
+ json_object *json_tmp;
+ for (const auto &as : area_list)
+ {
+ json_tmp = json_object_new_object();
+ json_object_object_add(json_tmp, "name", json_object_new_string(as.name.c_str()));
+ json_object_object_add(json_tmp, "role", json_object_new_string(as.role.c_str()));
+ json_object_array_add(json_areas, json_tmp);
+ }
+
+ json_object_object_add(*json_out, "name", json_object_new_string(layer_name));
+ json_object_object_add(*json_out, "changed", json_object_new_boolean(changed));
+ json_object_object_add(*json_out, "areas", json_areas);
+}
+
+void PolicyManager::updateState(int event_id)
+{
+ this->updateModeState();
+ this->updateLayer(event_id);
+}
+
+void PolicyManager::updateModeState()
+{
+ int car_state_no;
+ std::string car_state;
+ bool changed;
+
+ // Store previous layers
+ this->prv_car_elements = this->crr_car_elements;
+
+ // Update car elements
+ HMI_DEBUG(">>> CAR ELEMENTS");
+ for (int car_ele_no = StmCarElementNoMin;
+ car_ele_no <= StmCarElementNoMax; car_ele_no++)
+ {
+ const char *car_ele_name = kStmCarElementName[car_ele_no];
+
+ car_state_no = this->p_crr_state->car_element[car_ele_no].state;
+ car_state = kStmCarElementStateNameList[car_ele_no][car_state_no];
+ changed = (this->p_crr_state->car_element[car_ele_no].changed) ? true : false;
+
+ this->crr_car_elements[car_ele_name].state = car_state;
+ this->crr_car_elements[car_ele_name].changed = changed;
+
+ HMI_DEBUG(">>> >>> NAME: %s", car_ele_name);
+ HMI_DEBUG(">>> >>> >>> STATE:%s", car_state.c_str());
+ HMI_DEBUG(">>> >>> >>> CHANGED:%s", (changed) ? "true" : "false");
+ }
+}
+
+void PolicyManager::updateLayer(int event_id)
+{
+ for (int layer_no = StmLayerNoMin;
+ layer_no <= StmLayerNoMax; layer_no++)
+ {
+ HMI_DEBUG(">>> LAYER:%s CHANGED:%d LAYOUT:%s",
+ kStmLayerName[layer_no], this->p_crr_state->layer[layer_no].changed,
+ kStmLayoutName[this->p_crr_state->layer[layer_no].state]);
+ }
+
+ // Store previous layers
+ this->prv_layers = this->crr_layers;
+
+ // Store previous role history
+ this->prv_invisible_role_history = this->crr_invisible_role_history;
+
+ // Update layers
+ for (int layer_no = StmLayerNoMin;
+ layer_no <= StmLayerNoMax; layer_no++)
+ {
+ const char *layer_name = kStmLayerName[layer_no];
+
+ // If restriction mode is changed to mode2 on,
+ // store current state for state of restriction mode off
+ if (this->changedRestrictionModeTo2On() ||
+ this->changedLightstatusBrakeOnToOff())
+ {
+ HMI_DEBUG("Store current state for state of restriction mode off");
+ this->prv_layers_car_stop[layer_name] = this->crr_layers[layer_name];
+ }
+
+ // This layer is changed?
+ int changed = this->p_crr_state->layer[layer_no].changed;
+ if (changed)
+ {
+ HMI_DEBUG(">>>>>>>>>> Update layout of layer:%s", layer_name);
+
+ // Get current layout name of this layer
+ int crr_layout_state_no = this->p_crr_state->layer[layer_no].state;
+ std::string crr_layout_name = std::string(kStmLayoutName[crr_layout_state_no]);
+
+ LayoutState crr_layout_state;
+ changed = this->updateLayout(event_id, layer_no,
+ crr_layout_name, crr_layout_state);
+
+ // Update current layout of this layer
+ this->crr_layers[layer_name].layout_state = crr_layout_state;
+ }
+ else
+ {
+ int category_no = STM_GET_CATEGORY_FROM_ID(event_id);
+ std::string req_ctg = kStmCategoryName[category_no];
+ std::string req_role = this->req_role_list[event_id];
+ for (const auto &ctg : this->layer2categories[layer_name])
+ {
+ if (ctg == req_ctg)
+ {
+ // If layer is not changed and requested role is in this layer,
+ // push requested role to history stack
+ // because the application which has this role have been started
+ HMI_DEBUG("Add requested role to history "
+ "because the application which has this role have been started");
+ this->pushInvisibleRoleHistory(req_ctg, req_role);
+ }
+ }
+ }
+
+ // Update changed flag
+ this->crr_layers[layer_name].changed = (changed) ? true : false;
+ }
+
+ // Erase role for the event_id from list
+ this->req_role_list.erase(event_id);
+
+ HMI_DEBUG(">>>>>>>>>> DUMP LAYERS (BEFORE)");
+ this->dumpLayerState(this->prv_layers);
+
+ HMI_DEBUG(">>>>>>>>>> DUMP LAYERS (AFTER)");
+ this->dumpLayerState(this->crr_layers);
+
+ this->dumpInvisibleRoleHistory();
+}
+
+int PolicyManager::updateLayout(int event_id, int layer_no,
+ std::string crr_layout_name, LayoutState &crr_layout_state)
+{
+ int changed = 1;
+
+ int event_no = STM_GET_EVENT_FROM_ID(event_id);
+ int category_no = STM_GET_CATEGORY_FROM_ID(event_id);
+ int area_no = STM_GET_AREA_FROM_ID(event_id);
+
+ std::string req_evt = kStmEventName[event_no];
+ std::string req_ctg = kStmCategoryName[category_no];
+ std::string req_area = kStmAreaName[area_no];
+ std::string req_role = this->req_role_list[event_id];
+
+ const char *layer_name = kStmLayerName[layer_no];
+
+ // Get previous layout name of this layer
+ LayoutState prv_layout_state = this->prv_layers[layer_name].layout_state;
+ std::string prv_layout_name = prv_layout_state.name;
+
+ if (this->changedRestrictionMode2OnToOther() ||
+ this->changedLightstatusBrakeOffToOn())
+ {
+ // If restriction mode is changed from mode2 -> mode1,
+ // restore state of restriction mode off
+ HMI_DEBUG("Restriction mode is changed from mode2 -> mode1, so restore state of restriction mode off");
+ crr_layout_state = this->prv_layers_car_stop[layer_name].layout_state;
+ crr_layout_name = crr_layout_state.name;
+ if ((prv_layout_name == crr_layout_name) &&
+ (kStmAreaName[StmAreaNoNone] == crr_layout_name))
+ {
+ changed = 0;
+ }
+ else
+ {
+ // If the roles which is exist in previous layout is not in current,
+ // push to role history
+ for (const auto &prv_as : prv_layout_state.area_list)
+ {
+ for (const auto &crr_as : crr_layout_state.area_list)
+ {
+ if (prv_as.role == crr_as.role)
+ break;
+ }
+
+ this->pushInvisibleRoleHistory(prv_as.category, prv_as.role);
+ }
+ }
+ }
+ else if ((prv_layout_name == crr_layout_name) &&
+ (kStmLayoutName[StmLayoutNoNone] == crr_layout_name))
+ {
+ // If previous and current layout are none
+ // Copy previous layout state for current
+ crr_layout_state = prv_layout_state;
+ changed = 0;
+ }
+ else
+ {
+ crr_layout_state = prv_layout_state;
+ changed = 1;
+
+ HMI_DEBUG("-- layout name previous:%s current:%s",
+ prv_layout_name.c_str(), crr_layout_name.c_str());
+ if (prv_layout_name == crr_layout_name)
+ {
+ HMI_DEBUG("---- Previous layout is same with current");
+ }
+ else
+ {
+ // If previous layout is NOT same with current,
+ // current areas is set with default value
+ HMI_DEBUG("---- Previous layout is NOT same with current");
+ crr_layout_state.name = this->default_layouts[crr_layout_name].name;
+ crr_layout_state.category_num = this->default_layouts[crr_layout_name].category_num;
+ crr_layout_state.area_list = this->default_layouts[crr_layout_name].area_list;
+ }
+
+ // Create candidate list
+ std::map<std::string, AreaList> cand_list;
+ // for (int ctg_no = StmCtgNoMin;
+ // ctg_no <= StmCtgNoMax; ctg_no++)
+ // {
+ for (const auto &ctg : this->layer2categories[layer_name])
+ {
+ // if (ctg_no == StmCtgNoNone)
+ // {
+ // continue;
+ // }
+
+ // const char *ctg = kStmCategoryName[ctg_no];
+ HMI_DEBUG("-- Create candidate list for ctg:%s", ctg.c_str());
+
+ AreaList tmp_cand_list;
+ int candidate_num = 0;
+ int blank_num = crr_layout_state.category_num[ctg];
+
+ // If requested event is "activate"
+ // and there are requested category and area,
+ // update area with requested role in current layout.
+ bool request_for_this_layer = false;
+ std::string used_role = "";
+ if ((ctg == req_ctg) && ("activate" == req_evt))
+ {
+ HMI_DEBUG("---- Requested event is activate");
+ for (AreaState &as : crr_layout_state.area_list)
+ {
+ if (as.category == req_ctg)
+ {
+ request_for_this_layer = true;
+
+ if (as.name == req_area)
+ {
+ as.role = req_role;
+ used_role = req_role;
+ blank_num--;
+ HMI_DEBUG("------ Update current layout: area:%s category:%s role:%s",
+ as.name.c_str(), as.category.c_str(), as.role.c_str());
+ break;
+ }
+ }
+ }
+ }
+
+ // Create candidate list for category from the previous displayed categories
+ for (AreaState area_state : prv_layout_state.area_list)
+ {
+ if ((ctg == area_state.category) &&
+ (used_role != area_state.role))
+ {
+ // If there is the category
+ // which is same with new category and not used for updating yet,
+ // push it to list
+ HMI_DEBUG("---- Push previous(category:%s role:%s) to candidate list",
+ area_state.category.c_str(), area_state.role.c_str());
+ tmp_cand_list.push_back(area_state);
+ candidate_num++;
+ }
+ }
+
+ // If NOT updated by requested area:
+ // there is not requested area in new layout,
+ // so push requested role to candidate list
+ if (request_for_this_layer && ("" == used_role))
+ {
+ HMI_DEBUG("---- Push request(area:%s category:%s role:%s) to candidate list",
+ req_area.c_str(), req_ctg.c_str(), req_role.c_str());
+ AreaState area_state;
+ area_state.name = req_area;
+ area_state.category = req_ctg;
+ area_state.role = req_role;
+ tmp_cand_list.push_back(area_state);
+ candidate_num++;
+ }
+
+ HMI_DEBUG("---- blank_num:%d candidate_num:%d", blank_num, candidate_num);
+
+ // Compare number of candidate/blank,
+ // And remove role in order of the oldest as necessary
+ if (candidate_num < blank_num)
+ {
+ // Refer history stack
+ // and add to the top of tmp_cand_list in order to the newest
+ while (candidate_num != blank_num)
+ {
+ AreaState area_state;
+ area_state.name = kStmAreaName[StmAreaNoNone];
+ area_state.category = ctg;
+ area_state.role = this->popInvisibleRoleHistory(ctg);
+ if ("" == area_state.role)
+ {
+ HMI_ERROR("There is no role in history stack!!");
+ }
+ tmp_cand_list.push_back(area_state);
+ HMI_DEBUG("------ Add role:%s to candidate list",
+ area_state.role.c_str());
+ candidate_num++;
+ }
+ }
+ else if (candidate_num > blank_num)
+ {
+ // Remove the oldest role from candidate list
+ while (candidate_num != blank_num)
+ {
+ std::string removed_role = tmp_cand_list.begin()->role;
+ HMI_DEBUG("------ Remove the oldest role:%s from candidate list",
+ removed_role.c_str());
+ tmp_cand_list.erase(tmp_cand_list.begin());
+ candidate_num--;
+
+ // Push removed data to history stack
+ this->pushInvisibleRoleHistory(ctg, removed_role);
+
+ // Remove from current layout
+ for (AreaState &as : crr_layout_state.area_list)
+ {
+ if (as.role == removed_role)
+ {
+ as.role = "";
+ }
+ }
+ }
+ }
+ else
+ { // (candidate_num == blank_num)
+ // nop
+ }
+
+ cand_list[ctg] = tmp_cand_list;
+ }
+
+ // Update areas
+ HMI_DEBUG("-- Update areas by using candidate list");
+ for (AreaState &as : crr_layout_state.area_list)
+ {
+ HMI_DEBUG("---- Check area:%s category:%s role:%s",
+ as.name.c_str(), as.category.c_str(), as.role.c_str());
+ if ("" == as.role)
+ {
+ HMI_DEBUG("------ Update this area with role:%s",
+ cand_list[as.category].begin()->role.c_str());
+ as.role = cand_list[as.category].begin()->role;
+ cand_list[as.category].erase(cand_list[as.category].begin());
+ }
+ }
+ }
+ return changed;
+}
+
+void PolicyManager::createOutputInformation(json_object **json_out)
+{
+ json_object *json_tmp;
+
+ // Create car element information
+ // {
+ // "car_elements": [
+ // {
+ // "parking_brake": {
+ // "changed": <bool>,
+ // "state": <const char*>
+ // },
+ // ...
+ // },
+ json_object *json_car_ele = json_object_new_array();
+ const char *car_ele_name;
+ for (int car_ele_no = StmCarElementNoMin;
+ car_ele_no <= StmCarElementNoMax; car_ele_no++)
+ {
+ car_ele_name = kStmCarElementName[car_ele_no];
+ json_tmp = json_object_new_object();
+ this->addStateToJson(car_ele_name,
+ this->crr_car_elements[car_ele_name].changed,
+ this->crr_car_elements[car_ele_name].state,
+ &json_tmp);
+ json_object_array_add(json_car_ele, json_tmp);
+ }
+ json_object_object_add(*json_out, "car_elements", json_car_ele);
+
+ // Create layout information
+ //
+ // "layers": [
+ // {
+ // "homescreen": {
+ // "changed": <bool>,
+ // "areas": [
+ // {
+ // "name":<const char*>,
+ // "role":<const char*>
+ // }.
+ // ...
+ // ]
+ // }
+ // },
+ // ...
+ json_object *json_layer = json_object_new_array();
+ const char *layer_name;
+ for (int layer_no = StmLayerNoMin;
+ layer_no <= StmLayerNoMax; layer_no++)
+ {
+ layer_name = kStmLayerName[layer_no];
+ json_tmp = json_object_new_object();
+ this->addStateToJson(layer_name,
+ this->crr_layers[layer_name].changed,
+ this->crr_layers[layer_name].layout_state.area_list,
+ &json_tmp);
+ json_object_array_add(json_layer, json_tmp);
+ }
+ json_object_object_add(*json_out, "layers", json_layer);
+}
+
+void PolicyManager::controlTimerEvent()
+{
+ if (this->p_crr_state->car_element[StmCarElementNoRunning].changed)
+ {
+ if (StmRunningNoRun == this->p_crr_state->car_element[StmCarElementNoRunning].state)
+ {
+ // Set delay event(restriction mode on)
+ this->setStateTransitionProcessToSystemd(StmEvtNoRestrictionModeOn,
+ 3000, "");
+ }
+ else if (StmRunningNoStop ==
+ this->p_crr_state->car_element[StmCarElementNoRunning].state)
+ {
+ // Stop timer for restriction on event
+ if (this->event_source_list.find(StmEvtNoRestrictionModeOn) !=
+ this->event_source_list.end())
+ {
+ HMI_DEBUG("Stop timer for restriction on");
+ sd_event_source *event_source = this->event_source_list[StmEvtNoRestrictionModeOn];
+ int ret = sd_event_source_set_enabled(event_source, SD_EVENT_OFF);
+ if (0 > ret)
+ {
+ HMI_ERROR("Failed to stop timer");
+ }
+ }
+
+ // Set event(restriction mode off)
+ this->setStateTransitionProcessToSystemd(StmEvtNoRestrictionModeOff, 0, "");
+ }
+ }
+}
+
+int PolicyManager::transitionState(sd_event_source *source, void *data)
+{
+ HMI_DEBUG(">>>>>>>>>> START STATE TRANSITION");
+
+ int event_id = *((int *)data);
+
+ int event_no, category_no, area_no;
+ event_no = STM_GET_EVENT_FROM_ID(event_id);
+ category_no = STM_GET_CATEGORY_FROM_ID(event_id);
+ area_no = STM_GET_AREA_FROM_ID(event_id);
+ HMI_DEBUG(">>>>>>>>>> EVENT:%s CATEGORY:%s AREA:%s",
+ kStmEventName[event_no],
+ kStmCategoryName[category_no],
+ kStmAreaName[area_no]);
+
+ // Store current state
+ *(this->p_prv_state) = *(this->p_crr_state);
+
+ // Transition state
+ int ret = stmTransitionState(event_id, this->p_crr_state);
+ if (0 > ret)
+ {
+ HMI_ERROR("Failed transition state");
+ if (nullptr != this->callback.onError)
+ {
+ json_object *json_out = json_object_new_object();
+ json_object_object_add(json_out, "message",
+ json_object_new_string("Failed to transition state"));
+ json_object_object_add(json_out, "event",
+ json_object_new_string(kStmEventName[event_no]));
+ json_object_object_add(json_out, "role",
+ json_object_new_string(this->req_role_list[event_id].c_str()));
+ json_object_object_add(json_out, "area",
+ json_object_new_string(kStmAreaName[area_no]));
+ this->callback.onError(json_out);
+ json_object_put(json_out);
+ }
+ return -1;
+ }
+
+ // Update state which is managed by PolicyManager
+ this->updateState(event_id);
+
+ // Create output information for ResourceManager
+ json_object *json_out = json_object_new_object();
+ this->createOutputInformation(&json_out);
+
+ // Notify changed state
+ if (nullptr != this->callback.onStateTransitioned)
+ {
+ this->callback.onStateTransitioned(json_out);
+ }
+
+ // Start/Stop timer events
+ this->controlTimerEvent();
+
+ // Release json_object
+ json_object_put(json_out);
+
+ // Release data
+ delete (int *)data;
+
+ // Destroy sd_event_source object
+ sd_event_source_unref(source);
+
+ // Remove event source from list
+ if (this->event_source_list.find(event_id) != this->event_source_list.end())
+ {
+ this->event_source_list.erase(event_id);
+ }
+
+ HMI_DEBUG(">>>>>>>>>> FINISH STATE TRANSITION");
+ return 0;
+}
+
+int PolicyManager::timerEvent(sd_event_source *source, uint64_t usec, void *data)
+{
+ HMI_DEBUG("Call");
+
+ int ret = this->transitionState(source, data);
+ return ret;
+}
+
+int PolicyManager::setStateTransitionProcessToSystemd(int event_id, uint64_t delay_ms, std::string role)
+{
+ struct sd_event_source *event_source;
+ HMI_DEBUG("event_id:0x%x delay:%d role:%s", event_id, delay_ms, role.c_str());
+
+ if (0 == delay_ms)
+ {
+ int ret = sd_event_add_defer(afb_daemon_get_event_loop(), &event_source,
+ &pm::transitionStateWrapper, new int(event_id));
+ if (0 > ret)
+ {
+ HMI_ERROR("Faild to sd_event_add_defer: errno:%d", ret);
+ return -1;
+ }
+ }
+ else
+ {
+ // Get current time
+ struct timespec time_spec;
+ clock_gettime(CLOCK_BOOTTIME, &time_spec);
+
+ // Calculate timer fired time
+ uint64_t usec = (time_spec.tv_sec * 1000000) + (time_spec.tv_nsec / 1000) + (delay_ms * 1000);
+
+ // Set timer
+ int ret = sd_event_add_time(afb_daemon_get_event_loop(), &event_source,
+ CLOCK_BOOTTIME, usec, 1,
+ &pm::timerEventWrapper, new int(event_id));
+ if (0 > ret)
+ {
+ HMI_ERROR("Faild to sd_event_add_time: errno:%d", ret);
+ return -1;
+ }
+ }
+ // Store event source
+ this->event_source_list[event_id] = event_source;
+ // Store requested role
+ this->req_role_list[event_id] = role;
+ return 0;
+}
+
+bool PolicyManager::changedRestrictionModeTo2On()
+{
+ // TODO: If possible thie process should be include in zipc stm in the future
+ if (this->p_crr_state->car_element[StmCarElementNoRestrictionMode].changed &&
+ (StmRestrictionModeSttNoOn != this->p_prv_state->car_element[StmCarElementNoRestrictionMode].state) &&
+ (StmRestrictionModeSttNoOn == this->p_crr_state->car_element[StmCarElementNoRestrictionMode].state))
+ {
+ return true;
+ }
+ return false;
+}
+
+bool PolicyManager::changedRestrictionMode2OnToOther()
+{
+ // TODO: If possible thie process should be include in zipc stm in the future
+ if (this->p_crr_state->car_element[StmCarElementNoRestrictionMode].changed &&
+ (StmRestrictionModeSttNoOn == this->p_prv_state->car_element[StmCarElementNoRestrictionMode].state) &&
+ (StmRestrictionModeSttNoOn != this->p_crr_state->car_element[StmCarElementNoRestrictionMode].state))
+ {
+ return true;
+ }
+ return false;
+}
+
+bool PolicyManager::changedLightstatusBrakeOffToOn()
+{
+ // TODO: For master
+ // If possible thie process should be include in zipc stm in the future
+ if (("master" == this->ecu_name) &&
+ this->p_crr_state->car_element[StmCarElementNoLightstatusBrake].changed &&
+ (StmLightstatusBrakeSttNoOff == this->p_prv_state->car_element[StmCarElementNoLightstatusBrake].state) &&
+ (StmLightstatusBrakeSttNoOn == this->p_crr_state->car_element[StmCarElementNoLightstatusBrake].state))
+ {
+ return true;
+ }
+ return false;
+}
+
+bool PolicyManager::changedLightstatusBrakeOnToOff()
+{
+ // TODO: For master
+ // If possible thie process should be include in zipc stm in the future
+ if (("master" == this->ecu_name) &&
+ this->p_crr_state->car_element[StmCarElementNoLightstatusBrake].changed &&
+ (StmLightstatusBrakeSttNoOn == this->p_prv_state->car_element[StmCarElementNoLightstatusBrake].state) &&
+ (StmLightstatusBrakeSttNoOff == this->p_crr_state->car_element[StmCarElementNoLightstatusBrake].state))
+ {
+ return true;
+ }
+ return false;
+}
+
+int PolicyManager::loadRolesConfigFile()
+{
+ std::string file_name;
+
+ // Get afm application installed dir
+ char const *afm_app_install_dir = getenv("AFM_APP_INSTALL_DIR");
+ HMI_DEBUG("afm_app_install_dir:%s", afm_app_install_dir);
+
+ if (!afm_app_install_dir)
+ {
+ HMI_ERROR("AFM_APP_INSTALL_DIR is not defined");
+ }
+ else
+ {
+ file_name = std::string(afm_app_install_dir) + std::string(pm::kPathRolesConfigFile);
+ }
+
+ // Load roles config file
+ json_object *json_obj;
+ int ret = this->inputJsonFilie(file_name.c_str(), &json_obj);
+ if (0 > ret)
+ {
+ HMI_ERROR("Could not open %s, so use default role information", pm::kPathRolesConfigFile);
+ json_obj = json_tokener_parse(kDefaultRolesConfig);
+ }
+ HMI_DEBUG("json_obj dump:%s", json_object_get_string(json_obj));
+
+ // Parse ecus
+ json_object *json_cfg;
+ if (!json_object_object_get_ex(json_obj, "ecus", &json_cfg))
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ int num_ecu = json_object_array_length(json_cfg);
+ HMI_DEBUG("json_cfg(ecus) len:%d", num_ecu);
+
+ const char* c_ecu_name;
+ json_object *json_ecu;
+ for (int i = 0; i < num_ecu; i++)
+ {
+ json_ecu= json_object_array_get_idx(json_cfg, i);
+
+ c_ecu_name = this->getStringFromJson(json_ecu, "name");
+ if (nullptr == c_ecu_name)
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ if (std::string(c_ecu_name) == this->ecu_name)
+ {
+ break;
+ }
+ else
+ {
+ json_ecu = nullptr;
+ }
+ }
+
+ if (!json_ecu)
+ {
+ HMI_ERROR("Areas for ecu:%s is NOT exist!!", this->ecu_name.c_str());
+ return -1;
+ }
+
+ // Parse roles
+ json_object *json_roles;
+ if (!json_object_object_get_ex(json_ecu, "roles", &json_roles))
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ int len = json_object_array_length(json_roles);
+ HMI_DEBUG("json_cfg len:%d", len);
+ HMI_DEBUG("json_cfg dump:%s", json_object_get_string(json_roles));
+
+ json_object *json_tmp;
+ const char *category;
+ const char *roles;
+ const char *areas;
+ const char *layer;
+ for (int i = 0; i < len; i++)
+ {
+ json_tmp = json_object_array_get_idx(json_roles, i);
+
+ category = this->getStringFromJson(json_tmp, "category");
+ roles = this->getStringFromJson(json_tmp, "role");
+ areas = this->getStringFromJson(json_tmp, "area");
+ layer = this->getStringFromJson(json_tmp, "layer");
+
+ if ((nullptr == category) || (nullptr == roles) ||
+ (nullptr == areas) || (nullptr == layer))
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ // Parse roles by '|'
+ std::vector<std::string> vct_roles;
+ vct_roles = this->parseString(std::string(roles), '|');
+
+ // Parse areas by '|'
+ Areas vct_areas;
+ vct_areas = this->parseString(std::string(areas), '|');
+
+ // Set role, category, areas
+ for (auto itr = vct_roles.begin(); itr != vct_roles.end(); ++itr)
+ {
+ this->role2category[*itr] = std::string(category);
+ }
+ this->category2role[category] = std::string(roles);
+ this->category2areas[category] = vct_areas;
+ this->layer2categories[layer].push_back(category);
+ }
+
+ // Check
+ HMI_DEBUG("Check role2category");
+ for (const auto &x : this->role2category)
+ {
+ HMI_DEBUG("key:%s, val:%s", x.first.c_str(), x.second.c_str());
+ }
+
+ HMI_DEBUG("Check category2role");
+ for (const auto &x : this->category2role)
+ {
+ HMI_DEBUG("key:%s, val:%s", x.first.c_str(), x.second.c_str());
+ }
+
+ HMI_DEBUG("Check category2areas");
+ for (const auto &x : this->category2areas)
+ {
+ for (const auto &y : x.second)
+ {
+ HMI_DEBUG("key:%s, val:%s", x.first.c_str(), y.c_str());
+ }
+ }
+
+ HMI_DEBUG("Check layer2categories");
+ for (const auto &x : this->layer2categories)
+ {
+ for (const auto &y : x.second)
+ {
+ HMI_DEBUG("key:%s, val:%s", x.first.c_str(), y.c_str());
+ }
+ }
+ return 0;
+}
+
+int PolicyManager::loadLayoutsConfigFile()
+{
+ HMI_DEBUG("Call");
+
+ // Get afm application installed dir
+ char const *afm_app_install_dir = getenv("AFM_APP_INSTALL_DIR");
+ HMI_DEBUG("afm_app_install_dir:%s", afm_app_install_dir);
+
+ std::string file_name;
+ if (!afm_app_install_dir)
+ {
+ HMI_ERROR("AFM_APP_INSTALL_DIR is not defined");
+ }
+ else
+ {
+ file_name = std::string(afm_app_install_dir) + std::string(pm::kPathLayoutsConfigFile);
+ }
+
+ // Load states config file
+ json_object *json_obj;
+ int ret = this->inputJsonFilie(file_name.c_str(), &json_obj);
+ if (0 > ret)
+ {
+ HMI_DEBUG("Could not open %s, so use default layout information", pm::kPathLayoutsConfigFile);
+ json_obj = json_tokener_parse(kDefaultLayoutsConfig);
+ }
+ HMI_DEBUG("json_obj dump:%s", json_object_get_string(json_obj));
+
+ // Parse ecus
+ json_object *json_cfg;
+ if (!json_object_object_get_ex(json_obj, "ecus", &json_cfg))
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ int num_ecu = json_object_array_length(json_cfg);
+ HMI_DEBUG("json_cfg(ecus) len:%d", num_ecu);
+
+ const char* c_ecu_name;
+ json_object *json_ecu;
+ for (int i = 0; i < num_ecu; i++)
+ {
+ json_ecu= json_object_array_get_idx(json_cfg, i);
+
+ c_ecu_name = this->getStringFromJson(json_ecu, "name");
+ if (nullptr == c_ecu_name)
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ if (std::string(c_ecu_name) == this->ecu_name)
+ {
+ break;
+ }
+ else
+ {
+ json_ecu = nullptr;
+ }
+ }
+
+ if (!json_ecu)
+ {
+ HMI_ERROR("Areas for ecu:%s is NOT exist!!", this->ecu_name.c_str());
+ return -1;
+ }
+
+ // Perse layouts
+ HMI_DEBUG("Perse layouts");
+ json_object *json_layouts;
+ if (!json_object_object_get_ex(json_ecu, "layouts", &json_layouts))
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ int len = json_object_array_length(json_layouts);
+ HMI_DEBUG("json_layouts len:%d", len);
+ HMI_DEBUG("json_layouts dump:%s", json_object_get_string(json_layouts));
+
+ const char *layout;
+ const char *role;
+ const char *category;
+ for (int i = 0; i < len; i++)
+ {
+ json_object *json_tmp = json_object_array_get_idx(json_layouts, i);
+
+ layout = this->getStringFromJson(json_tmp, "name");
+ if (nullptr == layout)
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+ HMI_DEBUG("> layout:%s", layout);
+
+ json_object *json_area_array;
+ if (!json_object_object_get_ex(json_tmp, "areas", &json_area_array))
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+
+ int len_area = json_object_array_length(json_area_array);
+ HMI_DEBUG("json_area_array len:%d", len_area);
+ HMI_DEBUG("json_area_array dump:%s", json_object_get_string(json_area_array));
+
+ LayoutState layout_state;
+ AreaState area_state;
+ std::map<std::string, int> category_num;
+ for (int ctg_no = StmCtgNoMin;
+ ctg_no <= StmCtgNoMax; ctg_no++)
+ {
+ const char *ctg_name = kStmCategoryName[ctg_no];
+ category_num[ctg_name] = 0;
+ }
+
+ for (int j = 0; j < len_area; j++)
+ {
+ json_object *json_area = json_object_array_get_idx(json_area_array, j);
+
+ // Get area name
+ const char *area = this->getStringFromJson(json_area, "name");
+ if (nullptr == area)
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+ area_state.name = std::string(area);
+ HMI_DEBUG(">> area:%s", area);
+
+ // Get app attribute of the area
+ category = this->getStringFromJson(json_area, "category");
+ if (nullptr == category)
+ {
+ HMI_ERROR("Parse Error!!");
+ return -1;
+ }
+ area_state.category = std::string(category);
+ category_num[category]++;
+ HMI_DEBUG(">>> category:%s", category);
+
+ role = this->getStringFromJson(json_area, "role");
+ if (nullptr != role)
+ {
+ // Role is NOT essential here
+ area_state.role = std::string(role);
+ }
+ else
+ {
+ area_state.role = std::string("");
+ }
+ HMI_DEBUG(">>> role:%s", role);
+
+ layout_state.area_list.push_back(area_state);
+ }
+
+ layout_state.name = layout;
+ layout_state.category_num = category_num;
+ this->default_layouts[layout] = layout_state;
+ }
+
+ // initialize for none layout
+ LayoutState none_layout_state;
+ memset(&none_layout_state, 0, sizeof(none_layout_state));
+ none_layout_state.name = "none";
+ this->default_layouts["none"] = none_layout_state;
+
+ // Check
+ for (auto itr_layout = this->default_layouts.begin();
+ itr_layout != this->default_layouts.end(); ++itr_layout)
+ {
+ HMI_DEBUG(">>> layout:%s", itr_layout->first.c_str());
+
+ for (auto itr_area = itr_layout->second.area_list.begin();
+ itr_area != itr_layout->second.area_list.end(); ++itr_area)
+ {
+ HMI_DEBUG(">>> >>> area :%s", itr_area->name.c_str());
+ HMI_DEBUG(">>> >>> category:%s", itr_area->category.c_str());
+ HMI_DEBUG(">>> >>> role :%s", itr_area->role.c_str());
+ }
+ }
+
+ // Release json_object
+ json_object_put(json_obj);
+
+ return 0;
+}
+
+void PolicyManager::pushInvisibleRoleHistory(std::string category, std::string role)
+{
+ auto i = std::remove_if(this->crr_invisible_role_history[category].begin(),
+ this->crr_invisible_role_history[category].end(),
+ [role](std::string x) { return (role == x); });
+
+ if (this->crr_invisible_role_history[category].end() != i)
+ {
+ this->crr_invisible_role_history[category].erase(i);
+ }
+
+ this->crr_invisible_role_history[category].push_back(role);
+
+ if (pm::kInvisibleRoleHistoryNum < crr_invisible_role_history[category].size())
+ {
+ this->crr_invisible_role_history[category].erase(
+ this->crr_invisible_role_history[category].begin());
+ }
+}
+
+std::string PolicyManager::popInvisibleRoleHistory(std::string category)
+{
+ std::string role;
+ if (crr_invisible_role_history[category].empty())
+ {
+ role = "";
+ }
+ else
+ {
+ role = this->crr_invisible_role_history[category].back();
+ this->crr_invisible_role_history[category].pop_back();
+ }
+ return role;
+}
+
+const char *PolicyManager::getStringFromJson(json_object *obj, const char *key)
+{
+ json_object *tmp;
+ if (!json_object_object_get_ex(obj, key, &tmp))
+ {
+ HMI_DEBUG("Not found key \"%s\"", key);
+ return nullptr;
+ }
+
+ return json_object_get_string(tmp);
+}
+
+int PolicyManager::inputJsonFilie(const char *file, json_object **obj)
+{
+ const int input_size = 128;
+ int ret = -1;
+
+ HMI_DEBUG("Input file: %s", file);
+
+ // Open json file
+ FILE *fp = fopen(file, "rb");
+ if (nullptr == fp)
+ {
+ HMI_ERROR("Could not open file");
+ return ret;
+ }
+
+ // Parse file data
+ struct json_tokener *tokener = json_tokener_new();
+ enum json_tokener_error json_error;
+ char buffer[input_size];
+ int block_cnt = 1;
+ while (1)
+ {
+ size_t len = fread(buffer, sizeof(char), input_size, fp);
+ *obj = json_tokener_parse_ex(tokener, buffer, len);
+ if (nullptr != *obj)
+ {
+ HMI_DEBUG("File input is success");
+ ret = 0;
+ break;
+ }
+
+ json_error = json_tokener_get_error(tokener);
+ if ((json_tokener_continue != json_error) || (input_size > len))
+ {
+ HMI_ERROR("Failed to parse file (byte:%d err:%s)",
+ (input_size * block_cnt), json_tokener_error_desc(json_error));
+ HMI_ERROR("\n%s", buffer);
+ *obj = nullptr;
+ break;
+ }
+ block_cnt++;
+ }
+
+ // Close json file
+ fclose(fp);
+
+ // Free json_tokener
+ json_tokener_free(tokener);
+
+ return ret;
+}
+
+void PolicyManager::dumpLayerState(std::unordered_map<std::string, LayerState> &layers)
+{
+ HMI_DEBUG("-------------------------------------------------------------------------------------------------------");
+ HMI_DEBUG("|%-15s|%s|%-20s|%-20s|%-20s|%-20s|",
+ "LAYER", "C", "LAYOUT", "AREA", "CATEGORY", "ROLE");
+ for (const auto &itr : layers)
+ {
+ LayerState ls = itr.second;
+ const char* layer = ls.name.c_str();
+ const char* changed = (ls.changed) ? "T" : "f";
+ const char* layout = ls.layout_state.name.c_str();
+ bool first = true;
+ for (const auto &as : ls.layout_state.area_list)
+ {
+ if (first)
+ {
+ first = false;
+ HMI_DEBUG("|%-15s|%1s|%-20s|%-20s|%-20s|%-20s|",
+ layer, changed, layout,
+ as.name.c_str(), as.category.c_str(), as.role.c_str());
+ }
+ else
+ HMI_DEBUG("|%-15s|%1s|%-20s|%-20s|%-20s|%-20s|",
+ "", "", "", as.name.c_str(), as.category.c_str(), as.role.c_str());
+ }
+ }
+ HMI_DEBUG("-------------------------------------------------------------------------------------------------------");
+}
+
+void PolicyManager::dumpInvisibleRoleHistory()
+{
+ HMI_DEBUG(">>>>>>>>>> DUMP INVISIBLE ROLE HISTORY ( category [older > newer] )");
+ for (int ctg_no = StmCtgNoMin; ctg_no <= StmCtgNoMax; ctg_no++)
+ {
+ if (ctg_no == StmCtgNoNone)
+ continue;
+
+ std::string category = std::string(kStmCategoryName[ctg_no]);
+
+ std::string str = category + " [ ";
+ for (const auto &i : this->crr_invisible_role_history[category])
+ str += (i + " > ");
+
+ str += "]";
+ HMI_DEBUG("%s", str.c_str());
+ }
+}
+
+std::vector<std::string> PolicyManager::parseString(std::string str, char delimiter)
+{
+ // Parse string by delimiter
+ std::vector<std::string> vct;
+ std::stringstream ss{str};
+ std::string buf;
+ while (std::getline(ss, buf, delimiter))
+ {
+ if (!buf.empty())
+ {
+ // Delete space and push back to vector
+ vct.push_back(this->deleteSpace(buf));
+ }
+ }
+ return vct;
+}
+
+std::string PolicyManager::deleteSpace(std::string str)
+{
+ std::string ret = str;
+ size_t pos;
+ while ((pos = ret.find_first_of(" ")) != std::string::npos)
+ {
+ ret.erase(pos, 1);
+ }
+ return ret;
+}
+
+const char *PolicyManager::kDefaultRolesConfig = "{ \
+ \"roles\":[ \
+ { \
+ \"category\": \"homescreen\", \
+ \"role\": \"homescreen\", \
+ \"area\": \"fullscreen\", \
+ }, \
+ { \
+ \"category\": \"map\", \
+ \"role\": \"map\", \
+ \"area\": \"normal.full | split.main\", \
+ }, \
+ { \
+ \"category\": \"general\", \
+ \"role\": \"launcher | poi | browser | sdl | mixer | radio | hvac | debug | phone | video | music\", \
+ \"area\": \"normal.full\", \
+ }, \
+ { \
+ \"category\": \"system\", \
+ \"role\": \"settings | dashboard\", \
+ \"area\": \"normal.full\", \
+ }, \
+ { \
+ \"category\": \"software_keyboard\", \
+ \"role\": \"software_keyboard\", \
+ \"area\": \"software_keyboard\", \
+ }, \
+ { \
+ \"category\": \"restriction\", \
+ \"role\": \"restriction\", \
+ \"area\": \"restriction.normal | restriction.split.main | restriction.split.sub\", \
+ }, \
+ { \
+ \"category\": \"pop_up\", \
+ \"role\": \"pop_up\", \
+ \"area\": \"on_screen\", \
+ }, \
+ { \
+ \"category\": \"system_alert\", \
+ \"role\": \"system_alert\", \
+ \"area\": \"on_screen\", \
+ } \
+ ] \
+}";
+
+const char *PolicyManager::kDefaultLayoutsConfig = "{ \
+ \"layouts\": [ \
+ { \
+ \"name\": \"homescreen\", \
+ \"layer\": \"far_homescreen\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"fullscreen\", \
+ \"category\": \"homescreen\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"map.normal\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"normal.full\", \
+ \"category\": \"map\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"map.split\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"split.main\", \
+ \"category\": \"map\" \
+ }, \
+ { \
+ \"name\": \"split.sub\", \
+ \"category\": \"splitable\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"map.fullscreen\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"fullscreen\", \
+ \"category\": \"map\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"splitable.normal\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"normal.full\", \
+ \"category\": \"splitable\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"splitable.split\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"split.main\", \
+ \"category\": \"splitable\" \
+ }, \
+ { \
+ \"name\": \"split.sub\", \
+ \"category\": \"splitable\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"general.normal\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"normal.full\", \
+ \"category\": \"general\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"system.normal\", \
+ \"layer\": \"apps\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"normal.full\", \
+ \"category\": \"system\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"software_keyboard\", \
+ \"layer\": \"near_homescreen\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"software_keyboard\", \
+ \"category\": \"software_keyboard\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"restriction.normal\", \
+ \"layer\": \"restriction\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"restriction.normal\", \
+ \"category\": \"restriction\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"restriction.split.main\", \
+ \"layer\": \"restriction\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"restriction.split.main\", \
+ \"category\": \"restriction\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"restriction.split.sub\", \
+ \"layer\": \"restriction\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"restriction.split.sub\", \
+ \"category\": \"restriction\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"pop_up\", \
+ \"layer\": \"on_screen\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"on_screen\", \
+ \"category\": \"pop_up\" \
+ } \
+ ] \
+ }, \
+ { \
+ \"name\": \"system_alert\", \
+ \"layer\": \"on_screen\", \
+ \"areas\": [ \
+ { \
+ \"name\": \"on_screen\", \
+ \"category\": \"system_alert\" \
+ } \
+ ] \
+ } \
+ ] \
+}";
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/policy_manager.hpp b/demo3/common/agl-service-windowmanager/policy_manager/policy_manager.hpp
new file mode 100644
index 0000000..61fbf06
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/policy_manager.hpp
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TMCAGLWM_POLICY_MANAGER_HPP
+#define TMCAGLWM_POLICY_MANAGER_HPP
+
+#include <functional>
+#include <unordered_map>
+#include <vector>
+#include <queue>
+
+struct json_object;
+struct sd_event;
+struct sd_event_source;
+struct StmState;
+
+class PolicyManager
+{
+ public:
+ explicit PolicyManager();
+ ~PolicyManager();
+
+ using Handler = std::function<void(json_object *)>;
+
+ typedef struct
+ {
+ Handler onStateTransitioned;
+ Handler onError;
+ } CallbackTable;
+
+ int initialize(std::string ecu_name);
+ void registerCallback(CallbackTable callback_table);
+ int setInputEventData(json_object *json_in);
+ int executeStateTransition();
+ void undoState();
+
+ // Do not use these functions
+ int transitionState(sd_event_source *source, void *data);
+ int timerEvent(sd_event_source *source, uint64_t usec, void *data);
+
+ private:
+ // Disable copy and move
+ PolicyManager(PolicyManager const &) = delete;
+ PolicyManager &operator=(PolicyManager const &) = delete;
+ PolicyManager(PolicyManager &&) = delete;
+ PolicyManager &operator=(PolicyManager &&) = delete;
+
+ typedef struct EventInfo
+ {
+ int event;
+ std::string role;
+ uint64_t delay;
+ } EventInfo;
+
+ typedef struct AreaState
+ {
+ std::string name;
+ std::string category;
+ std::string role;
+ } AreaState;
+
+ typedef std::vector<AreaState> AreaList;
+ typedef struct LayoutState
+ {
+ std::string name;
+ std::map<std::string, int> category_num;
+ AreaList area_list;
+ } LayoutState;
+
+ typedef struct LayerState
+ {
+ std::string name;
+ LayoutState layout_state;
+ bool changed;
+ } LayerState;
+
+ typedef struct Mode
+ {
+ std::string state;
+ bool changed;
+ } Mode;
+
+ typedef std::vector<std::string> Areas;
+ typedef std::vector<std::string> Categories;
+ typedef std::vector<std::string> Roles;
+
+ StmState *p_crr_state;
+ StmState *p_prv_state;
+
+ // Convert map
+ std::unordered_map<std::string, int> eventname2no;
+ std::unordered_map<std::string, int> categoryname2no;
+ std::unordered_map<std::string, int> areaname2no;
+
+ std::unordered_map<std::string, std::string> role2category;
+ std::unordered_map<std::string, std::string> category2role;
+ std::unordered_map<std::string, Areas> category2areas;
+ std::unordered_map<std::string, Categories> layer2categories;
+
+ std::queue<EventInfo> event_info_queue;
+ std::map<int, struct sd_event_source *> event_source_list;
+ std::map<int, std::string> req_role_list;
+
+ CallbackTable callback;
+
+ std::unordered_map<std::string, Mode> prv_car_elements;
+ std::unordered_map<std::string, Mode> crr_car_elements;
+
+ std::unordered_map<std::string, LayerState> prv_layers;
+ std::unordered_map<std::string, LayerState> crr_layers;
+
+ std::unordered_map<std::string, LayerState> prv_layers_car_stop;
+
+ std::unordered_map<std::string, LayoutState> default_layouts;
+
+ std::map<std::string, Roles> crr_invisible_role_history;
+ std::map<std::string, Roles> prv_invisible_role_history;
+
+ std::string ecu_name;
+
+ void initializeState();
+ void initializeModeState();
+ void initializeLayerState();
+ void updateState(int event_id);
+ void updateModeState();
+ void updateLayer(int event_id);
+ int updateLayout(int event_id, int layer_no,
+ std::string crr_layout_name, LayoutState &crr_layout_state);
+ void createOutputInformation(json_object **json_out);
+ void controlTimerEvent();
+ int setStateTransitionProcessToSystemd(int event, uint64_t delay_ms, std::string role);
+
+ void pushInvisibleRoleHistory(std::string category, std::string role);
+ std::string popInvisibleRoleHistory(std::string category);
+
+ bool changedRestrictionModeTo2On();
+ bool changedRestrictionMode2OnToOther();
+ bool changedLightstatusBrakeOffToOn();
+ bool changedLightstatusBrakeOnToOff();
+
+ int loadRolesConfigFile();
+ int loadLayoutsConfigFile();
+
+ void dumpLayerState(std::unordered_map<std::string, LayerState> &layers);
+ void dumpInvisibleRoleHistory();
+
+ void addStateToJson(const char *name, bool changed,
+ std::string state, json_object **json_out);
+ void addStateToJson(const char *layer_name, bool changed,
+ AreaList area_list, json_object **json_out);
+ const char *getStringFromJson(json_object *obj, const char *key);
+ int inputJsonFilie(const char *file, json_object **obj);
+
+ std::vector<std::string> parseString(std::string str, char delimiter);
+ std::string deleteSpace(std::string str);
+
+ static const char *kDefaultRolesConfig;
+ static const char *kDefaultLayoutsConfig;
+};
+
+#endif // TMCAGLWM_POLICY_MANAGER_HPP
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/stm.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/stm.c
new file mode 100644
index 0000000..1c4170d
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/stm.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+#include "stm.h"
+#include "stm_inner.h"
+
+const char* kStmEventName[] = {
+ "none",
+ "activate",
+ "deactivate",
+ "trans_gear_neutral",
+ "trans_gear_not_neutral",
+ "parking_brake_off",
+ "parking_brake_on",
+ "accel_pedal_off",
+ "accel_pedal_on",
+ "lamp_off",
+ "lamp_on",
+ "lightstatus_brake_off",
+ "lightstatus_brake_on",
+ "restriction_mode_off",
+ "restriction_mode_on",
+ "undo",
+};
+
+const char* kStmCategoryName[] = {
+ "none",
+ "homescreen",
+ "map",
+ "general",
+ "splitable",
+ "splitable_main",
+ "splitable_sub",
+ "pop_up",
+ "system_alert",
+ "restriction",
+ "system",
+ "software_keyboard",
+ "tbt",
+ "meter",
+ "receiver",
+ "debug",
+};
+
+const char* kStmAreaName[] = {
+ "none",
+ "fullscreen",
+ "normal.full",
+ "split.main",
+ "split.sub",
+ "on_screen",
+ "restriction.normal",
+ "restriction.split.main",
+ "restriction.split.sub",
+ "software_keyboard",
+ "master.split.sub",
+};
+
+const char* kStmLayoutName[] = {
+ "none",
+ "pop_up",
+ "system_alert",
+ "map.normal",
+ "map.split",
+ "map.fullscreen",
+ "splitable.normal",
+ "splitable.split",
+ "general.normal",
+ "homescreen",
+ "restriction.normal",
+ "restriction.split.main",
+ "restriction.split.sub",
+ "system.normal",
+ "software_keyboard",
+ "tbt",
+ "remote_tbt",
+ "meter.normal",
+ "meter_receiver",
+ "meter_splitable",
+ "splitable_receiver",
+ "receiver.split",
+ "debug.normal",
+ "debug.split.main",
+ "debug.split.sub",
+ "debug.fullscreen",
+};
+
+const char* kStmLayerName[] = {
+ "homescreen",
+ "apps",
+ "near_homescreen",
+ "restriction",
+ "on_screen",
+ "remote",
+};
+
+const char* kStmCarElementName[] = {
+ "trans_gear",
+ "parking_brake",
+ "accel_pedal",
+ "running",
+ "lamp",
+ "lightstatus_brake",
+ "restriction_mode",
+};
+
+const char* kStmTransGearStateName[] = {
+ "neutral",
+ "not_neutral"
+};
+
+const char* kStmParkingBrakeStateName[] = {
+ "off",
+ "on"
+};
+
+const char* kStmAccelPedalStateName[] = {
+ "off",
+ "on"
+};
+
+const char* kStmRunningSttNo2Name[] = {
+ "stop",
+ "run"
+};
+
+const char* kStmLampStateName[] = {
+ "off",
+ "on"
+};
+
+const char* kStmLightstatusBrakeStateName[] = {
+ "off",
+ "on"
+};
+
+const char* kStmRestrictionModeStateName[] = {
+ "off",
+ "on",
+};
+
+const char** kStmCarElementStateNameList[] = {
+ kStmTransGearStateName,
+ kStmParkingBrakeStateName,
+ kStmAccelPedalStateName,
+ kStmRunningSttNo2Name,
+ kStmLampStateName,
+ kStmLightstatusBrakeStateName,
+ kStmRestrictionModeStateName,
+};
+
+void stmInitialize(const char *ecu_name) {
+ stmInitializeInner(ecu_name);
+}
+
+int stmTransitionState(int event, StmState* state) {
+ return stmTransitionStateInner(event, state);
+}
+
+void stmUndoState() {
+ stmUndoStateInner();
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/stm.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/stm.h
new file mode 100644
index 0000000..685a43b
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/stm.h
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TMCAGLWM_STM_HPP
+#define TMCAGLWM_STM_HPP
+
+#define STM_TRUE 1
+#define STM_FALSE 0
+
+#define STM_CREATE_EVENT_ID(evt, ctg, area) \
+ ((evt) | ((ctg) << 8) | ((area) << 16))
+
+#define STM_GET_EVENT_FROM_ID(id) \
+ ((id) & 0xFF)
+
+#define STM_GET_CATEGORY_FROM_ID(id) \
+ (((id) >> 8) & 0xFF)
+
+#define STM_GET_AREA_FROM_ID(id) \
+ (((id) >> 16) & 0xFF)
+
+// Event number
+enum StmEvtNo {
+ StmEvtNoNone = 0,
+ StmEvtNoActivate,
+ StmEvtNoDeactivate,
+ StmEvtNoTransGearN,
+ StmEvtNoTransGearNotN,
+ StmEvtNoParkingBrakeOff,
+ StmEvtNoParkingBrakeOn,
+ StmEvtNoAccelPedalOff,
+ StmEvtNoAccelPedalOn,
+ StmEvtNoLampOff,
+ StmEvtNoLampOn,
+ StmEvtNoLightstatusBrakeOff,
+ StmEvtNoLightstatusBrakeOn,
+ StmEvtNoRestrictionModeOff,
+ StmEvtNoRestrictionModeOn,
+ StmEvtNoUndo,
+
+ StmEvtNoNum,
+
+ StmEvtNoMin = StmEvtNoNone,
+ StmEvtNoMax = StmEvtNoNum - 1,
+};
+
+// Category number
+enum StmCtgNo {
+ StmCtgNoNone = 0,
+ StmCtgNoHomescreen,
+ StmCtgNoMap,
+ StmCtgNoGeneral,
+ StmCtgNoSplitable,
+ StmCtgNoSplitableMain,
+ StmCtgNoSplitableSub,
+ StmCtgNoPopUp,
+ StmCtgNoSystemAlert,
+ StmCtgNoRestriction,
+ StmCtgNoSystem,
+ StmCtgNoSoftwareKeyboard,
+ StmCtgNoTbt,
+ StmCtgNoMeter,
+ StmCtgNoReceiver,
+ StmCtgNoDebug,
+
+ StmCtgNoNum,
+
+ StmCtgNoMin = StmCtgNoNone,
+ StmCtgNoMax = StmCtgNoNum - 1,
+};
+
+// Area number
+enum StmAreaNo {
+ StmAreaNoNone = 0,
+ StmAreaNoFullscreen,
+ StmAreaNoNormal,
+ StmAreaNoSplitMain,
+ StmAreaNoSplitSub,
+ StmAreaNoOnScreen,
+ StmAreaNoRestrictionNormal,
+ StmAreaNoRestrictionSplitMain,
+ StmAreaNoRestrictionSplitSub,
+ StmAreaNoSoftwareKyeboard,
+ StmAreaNoMasterSplitSub,
+
+ StmAreaNoNum,
+
+ StmAreaNoMin = StmAreaNoNone,
+ StmAreaNoMax = StmAreaNoNum - 1,
+};
+
+// Layer number
+enum StmLayerNo {
+ StmLayerNoHomescreen = 0,
+ StmLayerNoApps,
+ StmLayerNoNearHomescreen,
+ StmLayerNoRestriction,
+ StmLayerNoOnScreen,
+ StmLayerNoRemote,
+
+ StmLayerNoNum,
+
+ StmLayerNoMin = StmLayerNoHomescreen,
+ StmLayerNoMax = StmLayerNoNum - 1,
+};
+
+// Layout kind number
+enum StmLayoutNo {
+ StmLayoutNoNone = 0,
+ StmLayoutNoPopUp,
+ StmLayoutNoSysAlt,
+ StmLayoutNoMapNml,
+ StmLayoutNoMapSpl,
+ StmLayoutNoMapFll,
+ StmLayoutNoSplNml,
+ StmLayoutNoSplSpl,
+ StmLayoutNoGenNml,
+ StmLayoutNoHms,
+ StmLayoutNoRstNml,
+ StmLayoutNoRstSplMain,
+ StmLayoutNoRstSplSub,
+ StmLayoutNoSysNml,
+ StmLayoutNoSftKbd,
+ StmLayoutNoTbt,
+ StmLayoutNoRmtTbt,
+ StmLayoutNoMtrNml,
+ StmLayoutNoMtrRcv,
+ StmLayoutNoMtrSpl,
+ StmLayoutNoSplRcv,
+ StmLayoutNoRcvSpl,
+ StmLayoutNoDbgNml,
+ StmLayoutNoDbgSplMain,
+ StmLayoutNoDbgSplSub,
+ StmLayoutNoDbgFll,
+
+ StmLayoutNoNum,
+
+ StmLayoutNoMin = StmLayoutNoNone,
+ StmLayoutNoMax = StmLayoutNoNum - 1,
+};
+
+// Enum for mode state
+enum StmTransGearStt {
+ StmTransGearSttNoN = 0,
+ StmTransGearSttNoNotN
+};
+
+enum StmParkingBrakeStt {
+ StmParkingBrakeSttNoOff = 0,
+ StmParkingBrakeSttNoOn
+};
+
+enum StmAccelPedalStt {
+ StmAccelPedalSttNoOff = 0,
+ StmAccelPedalSttNoOn
+};
+
+enum StmCarStt {
+ StmRunningNoStop = 0,
+ StmRunningNoRun
+};
+
+enum StmLampStt {
+ StmLampSttNoOff = 0,
+ StmLampSttNoOn
+};
+
+enum StmLightstatusBrakeStt {
+ StmLightstatusBrakeSttNoOff = 0,
+ StmLightstatusBrakeSttNoOn
+};
+
+enum StmRestrictionModeSttNo {
+ StmRestrictionModeSttNoOff = 0,
+ StmRestrictionModeSttNoOn,
+};
+
+// Mode kind number
+enum StmCarElementNo {
+ StmCarElementNoTransGear = 0,
+ StmCarElementNoParkingBrake,
+ StmCarElementNoAccelPedal,
+ StmCarElementNoRunning,
+ StmCarElementNoLamp,
+ StmCarElementNoLightstatusBrake,
+ StmCarElementNoRestrictionMode,
+
+ StmCarElementNoNum,
+
+ StmCarElementNoMin = StmCarElementNoTransGear,
+ StmCarElementNoMax = StmCarElementNoNum - 1,
+};
+
+// String for state
+extern const char* kStmEventName[];
+extern const char* kStmCategoryName[];
+extern const char* kStmAreaName[];
+extern const char* kStmLayoutName[];
+extern const char* kStmLayerName[];
+extern const char* kStmCarElementName[];
+extern const char** kStmCarElementStateNameList[];
+
+// Struct for state
+typedef struct StmBaseState {
+ int changed;
+ int state;
+} StmBaseState;
+
+typedef struct StmState {
+ StmBaseState car_element[StmCarElementNoNum];
+ StmBaseState layer[StmLayerNoNum];
+} StmState;
+
+// API
+void stmInitialize(const char *ecu_name);
+int stmTransitionState(int event_no, StmState* state);
+void stmUndoState();
+
+
+#endif // TMCAGLWM_STM_HPP
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/CMakeLists.txt b/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/CMakeLists.txt
new file mode 100644
index 0000000..81f0e00
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/CMakeLists.txt
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set(TARGETS_STM pmstm)
+
+add_library(${TARGETS_STM}
+ STATIC
+ ./stm_inner.c
+)
+
+target_include_directories(${TARGETS_STM}
+ PRIVATE
+ ../
+ ./
+)
+
+target_compile_definitions(${TARGETS_STM}
+ PRIVATE
+ _GNU_SOURCE
+)
+
+target_compile_options(${TARGETS_STM}
+ PRIVATE
+ -Wall -Wextra -Wno-unused-parameter -Wno-comment)
+
+set_target_properties(${TARGETS_STM}
+ PROPERTIES
+ C_EXTENSIONS OFF
+ C_STANDARD 99
+ C_STANDARD_REQUIRED ON
+)
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.c
new file mode 100644
index 0000000..2ae2cf0
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.c
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+#include "stm.h"
+#include "stm_inner.h"
+
+static StmState g_stm_crr_state;
+static StmState g_stm_prv_state;
+
+void stmInitializeInner() {
+ // Initialize previous state
+ memset(&g_stm_prv_state, 0, sizeof(g_stm_prv_state));
+
+ // Initialize current state
+ g_stm_crr_state = g_stm_prv_state;
+}
+
+int stmTransitionStateInner(int event, StmState* state) {
+ int event_no, category_no, area_no;
+
+ event_no = STM_GET_EVENT_FROM_ID(event);
+ category_no = STM_GET_CATEGORY_FROM_ID(event);
+ area_no = STM_GET_AREA_FROM_ID(event);
+
+ // Backup previous state
+ g_stm_prv_state = g_stm_crr_state;
+
+ // -------------------------------------------------------
+ // There is no policy table by default.
+ // Therefore update each layers
+ // to draw the applications in requested area
+ // in accordance with inputed activate/deactivate events.
+ // -------------------------------------------------------
+ if (StmEvtNoActivate == event_no)
+ {
+ if (StmCtgNoHomescreen == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoHomescreen].state = StmLayoutNoHms;
+ g_stm_crr_state.layer[StmLayerNoHomescreen].changed = STM_TRUE;
+
+ // For AGL JIRA SPEC-1407
+ // Apps layer is invisibled only when Homescreen app is started already
+ if (StmLayoutNoHms == g_stm_prv_state.layer[StmLayerNoHomescreen].state)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+ }
+ }
+ else if (StmCtgNoDebug == category_no)
+ {
+ if (StmAreaNoNormal == area_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoDbgNml;
+ }
+ else if (StmAreaNoSplitMain == area_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoDbgSplMain;
+ }
+ else if (StmAreaNoSplitSub == area_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoDbgSplSub;
+ }
+ else if (StmAreaNoFullscreen == area_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoDbgFll;
+ }
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+ }
+ else if (StmCtgNoSoftwareKeyboard == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].state = StmLayoutNoSftKbd;
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_TRUE;
+ }
+ else if (StmCtgNoPopUp == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoPopUp;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+ }
+ else if (StmCtgNoSystemAlert == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoSysAlt;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+ }
+ else if (StmCtgNoTbt == category_no)
+ {
+ if (StmAreaNoMasterSplitSub == area_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoRcvSpl;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+
+ g_stm_crr_state.layer[StmLayerNoRemote].state = StmLayoutNoRmtTbt;
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_TRUE;
+ }
+ else if (StmAreaNoNormal == area_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoRemote].state = StmLayoutNoTbt;
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_TRUE;
+ }
+ }
+ else if (StmCtgNoReceiver == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoRcvSpl;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+ }
+ else if (StmCtgNoMeter == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMtrNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+ }
+ }
+ else if (StmEvtNoDeactivate == event_no)
+ {
+ if (StmCtgNoHomescreen == category_no)
+ {
+ g_stm_crr_state.layer[StmLayerNoHomescreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoHomescreen].changed = STM_TRUE;
+ }
+ else if (StmCtgNoDebug == category_no)
+ {
+ if ((StmLayoutNoDbgNml == g_stm_prv_state.layer[StmLayerNoApps].state) ||
+ (StmLayoutNoDbgSplMain == g_stm_prv_state.layer[StmLayerNoApps].state) ||
+ (StmLayoutNoDbgSplSub == g_stm_prv_state.layer[StmLayerNoApps].state) ||
+ (StmLayoutNoDbgFll == g_stm_prv_state.layer[StmLayerNoApps].state))
+ {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+ }
+ }
+ else if (StmCtgNoSoftwareKeyboard == category_no)
+ {
+ if (StmLayoutNoSftKbd == g_stm_prv_state.layer[StmLayerNoNearHomescreen].state )
+ {
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_TRUE;
+ }
+ }
+ else if (StmCtgNoPopUp == category_no)
+ {
+ if (StmLayoutNoPopUp == g_stm_prv_state.layer[StmLayerNoOnScreen].state )
+ {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+ }
+ }
+ else if (StmCtgNoSystemAlert == category_no)
+ {
+ if (StmLayoutNoSysAlt == g_stm_prv_state.layer[StmLayerNoOnScreen].state )
+ {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+ }
+ }
+ else if (StmCtgNoTbt == category_no)
+ {
+ if (StmLayoutNoRmtTbt == g_stm_prv_state.layer[StmLayerNoRemote].state)
+ {
+ g_stm_crr_state.layer[StmLayerNoRemote].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_TRUE;
+ }
+ }
+ }
+
+ // Copy current state for return
+ memcpy(state, &g_stm_crr_state, sizeof(g_stm_crr_state));
+
+ return 0;
+}
+
+void stmUndoStateInner() {
+ g_stm_crr_state = g_stm_prv_state;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.h
new file mode 100644
index 0000000..7079447
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/stub/stm_inner.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TMCAGLWM_STM_INNER_HPP
+#define TMCAGLWM_STM_INNER_HPP
+
+struct StmState;
+
+// API
+void stmInitializeInner();
+int stmTransitionStateInner(int event_no, StmState* state);
+void stmUndoStateInner();
+
+#endif // TMCAGLWM_STM_INNER_HPP
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/CMakeLists.txt b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/CMakeLists.txt
new file mode 100644
index 0000000..abbdc41
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/CMakeLists.txt
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set(TARGETS_STM pmstm)
+
+set(ST_DIR StateTransitionor)
+set(ST_DIR_CMN Common)
+set(ST_DIR_AL ${ST_DIR}/AppsLayer)
+set(ST_DIR_HS ${ST_DIR}/HomeScreenLayer)
+set(ST_DIR_NHS ${ST_DIR}/NearHomeScreen)
+set(ST_DIR_OS ${ST_DIR}/OnScreenlayer)
+set(ST_DIR_RL ${ST_DIR}/RestrictionLayer)
+set(ST_DIR_RM ${ST_DIR}/RestrictionMode)
+set(ST_DIR_AP ${ST_DIR}/AccelPedal)
+set(ST_DIR_CS ${ST_DIR}/CarState)
+set(ST_DIR_LSB ${ST_DIR}/LightStatusBrake)
+
+set(ST_DIR_MST_AL ${ST_DIR}/master/layer/apps)
+set(ST_DIR_MST_RMT ${ST_DIR}/master/layer/remote)
+
+
+add_library(${TARGETS_STM}
+ STATIC
+ ${ST_DIR}/ZST_StateTransitionor_func.c
+ ${ST_DIR}/ZST_StateTransitionor_var.c
+ ${ST_DIR_AL}/ZAPL_AppsLayer.c
+ ${ST_DIR_AL}/ZAPL_Apps_func.c
+ ${ST_DIR_HS}/ZHSL_HomeScreen.c
+ ${ST_DIR_HS}/ZHSL_HomeScreen_func.c
+ ${ST_DIR_NHS}/ZNHL_NearHomescreen.c
+ ${ST_DIR_NHS}/ZNHL_NearHomeScreen_func.c
+ ${ST_DIR_OS}/ZOSL_OslMain.c
+ ${ST_DIR_OS}/ZOSL_OnScreen_func.c
+ ${ST_DIR_RL}/ZREL_RelMain.c
+ ${ST_DIR_RL}/ZREL_Restriction_func.c
+ ${ST_DIR_RM}/ZREM_RestrictionMode.c
+ ${ST_DIR_RM}/ZREM_RestrictionMode_func.c
+ ${ST_DIR_AP}/ZACCEL_AccelPedal.c
+ ${ST_DIR_AP}/ZACCEL_AccelPedalState_func.c
+ ${ST_DIR_CS}/ZCAR_CarState.c
+ ${ST_DIR_CS}/ZCAR_CarState_func.c
+ ${ST_DIR_LSB}/ZLIGHT_LightstatusBrake.c
+ ${ST_DIR_LSB}/ZLIGHT_LightstatusBrakeStatus_func.c
+ ./stm_master_apps.c
+ ./stm_master_remote.c
+ ${ST_DIR_MST_AL}/Zmaster_apps_apps_main.c
+ ${ST_DIR_MST_RMT}/Zmaster_remote_remote.c
+)
+
+target_include_directories(${TARGETS_STM}
+ PRIVATE
+ ./
+ ./${ST_DIR}
+ ./${ST_DIR_AL}
+ ./${ST_DIR_HS}
+ ./${ST_DIR_NHS}
+ ./${ST_DIR_OS}
+ ./${ST_DIR_RL}
+ ./${ST_DIR_RM}
+ ./${ST_DIR_AP}
+ ./${ST_DIR_CS}
+ ./${ST_DIR_LSB}
+ ./${ST_DIR_MST_AL}
+ ./${ST_DIR_MST_RMT}
+ ./${ST_DIR_CMN}
+)
+
+target_compile_definitions(${TARGETS_STM}
+ PRIVATE
+ _GNU_SOURCE
+)
+
+target_compile_options(${TARGETS_STM}
+ PRIVATE
+ -Wall -Wextra -Wno-unused-parameter -Wno-comment)
+
+set_target_properties(${TARGETS_STM}
+ PROPERTIES
+ C_EXTENSIONS OFF
+ C_STANDARD 99
+ C_STANDARD_REQUIRED ON
+)
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/Event.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/Event.h
new file mode 100644
index 0000000..3601b08
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/Event.h
@@ -0,0 +1,6 @@
+#ifndef ZHEADER_EVENT_H
+#define ZHEADER_EVENT_H
+
+#define ZEVENT_NULL ( 0U )
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/MisraCType.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/MisraCType.h
new file mode 100644
index 0000000..5a535fb
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/MisraCType.h
@@ -0,0 +1,16 @@
+#ifndef ZHEADER_MISRACTYPE_H
+#define ZHEADER_MISRACTYPE_H
+
+typedef char char_t;
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long int64_t;
+typedef unsigned long uint64_t;
+typedef float float32_t;
+typedef double float64_t;
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/ZCommonInclude.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/ZCommonInclude.h
new file mode 100644
index 0000000..6b9b84b
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/Common/ZCommonInclude.h
@@ -0,0 +1,16 @@
+#ifndef ZHEADER_ZCOMMONINCLUDE_H
+#define ZHEADER_ZCOMMONINCLUDE_H
+
+#define ZFALSE ( 0U )
+#define ZTRUE ( 1U )
+
+#define ZNULL ( 0x00 )
+
+#define ZEVENT_NONHIT ( -1 )
+
+#define ZRET_NORMAL ( 0U )
+#define ZRET_ERROR ( 1U )
+#define ZRET_NONACTIVE ( 2U )
+typedef unsigned char ZeRetType;
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.c
new file mode 100644
index 0000000..fa692ee
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.c
@@ -0,0 +1,117 @@
+/************************************************************/
+/* ZACCEL_AccelPedal.c */
+/* AccelPedal State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZACCEL_AccelPedalState[ZACCEL_ACCELPEDALSTATENOMAX];
+
+static void ZACCEL_AccelPedals0e1( void );
+static void ZACCEL_AccelPedals1e0( void );
+static void ZACCEL_AccelPedals0Event( void );
+static void ZACCEL_AccelPedals1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : AccelPedal */
+/* State : accel_pedal_off( No 0 ) */
+/* Event : evt_accel_pedal_on( No 1 ) */
+/****************************************/
+static void ZACCEL_AccelPedals0e1( void )
+{
+ ZACCEL_AccelPedalState[ZACCEL_ACCELPEDAL] = ( uint8_t )ZACCEL_ACCELPEDALS1;
+ stm_aps_start_activity_accel_pedal_on();
+}
+
+/****************************************/
+/* Action function */
+/* STM : AccelPedal */
+/* State : accel_pedal_on( No 1 ) */
+/* Event : evt_accel_pedal_off( No 0 )*/
+/****************************************/
+static void ZACCEL_AccelPedals1e0( void )
+{
+ ZACCEL_AccelPedalState[ZACCEL_ACCELPEDAL] = ( uint8_t )ZACCEL_ACCELPEDALS0;
+ stm_aps_start_activity_accel_pedal_off();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : AccelPedal */
+/* State : accel_pedal_off( No 0 ) */
+/****************************************/
+static void ZACCEL_AccelPedals0Event( void )
+{
+ /*evt_accel_pedal_on*/
+ if( g_stm_event == StmEvtNoAccelPedalOn )
+ {
+ ZACCEL_AccelPedals0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : AccelPedal */
+/* State : accel_pedal_on( No 1 ) */
+/****************************************/
+static void ZACCEL_AccelPedals1Event( void )
+{
+ /*evt_accel_pedal_off*/
+ if( g_stm_event == StmEvtNoAccelPedalOff )
+ {
+ ZACCEL_AccelPedals1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : AccelPedal */
+/****************************************/
+void stm_aps_event_call( void )
+{
+ stm_aps_start_stm();
+ switch( ZACCEL_AccelPedalState[ZACCEL_ACCELPEDAL] )
+ {
+ case ZACCEL_ACCELPEDALS0:
+ ZACCEL_AccelPedals0Event();
+ break;
+ case ZACCEL_ACCELPEDALS1:
+ ZACCEL_AccelPedals1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : AccelPedal */
+/****************************************/
+void stm_aps_initialize( void )
+{
+ ZACCEL_AccelPedalState[ZACCEL_ACCELPEDAL] = ( uint8_t )ZACCEL_ACCELPEDALS0;
+ stm_aps_start_activity_accel_pedal_off();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : AccelPedal */
+/****************************************/
+void ZACCEL_AccelPedalTerminate( void )
+{
+ ZACCEL_AccelPedalState[ZACCEL_ACCELPEDAL] = ( uint8_t )ZACCEL_ACCELPEDALTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.h
new file mode 100644
index 0000000..40da956
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedal.h
@@ -0,0 +1,41 @@
+/************************************************************/
+/* ZACCEL_AccelPedal.h */
+/* AccelPedal State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZACCEL_ACCELPEDAL_H
+#define ZHEADER_ZACCEL_ACCELPEDAL_H
+
+/*State management variable access define*/
+#define ZACCEL_ACCELPEDAL ( 0U )
+#define ZACCEL_ACCELPEDALS0 ( 0U )
+#define ZACCEL_ACCELPEDALS1 ( 1U )
+#define ZACCEL_ACCELPEDALSTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZACCEL_ACCELPEDALEND ( 2U )
+/*Terminate state define*/
+#define ZACCEL_ACCELPEDALTERMINATE ( ZACCEL_ACCELPEDALEND + 1U )
+
+/*State no define*/
+#define ZACCEL_ACCELPEDALS0STATENO ( 0U )
+#define ZACCEL_ACCELPEDALS1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZACCEL_ACCELPEDALS0STATESERIALNO ( 0U )
+#define ZACCEL_ACCELPEDALS1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZACCEL_ACCELPEDALE0EVENTNO ( 0U )
+#define ZACCEL_ACCELPEDALE1EVENTNO ( 1U )
+
+/*Event serial no define*/
+#define ZACCEL_ACCELPEDALE0EVENTSERIALNO ( 0U )
+#define ZACCEL_ACCELPEDALE1EVENTSERIALNO ( 1U )
+
+/*Extern function*/
+extern void stm_aps_event_call( void );
+extern void stm_aps_initialize( void );
+extern void ZACCEL_AccelPedalTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.c
new file mode 100644
index 0000000..1fd9c2a
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.c
@@ -0,0 +1,45 @@
+/************************************************************/
+/* ZACCEL_AccelPedalState_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_aps_start_activity_accel_pedal_off
+ */
+void stm_aps_start_activity_accel_pedal_off() {
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state = StmAccelPedalSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_aps_start_activity_accel_pedal_on
+ */
+void stm_aps_start_activity_accel_pedal_on() {
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state = StmAccelPedalSttNoOn;
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_aps_initialize_variable
+ */
+void stm_aps_initialize_variable() {
+ g_stm_prv_state.car_element[StmCarElementNoAccelPedal].state = StmAccelPedalSttNoOff;
+ g_stm_prv_state.car_element[StmCarElementNoAccelPedal].changed = STM_FALSE;
+
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state = StmAccelPedalSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_aps_start_stm
+ */
+void stm_aps_start_stm() {
+ g_stm_prv_state.car_element[StmCarElementNoAccelPedal].state = g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state;
+ g_stm_crr_state.car_element[StmCarElementNoAccelPedal].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.h
new file mode 100644
index 0000000..7d36cd0
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AccelPedal/ZACCEL_AccelPedalState_func.h
@@ -0,0 +1,14 @@
+/************************************************************/
+/* ZACCEL_AccelPedalState_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZACCEL_ACCELPEDALSTATE_FUNC_H
+#define ZHEADER_ZACCEL_ACCELPEDALSTATE_FUNC_H
+
+extern void stm_aps_start_activity_accel_pedal_off();
+extern void stm_aps_start_activity_accel_pedal_on();
+extern void stm_aps_initialize_variable();
+extern void stm_aps_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.c
new file mode 100644
index 0000000..9002810
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.c
@@ -0,0 +1,1991 @@
+/************************************************************/
+/* ZAPL_AppsLayer.c */
+/* AppsLayer State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZAPL_AppsLayerState[ZAPL_APPSLAYERSTATENOMAX];
+
+static void ZAPL_AppsLayers0StateEntry( void );
+static void ZAPL_AppsLayers1StateEntry( void );
+static void ZAPL_AppsLayers0e1( void );
+static void ZAPL_AppsLayers1e0( void );
+static void ZAPL_RestrictionModeOffs0e0( void );
+static void ZAPL_RestrictionModeOffs0e2( void );
+static void ZAPL_RestrictionModeOffs0e3( void );
+static void ZAPL_RestrictionModeOffs0e6( void );
+static void ZAPL_RestrictionModeOffs0e7( void );
+static void ZAPL_RestrictionModeOffs0e13( void );
+static void ZAPL_RestrictionModeOffs0e15( void );
+static void ZAPL_RestrictionModeOffs0e18( void );
+static void ZAPL_RestrictionModeOffs1e8( void );
+static void ZAPL_RestrictionModeOffs1e14( void );
+static void ZAPL_RestrictionModeOffs2e3( void );
+static void ZAPL_RestrictionModeOffs3e16( void );
+static void ZAPL_RestrictionModeOffs4e17( void );
+static void ZAPL_RestrictionModeOffs5e3( void );
+static void ZAPL_RestrictionModeOffs6e6( void );
+static void ZAPL_RestrictionModeOffs7e7( void );
+static void ZAPL_RestrictionModeOns0e1( void );
+static void ZAPL_RestrictionModeOns0e2( void );
+static void ZAPL_RestrictionModeOns1e0( void );
+static void ZAPL_RestrictionModeOns1e3( void );
+static void ZAPL_AppsLayers0Event( void );
+static void ZAPL_RestrictionModeOffs0Event( void );
+static void ZAPL_RestrictionModeOffs1Event( void );
+static void ZAPL_RestrictionModeOffs2Event( void );
+static void ZAPL_RestrictionModeOffs3Event( void );
+static void ZAPL_RestrictionModeOffs4Event( void );
+static void ZAPL_RestrictionModeOffs5Event( void );
+static void ZAPL_RestrictionModeOffs6Event( void );
+static void ZAPL_RestrictionModeOffs7Event( void );
+static void ZAPL_AppsLayers1Event( void );
+static void ZAPL_RestrictionModeOns0Event( void );
+static void ZAPL_RestrictionModeOns1Event( void );
+
+/****************************************/
+/* State start activity function */
+/* STM : AppsLayer */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZAPL_AppsLayers0StateEntry( void )
+{
+ switch( ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] )
+ {
+ case ZAPL_RESTRICTIONMODEOFFS0:
+ stm_apl_start_activity_none();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS1:
+ stm_apl_start_activity_map();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS2:
+ stm_apl_start_activity_map_split();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS3:
+ stm_apl_start_activity_map_fullscreen();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS4:
+ stm_apl_start_activity_splitable_normal();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS5:
+ stm_apl_start_activity_splitable_split();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS6:
+ stm_apl_start_activity_general();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS7:
+ stm_apl_start_activity_system();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* State start activity function */
+/* STM : AppsLayer */
+/* State : restriction_mode_on( No 1 )*/
+/****************************************/
+static void ZAPL_AppsLayers1StateEntry( void )
+{
+ switch( ZAPL_AppsLayerState[ZAPL_APPSLAYERS1F] )
+ {
+ case ZAPL_RESTRICTIONMODEONS0:
+ stm_apl_start_activity_map();
+ break;
+ case ZAPL_RESTRICTIONMODEONS1:
+ stm_apl_start_activity_map_fullscreen();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Action function */
+/* STM : AppsLayer */
+/* State : restriction_mode_off( No 0 ) */
+/* Event : stt_prv_layer_apps_not_sys_nml( No 1 ) */
+/****************************************/
+static void ZAPL_AppsLayers0e1( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYER] = ( uint8_t )ZAPL_APPSLAYERS1;
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS1F] = ( uint8_t )ZAPL_RESTRICTIONMODEONS0;
+ ZAPL_AppsLayers1StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : AppsLayer */
+/* State : restriction_mode_on( No 1 )*/
+/* Event : stt_restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZAPL_AppsLayers1e0( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYER] = ( uint8_t )ZAPL_APPSLAYERS0;
+ ZAPL_AppsLayers0StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : ara_normal( No 0 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e0( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS1;
+ stm_apl_start_activity_map();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : ara_fullscreen( No 2 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e2( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS3;
+ stm_apl_start_activity_map_fullscreen();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : ara_normal( No 3 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e3( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS4;
+ stm_apl_start_activity_splitable_normal();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : ara_normal( No 6 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e6( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS6;
+ stm_apl_start_activity_general();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : ara_normal( No 7 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e7( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS7;
+ stm_apl_start_activity_system();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_apps_none( No 13 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e13( void )
+{
+ stm_apl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_apps_map_spl( No 15 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e15( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS2;
+ stm_apl_start_activity_map_split();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_apps_spl_spl( No 18 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0e18( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS5;
+ stm_apl_start_activity_splitable_split();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : map( No 1 ) */
+/* Event : ara_fullscreen( No 8 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs1e8( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS0;
+ stm_apl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : map( No 1 ) */
+/* Event : stt_prv_layer_apps_map_nml( No 14 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs1e14( void )
+{
+ stm_apl_start_activity_map();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : map_split( No 2 ) */
+/* Event : ara_normal( No 3 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs2e3( void )
+{
+ stm_apl_start_activity_map_split();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : map_fullscreen( No 3 ) */
+/* Event : stt_prv_layer_apps_map_fll( No 16 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs3e16( void )
+{
+ stm_apl_start_activity_map_fullscreen();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : splitable_normal( No 4 ) */
+/* Event : stt_prv_layer_apps_spl_nml( No 17 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs4e17( void )
+{
+ stm_apl_start_activity_splitable_normal();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : splitable_split( No 5 ) */
+/* Event : ara_normal( No 3 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs5e3( void )
+{
+ stm_apl_start_activity_splitable_split();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : general( No 6 ) */
+/* Event : ara_normal( No 6 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs6e6( void )
+{
+ stm_apl_start_activity_general();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOff */
+/* State : system( No 7 ) */
+/* Event : ara_normal( No 7 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs7e7( void )
+{
+ stm_apl_start_activity_system();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOn */
+/* State : map( No 0 ) */
+/* Event : ara_fullscreen( No 1 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOns0e1( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS1F] = ( uint8_t )ZAPL_RESTRICTIONMODEONS1;
+ stm_apl_start_activity_map_fullscreen();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOn */
+/* State : map( No 0 ) */
+/* Event : stt_prv_layer_apps_map_nml( No 2 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOns0e2( void )
+{
+ stm_apl_start_activity_map();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOn */
+/* State : map_fullscreen( No 1 ) */
+/* Event : ara_normal( No 0 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOns1e0( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS1F] = ( uint8_t )ZAPL_RESTRICTIONMODEONS0;
+ stm_apl_start_activity_map();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionModeOn */
+/* State : map_fullscreen( No 1 ) */
+/* Event : stt_prv_layer_apps_map_fll( No 3 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOns1e3( void )
+{
+ stm_apl_start_activity_map_fullscreen();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : AppsLayer */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZAPL_AppsLayers0Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ stm_apl_event_restriction_mode_on();
+ /*stt_map_is_activated*/
+ if( g_stm_map_is_activated == STM_TRUE )
+ {
+ /*stt_prv_layer_apps_not_sys_nml*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state != StmLayoutNoSysNml )
+ {
+ ZAPL_AppsLayers0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs0Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*ara_fullscreen*/
+ else if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs0e13();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : map( No 1 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs1Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*ara_split_sub*/
+ else if( g_stm_area == StmAreaNoSplitSub )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs1e14();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : map_split( No 2 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs2Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*ara_fullscreen*/
+ else if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs2e3();
+ }
+ /*ara_split_sub*/
+ else if( g_stm_area == StmAreaNoSplitSub )
+ {
+ ZAPL_RestrictionModeOffs2e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs2e3();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : map_fullscreen( No 3 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs3Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs3e16();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : splitable_normal( No 4 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs4Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*ara_split_main*/
+ else if( g_stm_area == StmAreaNoSplitMain )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*ara_fullscreen*/
+ else if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*ara_split_sub*/
+ else if( g_stm_area == StmAreaNoSplitSub )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_splitable*/
+ if( g_stm_category == StmCtgNoSplitable )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs4e17();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : splitable_split( No 5 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs5Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*ara_split_main*/
+ else if( g_stm_area == StmAreaNoSplitMain )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*ara_fullscreen*/
+ else if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs5e3();
+ }
+ /*ara_split_main*/
+ else if( g_stm_area == StmAreaNoSplitMain )
+ {
+ ZAPL_RestrictionModeOffs5e3();
+ }
+ /*ara_split_sub*/
+ else if( g_stm_area == StmAreaNoSplitSub )
+ {
+ ZAPL_RestrictionModeOffs5e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_splitable*/
+ if( g_stm_category == StmCtgNoSplitable )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs5e3();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : general( No 6 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs6Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*ara_fullscreen*/
+ else if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs6e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_general*/
+ if( g_stm_category == StmCtgNoGeneral )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs6e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs0e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOff */
+/* State : system( No 7 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOffs7Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*ara_fullscreen*/
+ else if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable*/
+ else if( g_stm_category == StmCtgNoSplitable )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_system*/
+ else if( g_stm_category == StmCtgNoSystem )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOffs7e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_system*/
+ if( g_stm_category == StmCtgNoSystem )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ ZAPL_RestrictionModeOffs1e8();
+ }
+ /*stt_prv_layer_apps_map_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOffs0e0();
+ }
+ /*stt_prv_layer_apps_map_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZAPL_RestrictionModeOffs0e15();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOffs0e2();
+ }
+ /*stt_prv_layer_apps_spl_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZAPL_RestrictionModeOffs0e3();
+ }
+ /*stt_prv_layer_apps_spl_spl*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZAPL_RestrictionModeOffs0e18();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZAPL_RestrictionModeOffs0e6();
+ }
+ /*stt_prv_layer_apps_sys_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSysNml )
+ {
+ ZAPL_RestrictionModeOffs7e7();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : AppsLayer */
+/* State : restriction_mode_on( No 1 )*/
+/****************************************/
+static void ZAPL_AppsLayers1Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ stm_apl_event_restriction_mode_off();
+ ZAPL_AppsLayers1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOn */
+/* State : map( No 0 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOns0Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZAPL_RestrictionModeOns0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_map_nml*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOns0e2();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOns0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionModeOn */
+/* State : map_fullscreen( No 1 ) */
+/****************************************/
+static void ZAPL_RestrictionModeOns1Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_map*/
+ if( g_stm_category == StmCtgNoMap )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ ZAPL_RestrictionModeOns1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_map_nml*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapNml )
+ {
+ ZAPL_RestrictionModeOns1e0();
+ }
+ /*stt_prv_layer_apps_map_fll*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMapFll )
+ {
+ ZAPL_RestrictionModeOns1e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : AppsLayer */
+/****************************************/
+void stm_apl_event_call( void )
+{
+ stm_apl_start_stm();
+ switch( ZAPL_AppsLayerState[ZAPL_APPSLAYER] )
+ {
+ case ZAPL_APPSLAYERS0:
+ switch( ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] )
+ {
+ case ZAPL_RESTRICTIONMODEOFFS0:
+ ZAPL_RestrictionModeOffs0Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS1:
+ ZAPL_RestrictionModeOffs1Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS2:
+ ZAPL_RestrictionModeOffs2Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS3:
+ ZAPL_RestrictionModeOffs3Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS4:
+ ZAPL_RestrictionModeOffs4Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS5:
+ ZAPL_RestrictionModeOffs5Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS6:
+ ZAPL_RestrictionModeOffs6Event();
+ break;
+ case ZAPL_RESTRICTIONMODEOFFS7:
+ ZAPL_RestrictionModeOffs7Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ ZAPL_AppsLayers0Event();
+ break;
+ case ZAPL_APPSLAYERS1:
+ switch( ZAPL_AppsLayerState[ZAPL_APPSLAYERS1F] )
+ {
+ case ZAPL_RESTRICTIONMODEONS0:
+ ZAPL_RestrictionModeOns0Event();
+ break;
+ case ZAPL_RESTRICTIONMODEONS1:
+ ZAPL_RestrictionModeOns1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ ZAPL_AppsLayers1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : AppsLayer */
+/****************************************/
+void stm_apl_initialize( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYER] = ( uint8_t )ZAPL_APPSLAYERS0;
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS0F] = ( uint8_t )ZAPL_RESTRICTIONMODEOFFS0;
+ ZAPL_AppsLayerState[ZAPL_APPSLAYERS1F] = ( uint8_t )ZAPL_RESTRICTIONMODEONS0;
+ ZAPL_AppsLayers0StateEntry();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : AppsLayer */
+/****************************************/
+void ZAPL_AppsLayerTerminate( void )
+{
+ ZAPL_AppsLayerState[ZAPL_APPSLAYER] = ( uint8_t )ZAPL_APPSLAYERTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.h
new file mode 100644
index 0000000..4cbbc10
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_AppsLayer.h
@@ -0,0 +1,123 @@
+/************************************************************/
+/* ZAPL_AppsLayer.h */
+/* AppsLayer State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZAPL_APPSLAYER_H
+#define ZHEADER_ZAPL_APPSLAYER_H
+
+/*State management variable access define*/
+#define ZAPL_APPSLAYER ( 0U )
+#define ZAPL_APPSLAYERS0F ( 1U )
+#define ZAPL_APPSLAYERS1F ( 2U )
+#define ZAPL_APPSLAYERS0 ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFS0 ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFS1 ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFS2 ( 2U )
+#define ZAPL_RESTRICTIONMODEOFFS3 ( 3U )
+#define ZAPL_RESTRICTIONMODEOFFS4 ( 4U )
+#define ZAPL_RESTRICTIONMODEOFFS5 ( 5U )
+#define ZAPL_RESTRICTIONMODEOFFS6 ( 6U )
+#define ZAPL_RESTRICTIONMODEOFFS7 ( 7U )
+#define ZAPL_APPSLAYERS1 ( 1U )
+#define ZAPL_RESTRICTIONMODEONS0 ( 0U )
+#define ZAPL_RESTRICTIONMODEONS1 ( 1U )
+#define ZAPL_APPSLAYERSTATENOMAX ( 3U )
+
+/*End state define*/
+#define ZAPL_APPSLAYEREND ( 8U )
+/*Terminate state define*/
+#define ZAPL_APPSLAYERTERMINATE ( ZAPL_APPSLAYEREND + 1U )
+
+/*State no define*/
+#define ZAPL_APPSLAYERS0STATENO ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFS0STATENO ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFS1STATENO ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFS2STATENO ( 2U )
+#define ZAPL_RESTRICTIONMODEOFFS3STATENO ( 3U )
+#define ZAPL_RESTRICTIONMODEOFFS4STATENO ( 4U )
+#define ZAPL_RESTRICTIONMODEOFFS5STATENO ( 5U )
+#define ZAPL_RESTRICTIONMODEOFFS6STATENO ( 6U )
+#define ZAPL_RESTRICTIONMODEOFFS7STATENO ( 7U )
+#define ZAPL_APPSLAYERS1STATENO ( 1U )
+#define ZAPL_RESTRICTIONMODEONS0STATENO ( 0U )
+#define ZAPL_RESTRICTIONMODEONS1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZAPL_APPSLAYERS0STATESERIALNO ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFS0STATESERIALNO ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFS1STATESERIALNO ( 2U )
+#define ZAPL_RESTRICTIONMODEOFFS2STATESERIALNO ( 3U )
+#define ZAPL_RESTRICTIONMODEOFFS3STATESERIALNO ( 4U )
+#define ZAPL_RESTRICTIONMODEOFFS4STATESERIALNO ( 5U )
+#define ZAPL_RESTRICTIONMODEOFFS5STATESERIALNO ( 6U )
+#define ZAPL_RESTRICTIONMODEOFFS6STATESERIALNO ( 7U )
+#define ZAPL_RESTRICTIONMODEOFFS7STATESERIALNO ( 8U )
+#define ZAPL_APPSLAYERS1STATESERIALNO ( 9U )
+#define ZAPL_RESTRICTIONMODEONS0STATESERIALNO ( 10U )
+#define ZAPL_RESTRICTIONMODEONS1STATESERIALNO ( 11U )
+
+/*Event no define*/
+#define ZAPL_APPSLAYERE0EVENTNO ( 0U )
+#define ZAPL_APPSLAYERE1EVENTNO ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFE0EVENTNO ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFE1EVENTNO ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFE2EVENTNO ( 2U )
+#define ZAPL_RESTRICTIONMODEOFFE3EVENTNO ( 3U )
+#define ZAPL_RESTRICTIONMODEOFFE4EVENTNO ( 4U )
+#define ZAPL_RESTRICTIONMODEOFFE5EVENTNO ( 5U )
+#define ZAPL_RESTRICTIONMODEOFFE6EVENTNO ( 6U )
+#define ZAPL_RESTRICTIONMODEOFFE7EVENTNO ( 7U )
+#define ZAPL_RESTRICTIONMODEOFFE8EVENTNO ( 8U )
+#define ZAPL_RESTRICTIONMODEOFFE9EVENTNO ( 9U )
+#define ZAPL_RESTRICTIONMODEOFFE10EVENTNO ( 10U )
+#define ZAPL_RESTRICTIONMODEOFFE11EVENTNO ( 11U )
+#define ZAPL_RESTRICTIONMODEOFFE12EVENTNO ( 12U )
+#define ZAPL_RESTRICTIONMODEOFFE13EVENTNO ( 13U )
+#define ZAPL_RESTRICTIONMODEOFFE14EVENTNO ( 14U )
+#define ZAPL_RESTRICTIONMODEOFFE15EVENTNO ( 15U )
+#define ZAPL_RESTRICTIONMODEOFFE16EVENTNO ( 16U )
+#define ZAPL_RESTRICTIONMODEOFFE17EVENTNO ( 17U )
+#define ZAPL_RESTRICTIONMODEOFFE18EVENTNO ( 18U )
+#define ZAPL_RESTRICTIONMODEOFFE19EVENTNO ( 19U )
+#define ZAPL_RESTRICTIONMODEOFFE20EVENTNO ( 20U )
+#define ZAPL_RESTRICTIONMODEONE0EVENTNO ( 0U )
+#define ZAPL_RESTRICTIONMODEONE1EVENTNO ( 1U )
+#define ZAPL_RESTRICTIONMODEONE2EVENTNO ( 2U )
+#define ZAPL_RESTRICTIONMODEONE3EVENTNO ( 3U )
+
+/*Event serial no define*/
+#define ZAPL_APPSLAYERE0EVENTSERIALNO ( 0U )
+#define ZAPL_APPSLAYERE1EVENTSERIALNO ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFE0EVENTNO ( 0U )
+#define ZAPL_RESTRICTIONMODEOFFE1EVENTNO ( 1U )
+#define ZAPL_RESTRICTIONMODEOFFE2EVENTNO ( 2U )
+#define ZAPL_RESTRICTIONMODEOFFE3EVENTNO ( 3U )
+#define ZAPL_RESTRICTIONMODEOFFE4EVENTNO ( 4U )
+#define ZAPL_RESTRICTIONMODEOFFE5EVENTNO ( 5U )
+#define ZAPL_RESTRICTIONMODEOFFE6EVENTNO ( 6U )
+#define ZAPL_RESTRICTIONMODEOFFE7EVENTNO ( 7U )
+#define ZAPL_RESTRICTIONMODEOFFE8EVENTNO ( 8U )
+#define ZAPL_RESTRICTIONMODEOFFE9EVENTNO ( 9U )
+#define ZAPL_RESTRICTIONMODEOFFE10EVENTNO ( 10U )
+#define ZAPL_RESTRICTIONMODEOFFE11EVENTNO ( 11U )
+#define ZAPL_RESTRICTIONMODEOFFE12EVENTNO ( 12U )
+#define ZAPL_RESTRICTIONMODEOFFE13EVENTNO ( 13U )
+#define ZAPL_RESTRICTIONMODEOFFE14EVENTNO ( 14U )
+#define ZAPL_RESTRICTIONMODEOFFE15EVENTNO ( 15U )
+#define ZAPL_RESTRICTIONMODEOFFE16EVENTNO ( 16U )
+#define ZAPL_RESTRICTIONMODEOFFE17EVENTNO ( 17U )
+#define ZAPL_RESTRICTIONMODEOFFE18EVENTNO ( 18U )
+#define ZAPL_RESTRICTIONMODEOFFE19EVENTNO ( 19U )
+#define ZAPL_RESTRICTIONMODEOFFE20EVENTNO ( 20U )
+#define ZAPL_RESTRICTIONMODEONE0EVENTNO ( 0U )
+#define ZAPL_RESTRICTIONMODEONE1EVENTNO ( 1U )
+#define ZAPL_RESTRICTIONMODEONE2EVENTNO ( 2U )
+#define ZAPL_RESTRICTIONMODEONE3EVENTNO ( 3U )
+
+/*Extern function*/
+extern void stm_apl_event_call( void );
+extern void stm_apl_initialize( void );
+extern void ZAPL_AppsLayerTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.c
new file mode 100644
index 0000000..d2e7075
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.c
@@ -0,0 +1,128 @@
+/************************************************************/
+/* ZAPL_Apps_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_apl_start_activity_none
+ */
+void stm_apl_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_apl_start_activity_map
+ */
+void stm_apl_start_activity_map() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMapNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+
+ if ((g_stm_event == StmEvtNoActivate)
+ && (g_stm_category == StmCtgNoMap)) {
+ g_stm_map_is_activated = STM_TRUE;
+ }
+}
+
+/*
+ * @name stm_apl_start_activity_map_split
+ */
+void stm_apl_start_activity_map_split() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMapSpl;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+
+ if ((g_stm_event == StmEvtNoActivate)
+ && (g_stm_category == StmCtgNoMap)) {
+ g_stm_map_is_activated = STM_TRUE;
+ }
+}
+
+/*
+ * @name stm_apl_start_activity_map_fullscreen
+ */
+void stm_apl_start_activity_map_fullscreen() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMapFll;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+
+ if ((g_stm_event == StmEvtNoActivate)
+ && (g_stm_category == StmCtgNoMap)) {
+ g_stm_map_is_activated = STM_TRUE;
+ }
+}
+
+/*
+ * @name stm_apl_start_activity_splitable_normal
+ */
+void stm_apl_start_activity_splitable_normal() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoSplNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_apl_start_activity_splitable_split
+ */
+void stm_apl_start_activity_splitable_split() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoSplSpl;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_apl_start_activity_general
+ */
+void stm_apl_start_activity_general() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoGenNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_apl_start_activity_system
+ */
+void stm_apl_start_activity_system() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoSysNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_apl_event_restriction_mode_off
+ */
+void stm_apl_event_restriction_mode_off() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = g_prv_apps_state_car_stop;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_apl_event_restriction_mode_on
+ */
+void stm_apl_event_restriction_mode_on() {
+ g_prv_apps_state_car_stop = g_stm_prv_state.layer[StmLayerNoApps].state;
+}
+
+/*
+ * @name stm_apl_initialize_variable
+ */
+void stm_apl_initialize_variable() {
+ g_stm_prv_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoApps].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_apl_start_stm
+ */
+void stm_apl_start_stm() {
+ if (g_stm_event == StmEvtNoUndo) {
+ // nop
+ }
+ else {
+ g_stm_prv_state.layer[StmLayerNoApps].state = g_stm_crr_state.layer[StmLayerNoApps].state;
+ }
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.h
new file mode 100644
index 0000000..4f74c9f
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/AppsLayer/ZAPL_Apps_func.h
@@ -0,0 +1,22 @@
+/************************************************************/
+/* ZAPL_Apps_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZAPL_APPS_FUNC_H
+#define ZHEADER_ZAPL_APPS_FUNC_H
+
+extern void stm_apl_start_activity_none();
+extern void stm_apl_start_activity_map();
+extern void stm_apl_start_activity_map_split();
+extern void stm_apl_start_activity_map_fullscreen();
+extern void stm_apl_start_activity_splitable_normal();
+extern void stm_apl_start_activity_splitable_split();
+extern void stm_apl_start_activity_general();
+extern void stm_apl_start_activity_system();
+extern void stm_apl_event_restriction_mode_off();
+extern void stm_apl_event_restriction_mode_on();
+extern void stm_apl_initialize_variable();
+extern void stm_apl_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.c
new file mode 100644
index 0000000..8e20123
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.c
@@ -0,0 +1,154 @@
+/************************************************************/
+/* ZCAR_CarState.c */
+/* CarState State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZCAR_CarStateState[ZCAR_CARSTATESTATENOMAX];
+
+static void ZCAR_CarStates0e1( void );
+static void ZCAR_CarStates1e0( void );
+static void ZCAR_CarStates0Event( void );
+static void ZCAR_CarStates1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : CarState */
+/* State : car_stop( No 0 ) */
+/* Event : stt_accel_pedal_on( No 1 ) */
+/****************************************/
+static void ZCAR_CarStates0e1( void )
+{
+ ZCAR_CarStateState[ZCAR_CARSTATE] = ( uint8_t )ZCAR_CARSTATES1;
+ stm_rns_start_activity_car_run();
+}
+
+/****************************************/
+/* Action function */
+/* STM : CarState */
+/* State : car_run( No 1 ) */
+/* Event : stt_accel_pedal_off( No 0 )*/
+/****************************************/
+static void ZCAR_CarStates1e0( void )
+{
+ ZCAR_CarStateState[ZCAR_CARSTATE] = ( uint8_t )ZCAR_CARSTATES0;
+ stm_rns_start_activity_car_stop();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : CarState */
+/* State : car_stop( No 0 ) */
+/****************************************/
+static void ZCAR_CarStates0Event( void )
+{
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*stt_accel_pedal_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state == StmAccelPedalSttNoOn )
+ {
+ ZCAR_CarStates0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : CarState */
+/* State : car_run( No 1 ) */
+/****************************************/
+static void ZCAR_CarStates1Event( void )
+{
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*stt_accel_pedal_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state == StmAccelPedalSttNoOff )
+ {
+ ZCAR_CarStates1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*stt_lightstatus_brake_on*/
+ else if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*stt_accel_pedal_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state == StmAccelPedalSttNoOff )
+ {
+ ZCAR_CarStates1e0();
+ }
+ /*stt_accel_pedal_on*/
+ else if( g_stm_crr_state.car_element[StmCarElementNoAccelPedal].state == StmAccelPedalSttNoOn )
+ {
+ ZCAR_CarStates1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : CarState */
+/****************************************/
+void stm_rns_event_call( void )
+{
+ stm_rns_start_stm();
+ switch( ZCAR_CarStateState[ZCAR_CARSTATE] )
+ {
+ case ZCAR_CARSTATES0:
+ ZCAR_CarStates0Event();
+ break;
+ case ZCAR_CARSTATES1:
+ ZCAR_CarStates1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : CarState */
+/****************************************/
+void stm_rns_initialize( void )
+{
+ ZCAR_CarStateState[ZCAR_CARSTATE] = ( uint8_t )ZCAR_CARSTATES0;
+ stm_rns_start_activity_car_stop();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : CarState */
+/****************************************/
+void ZCAR_CarStateTerminate( void )
+{
+ ZCAR_CarStateState[ZCAR_CARSTATE] = ( uint8_t )ZCAR_CARSTATETERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.h
new file mode 100644
index 0000000..18003a7
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState.h
@@ -0,0 +1,45 @@
+/************************************************************/
+/* ZCAR_CarState.h */
+/* CarState State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZCAR_CARSTATE_H
+#define ZHEADER_ZCAR_CARSTATE_H
+
+/*State management variable access define*/
+#define ZCAR_CARSTATE ( 0U )
+#define ZCAR_CARSTATES0 ( 0U )
+#define ZCAR_CARSTATES1 ( 1U )
+#define ZCAR_CARSTATESTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZCAR_CARSTATEEND ( 2U )
+/*Terminate state define*/
+#define ZCAR_CARSTATETERMINATE ( ZCAR_CARSTATEEND + 1U )
+
+/*State no define*/
+#define ZCAR_CARSTATES0STATENO ( 0U )
+#define ZCAR_CARSTATES1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZCAR_CARSTATES0STATESERIALNO ( 0U )
+#define ZCAR_CARSTATES1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZCAR_CARSTATEE0EVENTNO ( 0U )
+#define ZCAR_CARSTATEE1EVENTNO ( 1U )
+#define ZCAR_CARSTATEE2EVENTNO ( 2U )
+#define ZCAR_CARSTATEE3EVENTNO ( 3U )
+
+/*Event serial no define*/
+#define ZCAR_CARSTATEE0EVENTSERIALNO ( 0U )
+#define ZCAR_CARSTATEE1EVENTSERIALNO ( 1U )
+#define ZCAR_CARSTATEE2EVENTSERIALNO ( 2U )
+#define ZCAR_CARSTATEE3EVENTSERIALNO ( 3U )
+
+/*Extern function*/
+extern void stm_rns_event_call( void );
+extern void stm_rns_initialize( void );
+extern void ZCAR_CarStateTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.c
new file mode 100644
index 0000000..d6cd5d1
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.c
@@ -0,0 +1,45 @@
+/************************************************************/
+/* ZCAR_CarState_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_rns_start_activity_car_stop
+ */
+void stm_rns_start_activity_car_stop() {
+ g_stm_crr_state.car_element[StmCarElementNoRunning].state = StmRunningNoStop;
+ g_stm_crr_state.car_element[StmCarElementNoRunning].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rns_start_activity_car_run
+ */
+void stm_rns_start_activity_car_run() {
+ g_stm_crr_state.car_element[StmCarElementNoRunning].state = StmRunningNoRun;
+ g_stm_crr_state.car_element[StmCarElementNoRunning].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rns_initialize_variable
+ */
+void stm_rns_initialize_variable() {
+ g_stm_prv_state.car_element[StmCarElementNoRunning].state = StmRunningNoStop;
+ g_stm_prv_state.car_element[StmCarElementNoRunning].changed = STM_FALSE;
+
+ g_stm_crr_state.car_element[StmCarElementNoRunning].state = StmRunningNoStop;
+ g_stm_crr_state.car_element[StmCarElementNoRunning].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_rns_start_stm
+ */
+void stm_rns_start_stm() {
+ g_stm_prv_state.car_element[StmCarElementNoRunning].state = g_stm_crr_state.car_element[StmCarElementNoRunning].state;
+ g_stm_crr_state.car_element[StmCarElementNoRunning].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.h
new file mode 100644
index 0000000..8c1dc93
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/CarState/ZCAR_CarState_func.h
@@ -0,0 +1,14 @@
+/************************************************************/
+/* ZCAR_CarState_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZCAR_CARSTATE_FUNC_H
+#define ZHEADER_ZCAR_CARSTATE_FUNC_H
+
+extern void stm_rns_start_activity_car_stop();
+extern void stm_rns_start_activity_car_run();
+extern void stm_rns_initialize_variable();
+extern void stm_rns_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.c
new file mode 100644
index 0000000..1375c66
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.c
@@ -0,0 +1,112 @@
+/************************************************************/
+/* ZHSL_HomeScreen.c */
+/* HomeScreen State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZHSL_HomeScreenState[ZHSL_HOMESCREENSTATENOMAX];
+
+static void ZHSL_HomeScreens0e0( void );
+static void ZHSL_HomeScreens0Event( void );
+static void ZHSL_HomeScreens1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : HomeScreen */
+/* State : none( No 0 ) */
+/* Event : ara_fullscreen( No 0 ) */
+/****************************************/
+static void ZHSL_HomeScreens0e0( void )
+{
+ ZHSL_HomeScreenState[ZHSL_HOMESCREEN] = ( uint8_t )ZHSL_HOMESCREENS1;
+ stm_hsl_start_activity_homescreen();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : HomeScreen */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZHSL_HomeScreens0Event( void )
+{
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_homescreen*/
+ if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZHSL_HomeScreens0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : HomeScreen */
+/* State : homescreen( No 1 ) */
+/****************************************/
+static void ZHSL_HomeScreens1Event( void )
+{
+}
+
+/****************************************/
+/* Event call function */
+/* STM : HomeScreen */
+/****************************************/
+void stm_hsl_event_call( void )
+{
+ stm_hsl_start_stm();
+ switch( ZHSL_HomeScreenState[ZHSL_HOMESCREEN] )
+ {
+ case ZHSL_HOMESCREENS0:
+ ZHSL_HomeScreens0Event();
+ break;
+ case ZHSL_HOMESCREENS1:
+ ZHSL_HomeScreens1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : HomeScreen */
+/****************************************/
+void stm_hsl_initialize( void )
+{
+ ZHSL_HomeScreenState[ZHSL_HOMESCREEN] = ( uint8_t )ZHSL_HOMESCREENS0;
+ stm_hsl_start_activity_none();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : HomeScreen */
+/****************************************/
+void ZHSL_HomeScreenTerminate( void )
+{
+ ZHSL_HomeScreenState[ZHSL_HOMESCREEN] = ( uint8_t )ZHSL_HOMESCREENTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.h
new file mode 100644
index 0000000..ffa8552
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen.h
@@ -0,0 +1,39 @@
+/************************************************************/
+/* ZHSL_HomeScreen.h */
+/* HomeScreen State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZHSL_HOMESCREEN_H
+#define ZHEADER_ZHSL_HOMESCREEN_H
+
+/*State management variable access define*/
+#define ZHSL_HOMESCREEN ( 0U )
+#define ZHSL_HOMESCREENS0 ( 0U )
+#define ZHSL_HOMESCREENS1 ( 1U )
+#define ZHSL_HOMESCREENSTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZHSL_HOMESCREENEND ( 2U )
+/*Terminate state define*/
+#define ZHSL_HOMESCREENTERMINATE ( ZHSL_HOMESCREENEND + 1U )
+
+/*State no define*/
+#define ZHSL_HOMESCREENS0STATENO ( 0U )
+#define ZHSL_HOMESCREENS1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZHSL_HOMESCREENS0STATESERIALNO ( 0U )
+#define ZHSL_HOMESCREENS1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZHSL_HOMESCREENE0EVENTNO ( 0U )
+
+/*Event serial no define*/
+#define ZHSL_HOMESCREENE0EVENTSERIALNO ( 0U )
+
+/*Extern function*/
+extern void stm_hsl_event_call( void );
+extern void stm_hsl_initialize( void );
+extern void ZHSL_HomeScreenTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.c
new file mode 100644
index 0000000..4d50ab0
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.c
@@ -0,0 +1,45 @@
+/************************************************************/
+/* ZHSL_HomeScreen_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_hsl_start_activity_none
+ */
+void stm_hsl_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoHomescreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoHomescreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_hsl_start_activity_homescreen
+ */
+void stm_hsl_start_activity_homescreen() {
+ g_stm_crr_state.layer[StmLayerNoHomescreen].state = StmLayoutNoHms;
+ g_stm_crr_state.layer[StmLayerNoHomescreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_hsl_initialize_variable
+ */
+void stm_hsl_initialize_variable() {
+ g_stm_prv_state.layer[StmLayerNoHomescreen].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoHomescreen].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoHomescreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoHomescreen].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_hsl_start_stm
+ */
+void stm_hsl_start_stm() {
+ g_stm_prv_state.layer[StmLayerNoHomescreen].state = g_stm_crr_state.layer[StmLayerNoHomescreen].state;
+ g_stm_crr_state.layer[StmLayerNoHomescreen].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.h
new file mode 100644
index 0000000..d5f4ab9
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/HomeScreenLayer/ZHSL_HomeScreen_func.h
@@ -0,0 +1,14 @@
+/************************************************************/
+/* ZHSL_HomeScreen_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZHSL_HOMESCREEN_FUNC_H
+#define ZHEADER_ZHSL_HOMESCREEN_FUNC_H
+
+extern void stm_hsl_start_activity_none();
+extern void stm_hsl_start_activity_homescreen();
+extern void stm_hsl_initialize_variable();
+extern void stm_hsl_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.c
new file mode 100644
index 0000000..8f65d32
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.c
@@ -0,0 +1,117 @@
+/************************************************************/
+/* ZLIGHT_LightstatusBrake.c */
+/* LightstatusBrake State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZLIGHT_LightstatusBrakeState[ZLIGHT_LIGHTSTATUSBRAKESTATENOMAX];
+
+static void ZLIGHT_LightstatusBrakes0e1( void );
+static void ZLIGHT_LightstatusBrakes1e0( void );
+static void ZLIGHT_LightstatusBrakes0Event( void );
+static void ZLIGHT_LightstatusBrakes1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : LightstatusBrake */
+/* State : lightstatus_brake_on( No 0 ) */
+/* Event : evt_lightstatus_brake_off( No 1 ) */
+/****************************************/
+static void ZLIGHT_LightstatusBrakes0e1( void )
+{
+ ZLIGHT_LightstatusBrakeState[ZLIGHT_LIGHTSTATUSBRAKE] = ( uint8_t )ZLIGHT_LIGHTSTATUSBRAKES1;
+ stm_lbs_start_activity_lightstatus_brake_off();
+}
+
+/****************************************/
+/* Action function */
+/* STM : LightstatusBrake */
+/* State : lightstatus_brake_off( No 1 ) */
+/* Event : evt_lightstatus_brake_on( No 0 ) */
+/****************************************/
+static void ZLIGHT_LightstatusBrakes1e0( void )
+{
+ ZLIGHT_LightstatusBrakeState[ZLIGHT_LIGHTSTATUSBRAKE] = ( uint8_t )ZLIGHT_LIGHTSTATUSBRAKES0;
+ stm_lbs_start_activity_lightstatus_brake_on();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : LightstatusBrake */
+/* State : lightstatus_brake_on( No 0 ) */
+/****************************************/
+static void ZLIGHT_LightstatusBrakes0Event( void )
+{
+ /*evt_lightstatus_brake_off*/
+ if( g_stm_event == StmEvtNoLightstatusBrakeOff )
+ {
+ ZLIGHT_LightstatusBrakes0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : LightstatusBrake */
+/* State : lightstatus_brake_off( No 1 ) */
+/****************************************/
+static void ZLIGHT_LightstatusBrakes1Event( void )
+{
+ /*evt_lightstatus_brake_on*/
+ if( g_stm_event == StmEvtNoLightstatusBrakeOn )
+ {
+ ZLIGHT_LightstatusBrakes1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : LightstatusBrake */
+/****************************************/
+void stm_lbs_event_call( void )
+{
+ stm_lbs_start_stm();
+ switch( ZLIGHT_LightstatusBrakeState[ZLIGHT_LIGHTSTATUSBRAKE] )
+ {
+ case ZLIGHT_LIGHTSTATUSBRAKES0:
+ ZLIGHT_LightstatusBrakes0Event();
+ break;
+ case ZLIGHT_LIGHTSTATUSBRAKES1:
+ ZLIGHT_LightstatusBrakes1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : LightstatusBrake */
+/****************************************/
+void stm_lbs_initialize( void )
+{
+ ZLIGHT_LightstatusBrakeState[ZLIGHT_LIGHTSTATUSBRAKE] = ( uint8_t )ZLIGHT_LIGHTSTATUSBRAKES0;
+ stm_lbs_start_activity_lightstatus_brake_on();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : LightstatusBrake */
+/****************************************/
+void ZLIGHT_LightstatusBrakeTerminate( void )
+{
+ ZLIGHT_LightstatusBrakeState[ZLIGHT_LIGHTSTATUSBRAKE] = ( uint8_t )ZLIGHT_LIGHTSTATUSBRAKETERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.h
new file mode 100644
index 0000000..0ced0ec
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrake.h
@@ -0,0 +1,41 @@
+/************************************************************/
+/* ZLIGHT_LightstatusBrake.h */
+/* LightstatusBrake State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZLIGHT_LIGHTSTATUSBRAKE_H
+#define ZHEADER_ZLIGHT_LIGHTSTATUSBRAKE_H
+
+/*State management variable access define*/
+#define ZLIGHT_LIGHTSTATUSBRAKE ( 0U )
+#define ZLIGHT_LIGHTSTATUSBRAKES0 ( 0U )
+#define ZLIGHT_LIGHTSTATUSBRAKES1 ( 1U )
+#define ZLIGHT_LIGHTSTATUSBRAKESTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZLIGHT_LIGHTSTATUSBRAKEEND ( 2U )
+/*Terminate state define*/
+#define ZLIGHT_LIGHTSTATUSBRAKETERMINATE ( ZLIGHT_LIGHTSTATUSBRAKEEND + 1U )
+
+/*State no define*/
+#define ZLIGHT_LIGHTSTATUSBRAKES0STATENO ( 0U )
+#define ZLIGHT_LIGHTSTATUSBRAKES1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZLIGHT_LIGHTSTATUSBRAKES0STATESERIALNO ( 0U )
+#define ZLIGHT_LIGHTSTATUSBRAKES1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZLIGHT_LIGHTSTATUSBRAKEE0EVENTNO ( 0U )
+#define ZLIGHT_LIGHTSTATUSBRAKEE1EVENTNO ( 1U )
+
+/*Event serial no define*/
+#define ZLIGHT_LIGHTSTATUSBRAKEE0EVENTSERIALNO ( 0U )
+#define ZLIGHT_LIGHTSTATUSBRAKEE1EVENTSERIALNO ( 1U )
+
+/*Extern function*/
+extern void stm_lbs_event_call( void );
+extern void stm_lbs_initialize( void );
+extern void ZLIGHT_LightstatusBrakeTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.c
new file mode 100644
index 0000000..70c7478
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.c
@@ -0,0 +1,45 @@
+/************************************************************/
+/* ZLIGHT_LightstatusBrakeStatus_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_lbs_start_activity_lightstatus_brake_off
+ */
+void stm_lbs_start_activity_lightstatus_brake_off() {
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state = StmLightstatusBrakeSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_lbs_start_activity_lightstatus_brake_on
+ */
+void stm_lbs_start_activity_lightstatus_brake_on() {
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state = StmLightstatusBrakeSttNoOn;
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_lbs_initialize_variable
+ */
+void stm_lbs_initialize_variable() {
+ g_stm_prv_state.car_element[StmCarElementNoLightstatusBrake].state = StmLightstatusBrakeSttNoOn;
+ g_stm_prv_state.car_element[StmCarElementNoLightstatusBrake].changed = STM_FALSE;
+
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state = StmLightstatusBrakeSttNoOn;
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_lbs_start_stm
+ */
+void stm_lbs_start_stm() {
+ g_stm_prv_state.car_element[StmCarElementNoLightstatusBrake].state = g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state;
+ g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.h
new file mode 100644
index 0000000..5ebd5b1
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.h
@@ -0,0 +1,14 @@
+/************************************************************/
+/* ZLIGHT_LightstatusBrakeStatus_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZLIGHT_LIGHTSTATUSBRAKESTATUS_FUNC_H
+#define ZHEADER_ZLIGHT_LIGHTSTATUSBRAKESTATUS_FUNC_H
+
+extern void stm_lbs_start_activity_lightstatus_brake_off();
+extern void stm_lbs_start_activity_lightstatus_brake_on();
+extern void stm_lbs_initialize_variable();
+extern void stm_lbs_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.c
new file mode 100644
index 0000000..dad2484
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.c
@@ -0,0 +1,65 @@
+/************************************************************/
+/* ZNHL_NearHomeScreen_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_nhl_start_activity_none
+ */
+void stm_nhl_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_nhl_start_activity_software_keyboard
+ */
+void stm_nhl_start_activity_software_keyboard() {
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].state = StmLayoutNoSftKbd;
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_nhl_event_restriction_mode_off
+ */
+void stm_nhl_event_restriction_mode_off() {
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].state = g_prv_near_homescreen_state_car_stop;
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_nhl_event_restriction_mode_on
+ */
+void stm_nhl_event_restriction_mode_on() {
+ g_prv_near_homescreen_state_car_stop = g_stm_prv_state.layer[StmLayerNoNearHomescreen].state;
+}
+
+/*
+ * @name stm_nhl_initialize_variable
+ */
+void stm_nhl_initialize_variable() {
+ g_stm_prv_state.layer[StmLayerNoNearHomescreen].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoNearHomescreen].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_nhl_start_stm
+ */
+void stm_nhl_start_stm() {
+ if (g_stm_event == StmEvtNoUndo) {
+ // nop
+ }
+ else {
+ g_stm_prv_state.layer[StmLayerNoNearHomescreen].state = g_stm_crr_state.layer[StmLayerNoNearHomescreen].state;
+ }
+ g_stm_crr_state.layer[StmLayerNoNearHomescreen].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.h
new file mode 100644
index 0000000..d2b13f7
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomeScreen_func.h
@@ -0,0 +1,16 @@
+/************************************************************/
+/* ZNHL_NearHomeScreen_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZNHL_NEARHOMESCREEN_FUNC_H
+#define ZHEADER_ZNHL_NEARHOMESCREEN_FUNC_H
+
+extern void stm_nhl_start_activity_none();
+extern void stm_nhl_start_activity_software_keyboard();
+extern void stm_nhl_event_restriction_mode_off();
+extern void stm_nhl_event_restriction_mode_on();
+extern void stm_nhl_initialize_variable();
+extern void stm_nhl_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.c
new file mode 100644
index 0000000..1c024b8
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.c
@@ -0,0 +1,220 @@
+/************************************************************/
+/* ZNHL_NearHomescreen.c */
+/* NearHomescreen State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZNHL_NearHomescreenState[ZNHL_NEARHOMESCREENSTATENOMAX];
+
+static void ZNHL_NearHomescreens0e0( void );
+static void ZNHL_NearHomescreens0e3( void );
+static void ZNHL_NearHomescreens1e2( void );
+static void ZNHL_NearHomescreens1e4( void );
+static void ZNHL_NearHomescreens0Event( void );
+static void ZNHL_NearHomescreens1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : NearHomescreen */
+/* State : none( No 0 ) */
+/* Event : ara_software_keyboard( No 0 ) */
+/****************************************/
+static void ZNHL_NearHomescreens0e0( void )
+{
+ ZNHL_NearHomescreenState[ZNHL_NEARHOMESCREEN] = ( uint8_t )ZNHL_NEARHOMESCREENS1;
+ stm_nhl_start_activity_software_keyboard();
+}
+
+/****************************************/
+/* Action function */
+/* STM : NearHomescreen */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_near_homescreen_none( No 3 ) */
+/****************************************/
+static void ZNHL_NearHomescreens0e3( void )
+{
+ stm_nhl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : NearHomescreen */
+/* State : software_keyboard( No 1 ) */
+/* Event : ctg_software_keyboard( No 2 ) */
+/****************************************/
+static void ZNHL_NearHomescreens1e2( void )
+{
+ ZNHL_NearHomescreenState[ZNHL_NEARHOMESCREEN] = ( uint8_t )ZNHL_NEARHOMESCREENS0;
+ stm_nhl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : NearHomescreen */
+/* State : software_keyboard( No 1 ) */
+/* Event : stt_prv_layer_near_homescreen_sft_kbd( No 4 ) */
+/****************************************/
+static void ZNHL_NearHomescreens1e4( void )
+{
+ stm_nhl_start_activity_software_keyboard();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : NearHomescreen */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZNHL_NearHomescreens0Event( void )
+{
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_software_keyboard*/
+ if( g_stm_category == StmCtgNoSoftwareKeyboard )
+ {
+ /*ara_software_keyboard*/
+ if( g_stm_area == StmAreaNoSoftwareKyeboard )
+ {
+ ZNHL_NearHomescreens0e0();
+ }
+ else
+ {
+ ZNHL_NearHomescreens0e0();
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_near_homescreen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoNearHomescreen].state == StmLayoutNoNone )
+ {
+ ZNHL_NearHomescreens0e3();
+ }
+ /*stt_prv_layer_near_homescreen_sft_kbd*/
+ else if( g_stm_prv_state.layer[StmLayerNoNearHomescreen].state == StmLayoutNoSftKbd )
+ {
+ ZNHL_NearHomescreens0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : NearHomescreen */
+/* State : software_keyboard( No 1 ) */
+/****************************************/
+static void ZNHL_NearHomescreens1Event( void )
+{
+ /*evt_deactivate*/
+ if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_software_keyboard*/
+ if( g_stm_category == StmCtgNoSoftwareKeyboard )
+ {
+ ZNHL_NearHomescreens1e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_near_homescreen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoNearHomescreen].state == StmLayoutNoNone )
+ {
+ ZNHL_NearHomescreens1e2();
+ }
+ /*stt_prv_layer_near_homescreen_sft_kbd*/
+ else if( g_stm_prv_state.layer[StmLayerNoNearHomescreen].state == StmLayoutNoSftKbd )
+ {
+ ZNHL_NearHomescreens1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*stt_lightstatus_brake_off*/
+ else if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ ZNHL_NearHomescreens1e2();
+ }
+ /*stt_crr_layer_apps_changed*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].changed == STM_TRUE )
+ {
+ ZNHL_NearHomescreens1e2();
+ }
+ /*stt_crr_layer_hs_changed*/
+ else if( g_stm_crr_state.layer[StmLayerNoHomescreen].changed == STM_TRUE )
+ {
+ ZNHL_NearHomescreens1e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : NearHomescreen */
+/****************************************/
+void stm_nhl_event_call( void )
+{
+ stm_nhl_start_stm();
+ switch( ZNHL_NearHomescreenState[ZNHL_NEARHOMESCREEN] )
+ {
+ case ZNHL_NEARHOMESCREENS0:
+ ZNHL_NearHomescreens0Event();
+ break;
+ case ZNHL_NEARHOMESCREENS1:
+ ZNHL_NearHomescreens1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : NearHomescreen */
+/****************************************/
+void stm_nhl_initialize( void )
+{
+ ZNHL_NearHomescreenState[ZNHL_NEARHOMESCREEN] = ( uint8_t )ZNHL_NEARHOMESCREENS0;
+ stm_nhl_start_activity_none();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : NearHomescreen */
+/****************************************/
+void ZNHL_NearHomescreenTerminate( void )
+{
+ ZNHL_NearHomescreenState[ZNHL_NEARHOMESCREEN] = ( uint8_t )ZNHL_NEARHOMESCREENTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.h
new file mode 100644
index 0000000..f23775e
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/NearHomeScreen/ZNHL_NearHomescreen.h
@@ -0,0 +1,53 @@
+/************************************************************/
+/* ZNHL_NearHomescreen.h */
+/* NearHomescreen State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZNHL_NEARHOMESCREEN_H
+#define ZHEADER_ZNHL_NEARHOMESCREEN_H
+
+/*State management variable access define*/
+#define ZNHL_NEARHOMESCREEN ( 0U )
+#define ZNHL_NEARHOMESCREENS0 ( 0U )
+#define ZNHL_NEARHOMESCREENS1 ( 1U )
+#define ZNHL_NEARHOMESCREENSTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZNHL_NEARHOMESCREENEND ( 2U )
+/*Terminate state define*/
+#define ZNHL_NEARHOMESCREENTERMINATE ( ZNHL_NEARHOMESCREENEND + 1U )
+
+/*State no define*/
+#define ZNHL_NEARHOMESCREENS0STATENO ( 0U )
+#define ZNHL_NEARHOMESCREENS1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZNHL_NEARHOMESCREENS0STATESERIALNO ( 0U )
+#define ZNHL_NEARHOMESCREENS1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZNHL_NEARHOMESCREENE0EVENTNO ( 0U )
+#define ZNHL_NEARHOMESCREENE1EVENTNO ( 1U )
+#define ZNHL_NEARHOMESCREENE2EVENTNO ( 2U )
+#define ZNHL_NEARHOMESCREENE3EVENTNO ( 3U )
+#define ZNHL_NEARHOMESCREENE4EVENTNO ( 4U )
+#define ZNHL_NEARHOMESCREENE5EVENTNO ( 5U )
+#define ZNHL_NEARHOMESCREENE6EVENTNO ( 6U )
+#define ZNHL_NEARHOMESCREENE7EVENTNO ( 7U )
+
+/*Event serial no define*/
+#define ZNHL_NEARHOMESCREENE0EVENTSERIALNO ( 0U )
+#define ZNHL_NEARHOMESCREENE1EVENTSERIALNO ( 1U )
+#define ZNHL_NEARHOMESCREENE2EVENTSERIALNO ( 2U )
+#define ZNHL_NEARHOMESCREENE3EVENTSERIALNO ( 3U )
+#define ZNHL_NEARHOMESCREENE4EVENTSERIALNO ( 4U )
+#define ZNHL_NEARHOMESCREENE5EVENTSERIALNO ( 5U )
+#define ZNHL_NEARHOMESCREENE6EVENTSERIALNO ( 6U )
+#define ZNHL_NEARHOMESCREENE7EVENTSERIALNO ( 7U )
+
+/*Extern function*/
+extern void stm_nhl_event_call( void );
+extern void stm_nhl_initialize( void );
+extern void ZNHL_NearHomescreenTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.c
new file mode 100644
index 0000000..c131608
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.c
@@ -0,0 +1,72 @@
+/************************************************************/
+/* ZOSL_OnScreen_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_osl_start_activity_none
+ */
+void stm_osl_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_osl_start_activity_pop_up
+ */
+void stm_osl_start_activity_pop_up() {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoPopUp;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_osl_start_activity_system_alert
+ */
+void stm_osl_start_activity_system_alert() {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoSysAlt;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_osl_event_restriction_mode_off
+ */
+void stm_osl_event_restriction_mode_off() {
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = g_prv_on_screen_state_car_stop;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_osl_event_restriction_mode_on
+ */
+void stm_osl_event_restriction_mode_on() {
+ g_prv_on_screen_state_car_stop = g_stm_prv_state.layer[StmLayerNoOnScreen].state;
+}
+/*
+ * @name stm_osl_initialize_variable
+ */
+void stm_osl_initialize_variable() {
+ g_stm_prv_state.layer[StmLayerNoOnScreen].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoOnScreen].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoOnScreen].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_osl_start_stm
+ */
+void stm_osl_start_stm() {
+ if (g_stm_event == StmEvtNoUndo) {
+ // nop
+ }
+ else {
+ g_stm_prv_state.layer[StmLayerNoOnScreen].state = g_stm_crr_state.layer[StmLayerNoOnScreen].state;
+ }
+ g_stm_crr_state.layer[StmLayerNoOnScreen].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.h
new file mode 100644
index 0000000..3edef28
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OnScreen_func.h
@@ -0,0 +1,17 @@
+/************************************************************/
+/* ZOSL_OnScreen_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZOSL_ONSCREEN_FUNC_H
+#define ZHEADER_ZOSL_ONSCREEN_FUNC_H
+
+extern void stm_osl_start_activity_none();
+extern void stm_osl_start_activity_pop_up();
+extern void stm_osl_start_activity_system_alert();
+extern void stm_osl_event_restriction_mode_off();
+extern void stm_osl_event_restriction_mode_on();
+extern void stm_osl_initialize_variable();
+extern void stm_osl_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.c
new file mode 100644
index 0000000..6b60219
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.c
@@ -0,0 +1,718 @@
+/************************************************************/
+/* ZOSL_OslMain.c */
+/* OslMain State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZOSL_OslMainState[ZOSL_OSLMAINSTATENOMAX];
+
+static void ZOSL_OslMains0StateEntry( void );
+static void ZOSL_OslMains1StateEntry( void );
+static void ZOSL_OslMains0e1( void );
+static void ZOSL_OslMains0e2( void );
+static void ZOSL_OslMains1e0( void );
+static void ZOSL_OslRestOffs0e0( void );
+static void ZOSL_OslRestOffs0e1( void );
+static void ZOSL_OslRestOffs0e4( void );
+static void ZOSL_OslRestOffs1e0( void );
+static void ZOSL_OslRestOffs1e2( void );
+static void ZOSL_OslRestOffs2e6( void );
+static void ZOSL_OslRestOns0e0( void );
+static void ZOSL_OslRestOns0e2( void );
+static void ZOSL_OslRestOns1e1( void );
+static void ZOSL_OslRestOns1e3( void );
+static void ZOSL_OslMains0Event( void );
+static void ZOSL_OslRestOffs0Event( void );
+static void ZOSL_OslRestOffs1Event( void );
+static void ZOSL_OslRestOffs2Event( void );
+static void ZOSL_OslMains1Event( void );
+static void ZOSL_OslRestOns0Event( void );
+static void ZOSL_OslRestOns1Event( void );
+
+/****************************************/
+/* State start activity function */
+/* STM : OslMain */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZOSL_OslMains0StateEntry( void )
+{
+ switch( ZOSL_OslMainState[ZOSL_OSLMAINS0F] )
+ {
+ case ZOSL_OSLRESTOFFS0:
+ stm_osl_start_activity_none();
+ break;
+ case ZOSL_OSLRESTOFFS1:
+ stm_osl_start_activity_pop_up();
+ break;
+ case ZOSL_OSLRESTOFFS2:
+ stm_osl_start_activity_system_alert();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* State start activity function */
+/* STM : OslMain */
+/* State : restriction_mode_on( No 1 )*/
+/****************************************/
+static void ZOSL_OslMains1StateEntry( void )
+{
+ switch( ZOSL_OslMainState[ZOSL_OSLMAINS1F] )
+ {
+ case ZOSL_OSLRESTONS0:
+ stm_osl_start_activity_none();
+ break;
+ case ZOSL_OSLRESTONS1:
+ stm_osl_start_activity_system_alert();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslMain */
+/* State : restriction_mode_off( No 0 ) */
+/* Event : stt_crr_layer_on_screen_pop( No 1 ) */
+/****************************************/
+static void ZOSL_OslMains0e1( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS1;
+ ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
+ ZOSL_OslMains1StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslMain */
+/* State : restriction_mode_off( No 0 ) */
+/* Event : stt_crr_layer_on_screen_sys( No 2 ) */
+/****************************************/
+static void ZOSL_OslMains0e2( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS1;
+ ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS1;
+ ZOSL_OslMains1StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslMain */
+/* State : restriction_mode_on( No 1 )*/
+/* Event : stt_restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZOSL_OslMains1e0( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS0;
+ ZOSL_OslMains0StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOff */
+/* State : none( No 0 ) */
+/* Event : ara_onscreen( No 0 ) */
+/****************************************/
+static void ZOSL_OslRestOffs0e0( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS1;
+ stm_osl_start_activity_pop_up();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOff */
+/* State : none( No 0 ) */
+/* Event : ara_onscreen( No 1 ) */
+/****************************************/
+static void ZOSL_OslRestOffs0e1( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS2;
+ stm_osl_start_activity_system_alert();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOff */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_on_screen_none( No 4 ) */
+/****************************************/
+static void ZOSL_OslRestOffs0e4( void )
+{
+ stm_osl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOff */
+/* State : popup( No 1 ) */
+/* Event : ara_onscreen( No 0 ) */
+/****************************************/
+static void ZOSL_OslRestOffs1e0( void )
+{
+ stm_osl_start_activity_pop_up();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOff */
+/* State : popup( No 1 ) */
+/* Event : ctg_popup( No 2 ) */
+/****************************************/
+static void ZOSL_OslRestOffs1e2( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS0;
+ stm_osl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOff */
+/* State : system_alert( No 2 ) */
+/* Event : stt_prv_layer_on_screen_sys_alt( No 6 ) */
+/****************************************/
+static void ZOSL_OslRestOffs2e6( void )
+{
+ stm_osl_start_activity_system_alert();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOn */
+/* State : none( No 0 ) */
+/* Event : ara_onscreen( No 0 ) */
+/****************************************/
+static void ZOSL_OslRestOns0e0( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS1;
+ stm_osl_start_activity_system_alert();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOn */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_on_screen_none( No 2 ) */
+/****************************************/
+static void ZOSL_OslRestOns0e2( void )
+{
+ stm_osl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOn */
+/* State : system_alert( No 1 ) */
+/* Event : ctg_systemalert( No 1 ) */
+/****************************************/
+static void ZOSL_OslRestOns1e1( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
+ stm_osl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : OslRestOn */
+/* State : system_alert( No 1 ) */
+/* Event : stt_prv_layer_on_screen_sys_alt( No 3 ) */
+/****************************************/
+static void ZOSL_OslRestOns1e3( void )
+{
+ stm_osl_start_activity_system_alert();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslMain */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZOSL_OslMains0Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ stm_rel_event_restriction_mode_on();
+ /*stt_crr_layer_on_screen_pop*/
+ if( g_stm_crr_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
+ {
+ ZOSL_OslMains0e1();
+ }
+ /*stt_crr_layer_on_screen_sys*/
+ else if( g_stm_crr_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
+ {
+ ZOSL_OslMains0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslRestOff */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZOSL_OslRestOffs0Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_popup*/
+ if( g_stm_category == StmCtgNoPopUp )
+ {
+ /*ara_onscreen*/
+ if( g_stm_area == StmAreaNoOnScreen )
+ {
+ ZOSL_OslRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_systemalert*/
+ else if( g_stm_category == StmCtgNoSystemAlert )
+ {
+ /*ara_onscreen*/
+ if( g_stm_area == StmAreaNoOnScreen )
+ {
+ ZOSL_OslRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_on_screen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
+ {
+ ZOSL_OslRestOffs0e4();
+ }
+ /*stt_prv_layer_on_screen_pop_up*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
+ {
+ ZOSL_OslRestOffs0e0();
+ }
+ /*stt_prv_layer_on_screen_sys_alt*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
+ {
+ ZOSL_OslRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslRestOff */
+/* State : popup( No 1 ) */
+/****************************************/
+static void ZOSL_OslRestOffs1Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_popup*/
+ if( g_stm_category == StmCtgNoPopUp )
+ {
+ /*ara_onscreen*/
+ if( g_stm_area == StmAreaNoOnScreen )
+ {
+ ZOSL_OslRestOffs1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_systemalert*/
+ else if( g_stm_category == StmCtgNoSystemAlert )
+ {
+ /*ara_onscreen*/
+ if( g_stm_area == StmAreaNoOnScreen )
+ {
+ ZOSL_OslRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_popup*/
+ if( g_stm_category == StmCtgNoPopUp )
+ {
+ ZOSL_OslRestOffs1e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_on_screen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
+ {
+ ZOSL_OslRestOffs1e2();
+ }
+ /*stt_prv_layer_on_screen_pop_up*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
+ {
+ ZOSL_OslRestOffs1e0();
+ }
+ /*stt_prv_layer_on_screen_sys_alt*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
+ {
+ ZOSL_OslRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslRestOff */
+/* State : system_alert( No 2 ) */
+/****************************************/
+static void ZOSL_OslRestOffs2Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*evt_deactivate*/
+ if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_systemalert*/
+ if( g_stm_category == StmCtgNoSystemAlert )
+ {
+ ZOSL_OslRestOffs1e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_on_screen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
+ {
+ ZOSL_OslRestOffs1e2();
+ }
+ /*stt_prv_layer_on_screen_pop_up*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
+ {
+ ZOSL_OslRestOffs0e0();
+ }
+ /*stt_prv_layer_on_screen_sys_alt*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
+ {
+ ZOSL_OslRestOffs2e6();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslMain */
+/* State : restriction_mode_on( No 1 )*/
+/****************************************/
+static void ZOSL_OslMains1Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ stm_rel_event_restriction_mode_off();
+ ZOSL_OslMains1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslRestOn */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZOSL_OslRestOns0Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_systemalert*/
+ if( g_stm_category == StmCtgNoSystemAlert )
+ {
+ /*ara_onscreen*/
+ if( g_stm_area == StmAreaNoOnScreen )
+ {
+ ZOSL_OslRestOns0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_on_screen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
+ {
+ ZOSL_OslRestOns0e2();
+ }
+ /*stt_prv_layer_on_screen_sys_alt*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
+ {
+ ZOSL_OslRestOns0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : OslRestOn */
+/* State : system_alert( No 1 ) */
+/****************************************/
+static void ZOSL_OslRestOns1Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ /*evt_deactivate*/
+ if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_systemalert*/
+ if( g_stm_category == StmCtgNoSystemAlert )
+ {
+ ZOSL_OslRestOns1e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_on_screen_none*/
+ if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
+ {
+ ZOSL_OslRestOns1e1();
+ }
+ /*stt_prv_layer_on_screen_sys_alt*/
+ else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
+ {
+ ZOSL_OslRestOns1e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : OslMain */
+/****************************************/
+void stm_osl_event_call( void )
+{
+ stm_osl_start_stm();
+ switch( ZOSL_OslMainState[ZOSL_OSLMAIN] )
+ {
+ case ZOSL_OSLMAINS0:
+ switch( ZOSL_OslMainState[ZOSL_OSLMAINS0F] )
+ {
+ case ZOSL_OSLRESTOFFS0:
+ ZOSL_OslRestOffs0Event();
+ break;
+ case ZOSL_OSLRESTOFFS1:
+ ZOSL_OslRestOffs1Event();
+ break;
+ case ZOSL_OSLRESTOFFS2:
+ ZOSL_OslRestOffs2Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ ZOSL_OslMains0Event();
+ break;
+ case ZOSL_OSLMAINS1:
+ switch( ZOSL_OslMainState[ZOSL_OSLMAINS1F] )
+ {
+ case ZOSL_OSLRESTONS0:
+ ZOSL_OslRestOns0Event();
+ break;
+ case ZOSL_OSLRESTONS1:
+ ZOSL_OslRestOns1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ ZOSL_OslMains1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : OslMain */
+/****************************************/
+void stm_osl_initialize( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS0;
+ ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS0;
+ ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
+ ZOSL_OslMains0StateEntry();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : OslMain */
+/****************************************/
+void ZOSL_OslMainTerminate( void )
+{
+ ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.h
new file mode 100644
index 0000000..ee45304
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/OnScreenlayer/ZOSL_OslMain.h
@@ -0,0 +1,82 @@
+/************************************************************/
+/* ZOSL_OslMain.h */
+/* OslMain State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZOSL_OSLMAIN_H
+#define ZHEADER_ZOSL_OSLMAIN_H
+
+/*State management variable access define*/
+#define ZOSL_OSLMAIN ( 0U )
+#define ZOSL_OSLMAINS0F ( 1U )
+#define ZOSL_OSLMAINS1F ( 2U )
+#define ZOSL_OSLMAINS0 ( 0U )
+#define ZOSL_OSLRESTOFFS0 ( 0U )
+#define ZOSL_OSLRESTOFFS1 ( 1U )
+#define ZOSL_OSLRESTOFFS2 ( 2U )
+#define ZOSL_OSLMAINS1 ( 1U )
+#define ZOSL_OSLRESTONS0 ( 0U )
+#define ZOSL_OSLRESTONS1 ( 1U )
+#define ZOSL_OSLMAINSTATENOMAX ( 3U )
+
+/*End state define*/
+#define ZOSL_OSLMAINEND ( 3U )
+/*Terminate state define*/
+#define ZOSL_OSLMAINTERMINATE ( ZOSL_OSLMAINEND + 1U )
+
+/*State no define*/
+#define ZOSL_OSLMAINS0STATENO ( 0U )
+#define ZOSL_OSLRESTOFFS0STATENO ( 0U )
+#define ZOSL_OSLRESTOFFS1STATENO ( 1U )
+#define ZOSL_OSLRESTOFFS2STATENO ( 2U )
+#define ZOSL_OSLMAINS1STATENO ( 1U )
+#define ZOSL_OSLRESTONS0STATENO ( 0U )
+#define ZOSL_OSLRESTONS1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZOSL_OSLMAINS0STATESERIALNO ( 0U )
+#define ZOSL_OSLRESTOFFS0STATESERIALNO ( 1U )
+#define ZOSL_OSLRESTOFFS1STATESERIALNO ( 2U )
+#define ZOSL_OSLRESTOFFS2STATESERIALNO ( 3U )
+#define ZOSL_OSLMAINS1STATESERIALNO ( 4U )
+#define ZOSL_OSLRESTONS0STATESERIALNO ( 5U )
+#define ZOSL_OSLRESTONS1STATESERIALNO ( 6U )
+
+/*Event no define*/
+#define ZOSL_OSLMAINE0EVENTNO ( 0U )
+#define ZOSL_OSLMAINE1EVENTNO ( 1U )
+#define ZOSL_OSLMAINE2EVENTNO ( 2U )
+#define ZOSL_OSLRESTOFFE0EVENTNO ( 0U )
+#define ZOSL_OSLRESTOFFE1EVENTNO ( 1U )
+#define ZOSL_OSLRESTOFFE2EVENTNO ( 2U )
+#define ZOSL_OSLRESTOFFE3EVENTNO ( 3U )
+#define ZOSL_OSLRESTOFFE4EVENTNO ( 4U )
+#define ZOSL_OSLRESTOFFE5EVENTNO ( 5U )
+#define ZOSL_OSLRESTOFFE6EVENTNO ( 6U )
+#define ZOSL_OSLRESTONE0EVENTNO ( 0U )
+#define ZOSL_OSLRESTONE1EVENTNO ( 1U )
+#define ZOSL_OSLRESTONE2EVENTNO ( 2U )
+#define ZOSL_OSLRESTONE3EVENTNO ( 3U )
+
+/*Event serial no define*/
+#define ZOSL_OSLMAINE0EVENTSERIALNO ( 0U )
+#define ZOSL_OSLMAINE1EVENTSERIALNO ( 1U )
+#define ZOSL_OSLMAINE2EVENTSERIALNO ( 2U )
+#define ZOSL_OSLRESTOFFE0EVENTNO ( 0U )
+#define ZOSL_OSLRESTOFFE1EVENTNO ( 1U )
+#define ZOSL_OSLRESTOFFE2EVENTNO ( 2U )
+#define ZOSL_OSLRESTOFFE3EVENTNO ( 3U )
+#define ZOSL_OSLRESTOFFE4EVENTNO ( 4U )
+#define ZOSL_OSLRESTOFFE5EVENTNO ( 5U )
+#define ZOSL_OSLRESTOFFE6EVENTNO ( 6U )
+#define ZOSL_OSLRESTONE0EVENTNO ( 0U )
+#define ZOSL_OSLRESTONE1EVENTNO ( 1U )
+#define ZOSL_OSLRESTONE2EVENTNO ( 2U )
+#define ZOSL_OSLRESTONE3EVENTNO ( 3U )
+
+/*Extern function*/
+extern void stm_osl_event_call( void );
+extern void stm_osl_initialize( void );
+extern void ZOSL_OslMainTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.c
new file mode 100644
index 0000000..4c390ff
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.c
@@ -0,0 +1,1003 @@
+/************************************************************/
+/* ZREL_RelMain.c */
+/* RelMain State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZREL_RelMainState[ZREL_RELMAINSTATENOMAX];
+
+static void ZREL_RelMains0StateEntry( void );
+static void ZREL_RelMains1StateEntry( void );
+static void ZREL_RelMains0e1( void );
+static void ZREL_RelMains1e0( void );
+static void ZREL_RelRestOffs0e0( void );
+static void ZREL_RelRestOffs0e1( void );
+static void ZREL_RelRestOffs0e8( void );
+static void ZREL_RelRestOffs0e13( void );
+static void ZREL_RelRestOffs1e1( void );
+static void ZREL_RelRestOffs1e4( void );
+static void ZREL_RelRestOffs2e15( void );
+static void ZREL_RelRestOffs3e0( void );
+static void ZREL_RelMains0Event( void );
+static void ZREL_RelRestOffs0Event( void );
+static void ZREL_RelRestOffs1Event( void );
+static void ZREL_RelRestOffs2Event( void );
+static void ZREL_RelRestOffs3Event( void );
+static void ZREL_RelMains1Event( void );
+static void ZREL_RelRestOns0Event( void );
+
+/****************************************/
+/* State start activity function */
+/* STM : RelMain */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZREL_RelMains0StateEntry( void )
+{
+ switch( ZREL_RelMainState[ZREL_RELMAINS0F] )
+ {
+ case ZREL_RELRESTOFFS0:
+ stm_rel_start_activity_none();
+ break;
+ case ZREL_RELRESTOFFS1:
+ stm_rel_start_activity_restriction_normal();
+ break;
+ case ZREL_RELRESTOFFS2:
+ stm_rel_start_activity_restriction_split_main();
+ break;
+ case ZREL_RELRESTOFFS3:
+ stm_rel_start_activity_restriction_split_sub();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* State start activity function */
+/* STM : RelMain */
+/* State : restriction_mode_on( No 1 )*/
+/****************************************/
+static void ZREL_RelMains1StateEntry( void )
+{
+ switch( ZREL_RelMainState[ZREL_RELMAINS1F] )
+ {
+ case ZREL_RELRESTONS0:
+ stm_rel_start_activity_none();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelMain */
+/* State : restriction_mode_off( No 0 ) */
+/* Event : stt_restriction_mode_on( No 1 ) */
+/****************************************/
+static void ZREL_RelMains0e1( void )
+{
+ ZREL_RelMainState[ZREL_RELMAIN] = ( uint8_t )ZREL_RELMAINS1;
+ ZREL_RelMainState[ZREL_RELMAINS1F] = ( uint8_t )ZREL_RELRESTONS0;
+ ZREL_RelMains1StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelMain */
+/* State : restriction_mode_on( No 1 )*/
+/* Event : stt_restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZREL_RelMains1e0( void )
+{
+ ZREL_RelMainState[ZREL_RELMAIN] = ( uint8_t )ZREL_RELMAINS0;
+ ZREL_RelMains0StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : none( No 0 ) */
+/* Event : stt_crr_layer_apps_map_spl( No 0 ) */
+/****************************************/
+static void ZREL_RelRestOffs0e0( void )
+{
+ ZREL_RelMainState[ZREL_RELMAINS0F] = ( uint8_t )ZREL_RELRESTOFFS3;
+ stm_rel_start_activity_restriction_split_sub();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : none( No 0 ) */
+/* Event : stt_crr_layer_apps_spl_nml( No 1 ) */
+/****************************************/
+static void ZREL_RelRestOffs0e1( void )
+{
+ ZREL_RelMainState[ZREL_RELMAINS0F] = ( uint8_t )ZREL_RELRESTOFFS1;
+ stm_rel_start_activity_restriction_normal();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : none( No 0 ) */
+/* Event : ara_restriction_split_main( No 8 ) */
+/****************************************/
+static void ZREL_RelRestOffs0e8( void )
+{
+ ZREL_RelMainState[ZREL_RELMAINS0F] = ( uint8_t )ZREL_RELRESTOFFS2;
+ stm_rel_start_activity_restriction_split_main();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_rst_none( No 13 ) */
+/****************************************/
+static void ZREL_RelRestOffs0e13( void )
+{
+ stm_rel_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : restriction_normal( No 1 ) */
+/* Event : stt_crr_layer_apps_spl_nml( No 1 ) */
+/****************************************/
+static void ZREL_RelRestOffs1e1( void )
+{
+ stm_rel_start_activity_restriction_normal();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : restriction_normal( No 1 ) */
+/* Event : ELSE( No 4 ) */
+/****************************************/
+static void ZREL_RelRestOffs1e4( void )
+{
+ ZREL_RelMainState[ZREL_RELMAINS0F] = ( uint8_t )ZREL_RELRESTOFFS0;
+ stm_rel_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : restriction_split_main( No 2 ) */
+/* Event : stt_prv_layer_rst_rst_spl_main( No 15 ) */
+/****************************************/
+static void ZREL_RelRestOffs2e15( void )
+{
+ stm_rel_start_activity_restriction_split_main();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RelRestOff */
+/* State : restriction_split_sub( No 3 ) */
+/* Event : stt_crr_layer_apps_map_spl( No 0 ) */
+/****************************************/
+static void ZREL_RelRestOffs3e0( void )
+{
+ stm_rel_start_activity_restriction_split_sub();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelMain */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZREL_RelMains0Event( void )
+{
+ /*stt_restriction_mode_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
+ {
+ stm_rel_event_restriction_mode_on();
+ ZREL_RelMains0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelRestOff */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZREL_RelRestOffs0Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*stt_crr_layer_apps_changed*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_apps_map_spl*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ /*stt_crr_layer_apps_spl_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_spl_spl*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_gen_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_activate*/
+ else if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ /*ara_restriction_normal*/
+ if( g_stm_area == StmAreaNoRestrictionNormal )
+ {
+ /*stt_crr_layer_apps_spl_nml*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_map_spl*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ara_restriction_split_main*/
+ else if( g_stm_area == StmAreaNoRestrictionSplitMain )
+ {
+ ZREL_RelRestOffs0e8();
+ }
+ /*ara_restriction_split_sub*/
+ else if( g_stm_area == StmAreaNoRestrictionSplitSub )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_rst_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs0e13();
+ }
+ /*stt_prv_layer_rst_rst_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_prv_layer_rst_rst_spl_main*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplMain )
+ {
+ ZREL_RelRestOffs0e8();
+ }
+ /*stt_prv_layer_rst_rst_spl_sub*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplSub )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelRestOff */
+/* State : restriction_normal( No 1 ) */
+/****************************************/
+static void ZREL_RelRestOffs1Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*stt_crr_layer_apps_changed*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_apps_map_spl*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ /*stt_crr_layer_apps_spl_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs1e1();
+ }
+ /*stt_crr_layer_apps_spl_spl*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZREL_RelRestOffs1e1();
+ }
+ /*stt_crr_layer_apps_gen_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZREL_RelRestOffs1e1();
+ }
+ else
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ }
+ /*stt_crr_layer_hs_changed*/
+ else if( g_stm_crr_state.layer[StmLayerNoHomescreen].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_hs_hms*/
+ if( g_stm_crr_state.layer[StmLayerNoHomescreen].state == StmLayoutNoHms )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_activate*/
+ else if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ /*ara_restriction_normal*/
+ if( g_stm_area == StmAreaNoRestrictionNormal )
+ {
+ /*stt_crr_layer_apps_map_spl*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ara_restriction_split_main*/
+ else if( g_stm_area == StmAreaNoRestrictionSplitMain )
+ {
+ ZREL_RelRestOffs0e8();
+ }
+ /*ara_restriction_split_sub*/
+ else if( g_stm_area == StmAreaNoRestrictionSplitSub )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*stt_lightstatus_brake_on*/
+ else if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*stt_prv_layer_rst_not_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state != StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_rst_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ /*stt_prv_layer_rst_rst_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstNml )
+ {
+ ZREL_RelRestOffs1e1();
+ }
+ /*stt_prv_layer_rst_rst_spl_main*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplMain )
+ {
+ ZREL_RelRestOffs0e8();
+ }
+ /*stt_prv_layer_rst_rst_spl_sub*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplSub )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelRestOff */
+/* State : restriction_split_main( No 2 ) */
+/****************************************/
+static void ZREL_RelRestOffs2Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*stt_crr_layer_apps_changed*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_apps_map_spl*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ /*stt_crr_layer_apps_spl_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_spl_spl*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_gen_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ else
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ }
+ /*stt_crr_layer_hs_changed*/
+ else if( g_stm_crr_state.layer[StmLayerNoHomescreen].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_hs_hms*/
+ if( g_stm_crr_state.layer[StmLayerNoHomescreen].state == StmLayoutNoHms )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_activate*/
+ else if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ /*ara_restriction_normal*/
+ if( g_stm_area == StmAreaNoRestrictionNormal )
+ {
+ /*stt_crr_layer_apps_spl_nml*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_map_spl*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ara_restriction_split_sub*/
+ else if( g_stm_area == StmAreaNoRestrictionSplitSub )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*stt_lightstatus_brake_on*/
+ else if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*stt_prv_layer_rst_not_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state != StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_rst_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ /*stt_prv_layer_rst_rst_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_prv_layer_rst_rst_spl_main*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplMain )
+ {
+ ZREL_RelRestOffs2e15();
+ }
+ /*stt_prv_layer_rst_rst_spl_sub*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplSub )
+ {
+ ZREL_RelRestOffs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelRestOff */
+/* State : restriction_split_sub( No 3 ) */
+/****************************************/
+static void ZREL_RelRestOffs3Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*stt_crr_layer_apps_changed*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_apps_map_spl*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoMapSpl )
+ {
+ ZREL_RelRestOffs3e0();
+ }
+ /*stt_crr_layer_apps_spl_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_spl_spl*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_crr_layer_apps_gen_nml*/
+ else if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ else
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ }
+ /*stt_crr_layer_hs_changed*/
+ else if( g_stm_crr_state.layer[StmLayerNoHomescreen].changed == STM_TRUE )
+ {
+ /*stt_crr_layer_hs_hms*/
+ if( g_stm_crr_state.layer[StmLayerNoHomescreen].state == StmLayoutNoHms )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_activate*/
+ else if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ /*ara_restriction_normal*/
+ if( g_stm_area == StmAreaNoRestrictionNormal )
+ {
+ /*stt_crr_layer_apps_spl_nml*/
+ if( g_stm_crr_state.layer[StmLayerNoApps].state == StmLayoutNoSplNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ara_restriction_split_main*/
+ else if( g_stm_area == StmAreaNoRestrictionSplitMain )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_restriction*/
+ if( g_stm_category == StmCtgNoRestriction )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*stt_lightstatus_brake_on*/
+ else if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*stt_prv_layer_rst_not_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state != StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_rst_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoNone )
+ {
+ ZREL_RelRestOffs1e4();
+ }
+ /*stt_prv_layer_rst_rst_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstNml )
+ {
+ ZREL_RelRestOffs0e1();
+ }
+ /*stt_prv_layer_rst_rst_spl_main*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplMain )
+ {
+ ZREL_RelRestOffs0e8();
+ }
+ /*stt_prv_layer_rst_rst_spl_sub*/
+ else if( g_stm_prv_state.layer[StmLayerNoRestriction].state == StmLayoutNoRstSplSub )
+ {
+ ZREL_RelRestOffs3e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelMain */
+/* State : restriction_mode_on( No 1 )*/
+/****************************************/
+static void ZREL_RelMains1Event( void )
+{
+ /*stt_restriction_mode_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
+ {
+ stm_rel_event_restriction_mode_off();
+ ZREL_RelMains1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RelRestOn */
+/* State : none( No 0 ) */
+/****************************************/
+static void ZREL_RelRestOns0Event( void )
+{
+}
+
+/****************************************/
+/* Event call function */
+/* STM : RelMain */
+/****************************************/
+void stm_rel_event_call( void )
+{
+ stm_rel_start_stm();
+ switch( ZREL_RelMainState[ZREL_RELMAIN] )
+ {
+ case ZREL_RELMAINS0:
+ switch( ZREL_RelMainState[ZREL_RELMAINS0F] )
+ {
+ case ZREL_RELRESTOFFS0:
+ ZREL_RelRestOffs0Event();
+ break;
+ case ZREL_RELRESTOFFS1:
+ ZREL_RelRestOffs1Event();
+ break;
+ case ZREL_RELRESTOFFS2:
+ ZREL_RelRestOffs2Event();
+ break;
+ case ZREL_RELRESTOFFS3:
+ ZREL_RelRestOffs3Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ ZREL_RelMains0Event();
+ break;
+ case ZREL_RELMAINS1:
+ switch( ZREL_RelMainState[ZREL_RELMAINS1F] )
+ {
+ case ZREL_RELRESTONS0:
+ ZREL_RelRestOns0Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ ZREL_RelMains1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : RelMain */
+/****************************************/
+void stm_rel_initialize( void )
+{
+ ZREL_RelMainState[ZREL_RELMAIN] = ( uint8_t )ZREL_RELMAINS0;
+ ZREL_RelMainState[ZREL_RELMAINS0F] = ( uint8_t )ZREL_RELRESTOFFS0;
+ ZREL_RelMainState[ZREL_RELMAINS1F] = ( uint8_t )ZREL_RELRESTONS0;
+ ZREL_RelMains0StateEntry();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : RelMain */
+/****************************************/
+void ZREL_RelMainTerminate( void )
+{
+ ZREL_RelMainState[ZREL_RELMAIN] = ( uint8_t )ZREL_RELMAINTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.h
new file mode 100644
index 0000000..ce82e7a
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_RelMain.h
@@ -0,0 +1,94 @@
+/************************************************************/
+/* ZREL_RelMain.h */
+/* RelMain State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZREL_RELMAIN_H
+#define ZHEADER_ZREL_RELMAIN_H
+
+/*State management variable access define*/
+#define ZREL_RELMAIN ( 0U )
+#define ZREL_RELMAINS0F ( 1U )
+#define ZREL_RELMAINS1F ( 2U )
+#define ZREL_RELMAINS0 ( 0U )
+#define ZREL_RELRESTOFFS0 ( 0U )
+#define ZREL_RELRESTOFFS1 ( 1U )
+#define ZREL_RELRESTOFFS2 ( 2U )
+#define ZREL_RELRESTOFFS3 ( 3U )
+#define ZREL_RELMAINS1 ( 1U )
+#define ZREL_RELRESTONS0 ( 0U )
+#define ZREL_RELMAINSTATENOMAX ( 3U )
+
+/*End state define*/
+#define ZREL_RELMAINEND ( 4U )
+/*Terminate state define*/
+#define ZREL_RELMAINTERMINATE ( ZREL_RELMAINEND + 1U )
+
+/*State no define*/
+#define ZREL_RELMAINS0STATENO ( 0U )
+#define ZREL_RELRESTOFFS0STATENO ( 0U )
+#define ZREL_RELRESTOFFS1STATENO ( 1U )
+#define ZREL_RELRESTOFFS2STATENO ( 2U )
+#define ZREL_RELRESTOFFS3STATENO ( 3U )
+#define ZREL_RELMAINS1STATENO ( 1U )
+#define ZREL_RELRESTONS0STATENO ( 0U )
+
+/*State serial no define*/
+#define ZREL_RELMAINS0STATESERIALNO ( 0U )
+#define ZREL_RELRESTOFFS0STATESERIALNO ( 1U )
+#define ZREL_RELRESTOFFS1STATESERIALNO ( 2U )
+#define ZREL_RELRESTOFFS2STATESERIALNO ( 3U )
+#define ZREL_RELRESTOFFS3STATESERIALNO ( 4U )
+#define ZREL_RELMAINS1STATESERIALNO ( 5U )
+#define ZREL_RELRESTONS0STATESERIALNO ( 6U )
+
+/*Event no define*/
+#define ZREL_RELMAINE0EVENTNO ( 0U )
+#define ZREL_RELMAINE1EVENTNO ( 1U )
+#define ZREL_RELRESTOFFE0EVENTNO ( 0U )
+#define ZREL_RELRESTOFFE1EVENTNO ( 1U )
+#define ZREL_RELRESTOFFE2EVENTNO ( 2U )
+#define ZREL_RELRESTOFFE3EVENTNO ( 3U )
+#define ZREL_RELRESTOFFE4EVENTNO ( 4U )
+#define ZREL_RELRESTOFFE5EVENTNO ( 5U )
+#define ZREL_RELRESTOFFE6EVENTNO ( 6U )
+#define ZREL_RELRESTOFFE7EVENTNO ( 7U )
+#define ZREL_RELRESTOFFE8EVENTNO ( 8U )
+#define ZREL_RELRESTOFFE9EVENTNO ( 9U )
+#define ZREL_RELRESTOFFE10EVENTNO ( 10U )
+#define ZREL_RELRESTOFFE11EVENTNO ( 11U )
+#define ZREL_RELRESTOFFE12EVENTNO ( 12U )
+#define ZREL_RELRESTOFFE13EVENTNO ( 13U )
+#define ZREL_RELRESTOFFE14EVENTNO ( 14U )
+#define ZREL_RELRESTOFFE15EVENTNO ( 15U )
+#define ZREL_RELRESTOFFE16EVENTNO ( 16U )
+#define ZREL_RELRESTONE0EVENTNO ( 0U )
+
+/*Event serial no define*/
+#define ZREL_RELMAINE0EVENTSERIALNO ( 0U )
+#define ZREL_RELMAINE1EVENTSERIALNO ( 1U )
+#define ZREL_RELRESTOFFE0EVENTNO ( 0U )
+#define ZREL_RELRESTOFFE1EVENTNO ( 1U )
+#define ZREL_RELRESTOFFE2EVENTNO ( 2U )
+#define ZREL_RELRESTOFFE3EVENTNO ( 3U )
+#define ZREL_RELRESTOFFE4EVENTNO ( 4U )
+#define ZREL_RELRESTOFFE5EVENTNO ( 5U )
+#define ZREL_RELRESTOFFE6EVENTNO ( 6U )
+#define ZREL_RELRESTOFFE7EVENTNO ( 7U )
+#define ZREL_RELRESTOFFE8EVENTNO ( 8U )
+#define ZREL_RELRESTOFFE9EVENTNO ( 9U )
+#define ZREL_RELRESTOFFE10EVENTNO ( 10U )
+#define ZREL_RELRESTOFFE11EVENTNO ( 11U )
+#define ZREL_RELRESTOFFE12EVENTNO ( 12U )
+#define ZREL_RELRESTOFFE13EVENTNO ( 13U )
+#define ZREL_RELRESTOFFE14EVENTNO ( 14U )
+#define ZREL_RELRESTOFFE15EVENTNO ( 15U )
+#define ZREL_RELRESTOFFE16EVENTNO ( 16U )
+#define ZREL_RELRESTONE0EVENTNO ( 0U )
+
+/*Extern function*/
+extern void stm_rel_event_call( void );
+extern void stm_rel_initialize( void );
+extern void ZREL_RelMainTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.c
new file mode 100644
index 0000000..a1aa213
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.c
@@ -0,0 +1,81 @@
+/************************************************************/
+/* ZREL_Restriction_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_rel_start_activity_none
+ */
+void stm_rel_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoRestriction].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rel_start_activity_restriction_normal
+ */
+void stm_rel_start_activity_restriction_normal() {
+ g_stm_crr_state.layer[StmLayerNoRestriction].state = StmLayoutNoRstNml;
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rel_start_activity_restriction_split_main
+ */
+void stm_rel_start_activity_restriction_split_main() {
+ g_stm_crr_state.layer[StmLayerNoRestriction].state = StmLayoutNoRstSplMain;
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rel_start_activity_restriction_split_sub
+ */
+void stm_rel_start_activity_restriction_split_sub() {
+ g_stm_crr_state.layer[StmLayerNoRestriction].state = StmLayoutNoRstSplSub;
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rel_event_restriction_mode_off
+ */
+void stm_rel_event_restriction_mode_off() {
+ g_stm_crr_state.layer[StmLayerNoRestriction].state = g_prv_restriction_state_car_stop;
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rel_event_restriction_mode_on
+ */
+void stm_rel_event_restriction_mode_on() {
+ g_prv_restriction_state_car_stop = g_stm_prv_state.layer[StmLayerNoRestriction].state;
+}
+
+/*
+ * @name stm_rel_initialize_variable
+ */
+void stm_rel_initialize_variable() {
+ g_stm_prv_state.layer[StmLayerNoRestriction].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoRestriction].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoRestriction].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_rel_start_stm
+ */
+void stm_rel_start_stm() {
+ if (g_stm_event == StmEvtNoUndo) {
+ // nop
+ }
+ else {
+ g_stm_prv_state.layer[StmLayerNoRestriction].state = g_stm_crr_state.layer[StmLayerNoRestriction].state;
+ }
+ g_stm_crr_state.layer[StmLayerNoRestriction].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.h
new file mode 100644
index 0000000..3763820
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionLayer/ZREL_Restriction_func.h
@@ -0,0 +1,18 @@
+/************************************************************/
+/* ZREL_Restriction_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZREL_RESTRICTION_FUNC_H
+#define ZHEADER_ZREL_RESTRICTION_FUNC_H
+
+extern void stm_rel_start_activity_none();
+extern void stm_rel_start_activity_restriction_normal();
+extern void stm_rel_start_activity_restriction_split_main();
+extern void stm_rel_start_activity_restriction_split_sub();
+extern void stm_rel_event_restriction_mode_off();
+extern void stm_rel_event_restriction_mode_on();
+extern void stm_rel_initialize_variable();
+extern void stm_rel_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
new file mode 100644
index 0000000..2ba6a87
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
@@ -0,0 +1,117 @@
+/************************************************************/
+/* ZREM_RestrictionMode.c */
+/* RestrictionMode State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZREM_RestrictionModeState[ZREM_RESTRICTIONMODESTATENOMAX];
+
+static void ZREM_RestrictionModes0e1( void );
+static void ZREM_RestrictionModes1e0( void );
+static void ZREM_RestrictionModes0Event( void );
+static void ZREM_RestrictionModes1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_on( No 0 )*/
+/* Event : evt_restriction_mode_off( No 1 ) */
+/****************************************/
+static void ZREM_RestrictionModes0e1( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
+ stm_rem_start_activity_restriction_mode_off();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_off( No 1 ) */
+/* Event : evt_restriction_mode_on( No 0 ) */
+/****************************************/
+static void ZREM_RestrictionModes1e0( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
+ stm_rem_start_activity_restriction_mode_on();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_on( No 0 )*/
+/****************************************/
+static void ZREM_RestrictionModes0Event( void )
+{
+ /*evt_restriction_mode_off*/
+ if( g_stm_event == StmEvtNoRestrictionModeOff )
+ {
+ ZREM_RestrictionModes0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_off( No 1 ) */
+/****************************************/
+static void ZREM_RestrictionModes1Event( void )
+{
+ /*evt_restriction_mode_on*/
+ if( g_stm_event == StmEvtNoRestrictionModeOn )
+ {
+ ZREM_RestrictionModes1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : RestrictionMode */
+/****************************************/
+void stm_rem_event_call( void )
+{
+ stm_rem_start_stm();
+ switch( ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] )
+ {
+ case ZREM_RESTRICTIONMODES0:
+ ZREM_RestrictionModes0Event();
+ break;
+ case ZREM_RESTRICTIONMODES1:
+ ZREM_RestrictionModes1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : RestrictionMode */
+/****************************************/
+void stm_rem_initialize( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
+ stm_rem_start_activity_restriction_mode_off();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : RestrictionMode */
+/****************************************/
+void ZREM_RestrictionModeTerminate( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODETERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h
new file mode 100644
index 0000000..4ce0cac
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.h
@@ -0,0 +1,41 @@
+/************************************************************/
+/* ZREM_RestrictionMode.h */
+/* RestrictionMode State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZREM_RESTRICTIONMODE_H
+#define ZHEADER_ZREM_RESTRICTIONMODE_H
+
+/*State management variable access define*/
+#define ZREM_RESTRICTIONMODE ( 0U )
+#define ZREM_RESTRICTIONMODES0 ( 0U )
+#define ZREM_RESTRICTIONMODES1 ( 1U )
+#define ZREM_RESTRICTIONMODESTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZREM_RESTRICTIONMODEEND ( 2U )
+/*Terminate state define*/
+#define ZREM_RESTRICTIONMODETERMINATE ( ZREM_RESTRICTIONMODEEND + 1U )
+
+/*State no define*/
+#define ZREM_RESTRICTIONMODES0STATENO ( 0U )
+#define ZREM_RESTRICTIONMODES1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZREM_RESTRICTIONMODES0STATESERIALNO ( 0U )
+#define ZREM_RESTRICTIONMODES1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZREM_RESTRICTIONMODEE0EVENTNO ( 0U )
+#define ZREM_RESTRICTIONMODEE1EVENTNO ( 1U )
+
+/*Event serial no define*/
+#define ZREM_RESTRICTIONMODEE0EVENTSERIALNO ( 0U )
+#define ZREM_RESTRICTIONMODEE1EVENTSERIALNO ( 1U )
+
+/*Extern function*/
+extern void stm_rem_event_call( void );
+extern void stm_rem_initialize( void );
+extern void ZREM_RestrictionModeTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c
new file mode 100644
index 0000000..e920916
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.c
@@ -0,0 +1,45 @@
+/************************************************************/
+/* ZREM_RestrictionMode_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+/*
+ * @name stm_rem_start_activity_restriction_mode_on
+ */
+void stm_rem_start_activity_restriction_mode_on() {
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOn;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rem_start_activity_restriction_mode_off
+ */
+void stm_rem_start_activity_restriction_mode_off() {
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_TRUE;
+}
+
+/*
+ * @name stm_rem_initialize_variable
+ */
+void stm_rem_initialize_variable() {
+ g_stm_prv_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOff;
+ g_stm_prv_state.car_element[StmCarElementNoRestrictionMode].changed = STM_FALSE;
+
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state = StmRestrictionModeSttNoOff;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_FALSE;
+}
+
+/*
+ * @name stm_rem_start_stm
+ */
+void stm_rem_start_stm() {
+ g_stm_prv_state.car_element[StmCarElementNoRestrictionMode].state = g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state;
+ g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h
new file mode 100644
index 0000000..bbb6edf
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode_func.h
@@ -0,0 +1,14 @@
+/************************************************************/
+/* ZREM_RestrictionMode_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZREM_RESTRICTIONMODE_FUNC_H
+#define ZHEADER_ZREM_RESTRICTIONMODE_FUNC_H
+
+extern void stm_rem_start_activity_restriction_mode_on();
+extern void stm_rem_start_activity_restriction_mode_off();
+extern void stm_rem_initialize_variable();
+extern void stm_rem_start_stm();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_def.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_def.h
new file mode 100644
index 0000000..0212a95
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_def.h
@@ -0,0 +1,15 @@
+/************************************************************/
+/* ZST_StateTransitionor_def.h */
+/* Define header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZST_STATETRANSITIONOR_DEF_H
+#define ZHEADER_ZST_STATETRANSITIONOR_DEF_H
+
+/*************************************************************
+ Define definition
+*************************************************************/
+
+#include "../../../stm.h"
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.c
new file mode 100644
index 0000000..daea2ca
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.c
@@ -0,0 +1,178 @@
+/************************************************************/
+/* ZST_StateTransitionor_func.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "ZST_include.h"
+#include "../stm_master_apps.h"
+#include "../stm_master_remote.h"
+
+/*************************************************************
+ Function definition
+*************************************************************/
+
+#include <string.h>
+#include <stdbool.h>
+
+static bool isMaster = false;
+
+//=================================
+// API
+//=================================
+/**
+ * Initialize STM
+ */
+void stmInitializeInner(const char *ecu_name) {
+
+ // TODO: Set master mode
+ if (0 == strcmp("master", ecu_name))
+ {
+ isMaster = true;
+ }
+
+ // Initialize previous state
+ memset(&g_stm_prv_state, 0, sizeof(g_stm_prv_state));
+
+ // Initialize current state
+ g_stm_crr_state = g_stm_prv_state;
+
+ /* Initialize LightstatusBrake state */
+ stm_lbs_initialize();
+ stm_lbs_initialize_variable();
+
+ /* Initialize AccelPedal state */
+ stm_aps_initialize();
+ stm_aps_initialize_variable();
+
+ /* Initialize car state */
+ stm_rns_initialize();
+ stm_rns_initialize_variable();
+
+ /* Initialize restriction mode state */
+ stm_rem_initialize();
+ stm_rem_initialize_variable();
+
+ // Initialize homecsreen layer
+ stm_hsl_initialize();
+ stm_hsl_initialize_variable();
+
+ if (isMaster)
+ {
+ // Initialize apps layer on master ecu
+ stm_master_apl_initialize();
+ stm_master_apl_initialize_valiable();
+ }
+ else
+ {
+ // Initialize apps layer
+ stm_apl_initialize();
+ stm_apl_initialize_variable();
+ }
+
+ // Initialize near_homecsreen layer
+ stm_nhl_initialize();
+ stm_nhl_initialize_variable();
+
+ /* Initialize restriction layer */
+ stm_rel_initialize();
+ stm_rel_initialize_variable();
+
+ if (isMaster)
+ {
+ // Initialize remote layer on master ecu
+ stm_mst_rmt_initialize();
+ stm_mst_rmt_initialize_valiable();
+ }
+
+ g_stm_map_is_activated = STM_FALSE;
+}
+
+/**
+ * Transition State
+ */
+int stmTransitionStateInner(int event_id, StmState* state) {
+ g_stm_event = STM_GET_EVENT_FROM_ID(event_id);
+ g_stm_category = STM_GET_CATEGORY_FROM_ID(event_id);
+ g_stm_area = STM_GET_AREA_FROM_ID(event_id);
+
+ // LightstatusBrake state
+ stm_lbs_event_call();
+
+ // AccelPedal state
+ stm_aps_event_call();
+
+ // Car state
+ stm_rns_event_call();
+
+ // restriction mode
+ stm_rem_event_call();
+
+ // homescreen layer
+ stm_hsl_event_call();
+
+ if (isMaster)
+ {
+ // apps layer on master ecu
+ stm_master_apl_event_call();
+ }
+ else
+ {
+ // apps layer
+ stm_apl_event_call();
+ }
+
+ // near_homecsreen layer
+ stm_nhl_event_call();
+
+ // restriction layer
+ stm_rel_event_call();
+
+ // on_screen layer
+ stm_osl_event_call();
+
+ if (isMaster)
+ {
+ // remote layer on master ecu
+ stm_mst_rmt_event_call();
+ }
+
+ // Copy current state for return
+ memcpy(state, &g_stm_crr_state, sizeof(g_stm_crr_state));
+
+ return 0;
+}
+
+/**
+ * Undo State
+ */
+void stmUndoStateInner() {
+ g_stm_event = StmEvtNoUndo;
+
+ if (isMaster)
+ {
+ // apps layer on master ecu
+ stm_master_apl_event_call();
+ }
+ else
+ {
+ // apps layer
+ stm_apl_event_call();
+ }
+
+ // near_homecsreen layer
+ stm_nhl_event_call();
+
+ // restriction layer
+ stm_rel_event_call();
+
+ // on_screen layer
+ stm_osl_event_call();
+
+ if (isMaster)
+ {
+ // remote layer on master ecu
+ stm_mst_rmt_event_call();
+ }
+
+ g_stm_crr_state = g_stm_prv_state;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.h
new file mode 100644
index 0000000..78c4636
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_func.h
@@ -0,0 +1,13 @@
+/************************************************************/
+/* ZST_StateTransitionor_func.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZST_STATETRANSITIONOR_FUNC_H
+#define ZHEADER_ZST_STATETRANSITIONOR_FUNC_H
+
+extern void stmInitializeInner();
+extern int stmTransitionStateInner(int event_id, StmState* state);
+extern void stmUndoStateInner();
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.c
new file mode 100644
index 0000000..a5e67ff
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.c
@@ -0,0 +1,56 @@
+/************************************************************/
+/* ZST_StateTransitionor_var.c */
+/* Function and variable source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "ZST_include.h"
+
+/*************************************************************
+ Variable definition
+*************************************************************/
+
+// Current state
+StmState g_stm_crr_state;
+
+// Previous state
+StmState g_stm_prv_state;
+
+/**
+ * g_stm_event
+ */
+int g_stm_event;
+
+/**
+ * g_stm_category
+ */
+int g_stm_category;
+
+/**
+ * g_stm_area
+ */
+int g_stm_area;
+
+/**
+ * g_stm_map_is_activated
+ */
+int g_stm_map_is_activated;
+
+/**
+ * g_prv_apps_state_car_stop
+ */
+int g_prv_apps_state_car_stop;
+
+/**
+ * g_prv_near_homescreen_state_car_stop
+ */
+int g_prv_near_homescreen_state_car_stop;
+
+/**
+ * g_prv_restriction_state_car_stop
+ */
+int g_prv_restriction_state_car_stop;
+
+/**
+ * g_prv_on_screen_state_car_stop
+ */
+int g_prv_on_screen_state_car_stop;
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.h
new file mode 100644
index 0000000..4cabced
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_StateTransitionor_var.h
@@ -0,0 +1,20 @@
+/************************************************************/
+/* ZST_StateTransitionor_var.h */
+/* Function and variable header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZST_STATETRANSITIONOR_VAR_H
+#define ZHEADER_ZST_STATETRANSITIONOR_VAR_H
+
+extern StmState g_stm_crr_state;
+extern StmState g_stm_prv_state;
+extern int g_stm_event;
+extern int g_stm_category;
+extern int g_stm_area;
+extern int g_stm_map_is_activated;
+extern int g_prv_apps_state_car_stop;
+extern int g_prv_near_homescreen_state_car_stop;
+extern int g_prv_restriction_state_car_stop;
+extern int g_prv_on_screen_state_car_stop;
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_include.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_include.h
new file mode 100644
index 0000000..2158660
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/ZST_include.h
@@ -0,0 +1,39 @@
+/************************************************************/
+/* ZST_include.h */
+/* Functional block ST include file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+
+#ifndef ZHEADER_ZST_INCLUDE_H
+#define ZHEADER_ZST_INCLUDE_H
+
+#include "../Common/ZCommonInclude.h"
+#include "../Common/MisraCType.h"
+#include "../Common/Event.h"
+#include "ZST_StateTransitionor_def.h"
+#include "master/layer/apps/Zmaster_apps_master_apps_def.h"
+#include "master/layer/remote/Zmaster_remote_master_remote_def.h"
+#include "ZST_StateTransitionor_func.h"
+#include "ZST_StateTransitionor_var.h"
+#include "AppsLayer/ZAPL_Apps_func.h"
+#include "OnScreenlayer/ZOSL_OnScreen_func.h"
+#include "HomeScreenLayer/ZHSL_HomeScreen_func.h"
+#include "RestrictionLayer/ZREL_Restriction_func.h"
+#include "RestrictionMode/ZREM_RestrictionMode_func.h"
+#include "NearHomeScreen/ZNHL_NearHomeScreen_func.h"
+#include "AccelPedal/ZACCEL_AccelPedalState_func.h"
+#include "CarState/ZCAR_CarState_func.h"
+#include "LightStatusBrake/ZLIGHT_LightstatusBrakeStatus_func.h"
+#include "master/layer/apps/Zmaster_apps_apps_main.h"
+#include "master/layer/remote/Zmaster_remote_remote.h"
+#include "AppsLayer/ZAPL_AppsLayer.h"
+#include "OnScreenlayer/ZOSL_OslMain.h"
+#include "HomeScreenLayer/ZHSL_HomeScreen.h"
+#include "RestrictionLayer/ZREL_RelMain.h"
+#include "RestrictionMode/ZREM_RestrictionMode.h"
+#include "NearHomeScreen/ZNHL_NearHomescreen.h"
+#include "AccelPedal/ZACCEL_AccelPedal.h"
+#include "CarState/ZCAR_CarState.h"
+#include "LightStatusBrake/ZLIGHT_LightstatusBrake.h"
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.c
new file mode 100644
index 0000000..af46ea9
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.c
@@ -0,0 +1,1456 @@
+/************************************************************/
+/* Zmaster_apps_apps_main.c */
+/* apps_main State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../../../ZST_include.h"
+
+/* State management variable */
+static uint8_t Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINSTATENOMAX];
+
+static void Zmaster_apps_apps_mains0StateEntry( void );
+static void Zmaster_apps_apps_mains1StateEntry( void );
+static void Zmaster_apps_apps_mains0e1( void );
+static void Zmaster_apps_apps_mains1e0( void );
+static void Zmaster_apps_apps_car_stops0e0( void );
+static void Zmaster_apps_apps_car_stops0e2( void );
+static void Zmaster_apps_apps_car_stops0e3( void );
+static void Zmaster_apps_apps_car_stops0e4( void );
+static void Zmaster_apps_apps_car_stops0e11( void );
+static void Zmaster_apps_apps_car_stops0e15( void );
+static void Zmaster_apps_apps_car_runs0e0( void );
+static void Zmaster_apps_apps_car_runs0e3( void );
+static void Zmaster_apps_apps_mains0Event( void );
+static void Zmaster_apps_apps_car_stops0Event( void );
+static void Zmaster_apps_apps_car_stops1Event( void );
+static void Zmaster_apps_apps_car_stops2Event( void );
+static void Zmaster_apps_apps_car_stops3Event( void );
+static void Zmaster_apps_apps_car_stops4Event( void );
+static void Zmaster_apps_apps_car_stops5Event( void );
+static void Zmaster_apps_apps_mains1Event( void );
+static void Zmaster_apps_apps_car_runs0Event( void );
+static void Zmaster_apps_apps_car_runs1Event( void );
+
+/****************************************/
+/* State start activity function */
+/* STM : apps_main */
+/* State : lightstatus_brake_on( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_mains0StateEntry( void )
+{
+ switch( Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] )
+ {
+ case ZMASTER_APPS_APPS_CAR_STOPS0:
+ stm_mst_apl_start_activity_none();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS1:
+ stm_mst_apl_start_activity_meter_receiver();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS2:
+ stm_mst_apl_start_activity_meter_splitable();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS3:
+ stm_mst_apl_start_activity_splitable_receiver();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS4:
+ stm_mst_apl_start_activity_splitable_split();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS5:
+ stm_mst_apl_start_activity_general();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* State start activity function */
+/* STM : apps_main */
+/* State : lightstatus_brake_off( No 1 ) */
+/****************************************/
+static void Zmaster_apps_apps_mains1StateEntry( void )
+{
+ switch( Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS1F] )
+ {
+ case ZMASTER_APPS_APPS_CAR_RUNS0:
+ stm_mst_apl_start_activity_meter_receiver();
+ break;
+ case ZMASTER_APPS_APPS_CAR_RUNS1:
+ stm_mst_apl_start_activity_meter();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_main */
+/* State : lightstatus_brake_on( No 0 ) */
+/* Event : stt_lightstatus_brake_off( No 1 ) */
+/****************************************/
+static void Zmaster_apps_apps_mains0e1( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAIN] = ( uint8_t )ZMASTER_APPS_APPS_MAINS1;
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS1F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_RUNS0;
+ Zmaster_apps_apps_mains1StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_main */
+/* State : lightstatus_brake_off( No 1 ) */
+/* Event : stt_lightstatus_brake_on( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_mains1e0( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAIN] = ( uint8_t )ZMASTER_APPS_APPS_MAINS0;
+ Zmaster_apps_apps_mains0StateEntry();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/* Event : ara_split_main( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0e0( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS1;
+ stm_mst_apl_start_activity_meter_receiver();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/* Event : ara_split_main( No 2 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0e2( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS3;
+ stm_mst_apl_start_activity_splitable_receiver();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/* Event : ara_split_sub( No 3 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0e3( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS2;
+ stm_mst_apl_start_activity_meter_splitable();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/* Event : ara_normal( No 4 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0e4( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS5;
+ stm_mst_apl_start_activity_general();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_apps_none( No 11 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0e11( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS0;
+ stm_mst_apl_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_apps_splitable_split( No 15 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0e15( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS4;
+ stm_mst_apl_start_activity_splitable_split();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_run */
+/* State : meter_receiver( No 0 ) */
+/* Event : ara_normal( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_runs0e0( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS1F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_RUNS1;
+ stm_mst_apl_start_activity_meter();
+}
+
+/****************************************/
+/* Action function */
+/* STM : apps_car_run */
+/* State : meter_receiver( No 0 ) */
+/* Event : stt_prv_layer_apps_meter_receiver( No 3 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_runs0e3( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS1F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_RUNS0;
+ stm_mst_apl_start_activity_meter_receiver();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_main */
+/* State : lightstatus_brake_on( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_mains0Event( void )
+{
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ stm_mst_apl_event_lightstatus_brake_off();
+ Zmaster_apps_apps_mains0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_stop */
+/* State : none( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops0Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_receiver*/
+ else if( g_stm_category == StmCtgNoReceiver )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_main*/
+ else if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*stt_prv_layer_apps_meter_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ /*stt_prv_layer_apps_meter_splitable*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrSpl )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ /*stt_prv_layer_apps_splitable_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplRcv )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ /*stt_prv_layer_apps_splitable_split*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_stop */
+/* State : meter_receiver( No 1 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops1Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_splitable_main*/
+ if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*ctg_receiver*/
+ else if( g_stm_category == StmCtgNoReceiver )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*stt_prv_layer_apps_meter_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ /*stt_prv_layer_apps_meter_splitable*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrSpl )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ /*stt_prv_layer_apps_splitable_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplRcv )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ /*stt_prv_layer_apps_splitable_split*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_stop */
+/* State : meter_splitable( No 2 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops2Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_receiver*/
+ if( g_stm_category == StmCtgNoReceiver )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_main*/
+ else if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*stt_prv_layer_apps_meter_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ /*stt_prv_layer_apps_meter_splitable*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrSpl )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ /*stt_prv_layer_apps_splitable_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplRcv )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ /*stt_prv_layer_apps_splitable_split*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_stop */
+/* State : splitable_receiver( No 3 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops3Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_main*/
+ else if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_receiver*/
+ if( g_stm_category == StmCtgNoReceiver )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*ctg_splitable_main*/
+ else if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*stt_prv_layer_apps_meter_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ /*stt_prv_layer_apps_meter_splitable*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrSpl )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ /*stt_prv_layer_apps_splitable_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplRcv )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ /*stt_prv_layer_apps_splitable_split*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_stop */
+/* State : splitable_split( No 4 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops4Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_receiver*/
+ else if( g_stm_category == StmCtgNoReceiver )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_main*/
+ else if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_splitable_main*/
+ if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*stt_prv_layer_apps_meter_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ /*stt_prv_layer_apps_meter_splitable*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrSpl )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ /*stt_prv_layer_apps_splitable_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplRcv )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ /*stt_prv_layer_apps_splitable_split*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_stop */
+/* State : general( No 5 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_stops5Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_receiver*/
+ else if( g_stm_category == StmCtgNoReceiver )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_main*/
+ else if( g_stm_category == StmCtgNoSplitableMain )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_splitable_sub*/
+ else if( g_stm_category == StmCtgNoSplitableSub )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_general*/
+ else if( g_stm_category == StmCtgNoGeneral )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_homescreen*/
+ else if( g_stm_category == StmCtgNoHomescreen )
+ {
+ /*ara_fullscreen*/
+ if( g_stm_area == StmAreaNoFullscreen )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_deactivate*/
+ else if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_general*/
+ if( g_stm_category == StmCtgNoGeneral )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_none*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoNone )
+ {
+ Zmaster_apps_apps_car_stops0e11();
+ }
+ /*stt_prv_layer_apps_meter_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_stops0e0();
+ }
+ /*stt_prv_layer_apps_meter_splitable*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrSpl )
+ {
+ Zmaster_apps_apps_car_stops0e3();
+ }
+ /*stt_prv_layer_apps_splitable_receiver*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplRcv )
+ {
+ Zmaster_apps_apps_car_stops0e2();
+ }
+ /*stt_prv_layer_apps_splitable_split*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoSplSpl )
+ {
+ Zmaster_apps_apps_car_stops0e15();
+ }
+ /*stt_prv_layer_apps_gen_nml*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoGenNml )
+ {
+ Zmaster_apps_apps_car_stops0e4();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_main */
+/* State : lightstatus_brake_off( No 1 ) */
+/****************************************/
+static void Zmaster_apps_apps_mains1Event( void )
+{
+ /*stt_lightstatus_brake_on*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOn )
+ {
+ stm_mst_apl_event_lightstatus_brake_on();
+ Zmaster_apps_apps_mains1e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_run */
+/* State : meter_receiver( No 0 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_runs0Event( void )
+{
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ /*ara_normal*/
+ if( g_stm_area == StmAreaNoNormal )
+ {
+ Zmaster_apps_apps_car_runs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_meter_receiver*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_runs0e3();
+ }
+ /*stt_prv_layer_apps_meter*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrNml )
+ {
+ Zmaster_apps_apps_car_runs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : apps_car_run */
+/* State : meter( No 1 ) */
+/****************************************/
+static void Zmaster_apps_apps_car_runs1Event( void )
+{
+ /*stt_lightstatus_brake_off*/
+ if( g_stm_crr_state.car_element[StmCarElementNoLightstatusBrake].state == StmLightstatusBrakeSttNoOff )
+ {
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_meter*/
+ if( g_stm_category == StmCtgNoMeter )
+ {
+ /*ara_split_main*/
+ if( g_stm_area == StmAreaNoSplitMain )
+ {
+ Zmaster_apps_apps_car_runs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*ctg_receiver*/
+ else if( g_stm_category == StmCtgNoReceiver )
+ {
+ /*ara_split_sub*/
+ if( g_stm_area == StmAreaNoSplitSub )
+ {
+ Zmaster_apps_apps_car_runs0e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_apps_meter_receiver*/
+ if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrRcv )
+ {
+ Zmaster_apps_apps_car_runs0e3();
+ }
+ /*stt_prv_layer_apps_meter*/
+ else if( g_stm_prv_state.layer[StmLayerNoApps].state == StmLayoutNoMtrNml )
+ {
+ Zmaster_apps_apps_car_runs0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : apps_main */
+/****************************************/
+void stm_master_apl_event_call( void )
+{
+ stm_mst_apl_start_stm();
+ switch( Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAIN] )
+ {
+ case ZMASTER_APPS_APPS_MAINS0:
+ switch( Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] )
+ {
+ case ZMASTER_APPS_APPS_CAR_STOPS0:
+ Zmaster_apps_apps_car_stops0Event();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS1:
+ Zmaster_apps_apps_car_stops1Event();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS2:
+ Zmaster_apps_apps_car_stops2Event();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS3:
+ Zmaster_apps_apps_car_stops3Event();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS4:
+ Zmaster_apps_apps_car_stops4Event();
+ break;
+ case ZMASTER_APPS_APPS_CAR_STOPS5:
+ Zmaster_apps_apps_car_stops5Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ Zmaster_apps_apps_mains0Event();
+ break;
+ case ZMASTER_APPS_APPS_MAINS1:
+ switch( Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS1F] )
+ {
+ case ZMASTER_APPS_APPS_CAR_RUNS0:
+ Zmaster_apps_apps_car_runs0Event();
+ break;
+ case ZMASTER_APPS_APPS_CAR_RUNS1:
+ Zmaster_apps_apps_car_runs1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+ Zmaster_apps_apps_mains1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : apps_main */
+/****************************************/
+void stm_master_apl_initialize( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAIN] = ( uint8_t )ZMASTER_APPS_APPS_MAINS0;
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS0F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_STOPS0;
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAINS1F] = ( uint8_t )ZMASTER_APPS_APPS_CAR_RUNS0;
+ Zmaster_apps_apps_mains0StateEntry();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : apps_main */
+/****************************************/
+void Zmaster_apps_apps_mainTerminate( void )
+{
+ Zmaster_apps_apps_mainState[ZMASTER_APPS_APPS_MAIN] = ( uint8_t )ZMASTER_APPS_APPS_MAINTERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.h
new file mode 100644
index 0000000..afa2e67
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_apps_main.h
@@ -0,0 +1,111 @@
+/************************************************************/
+/* Zmaster_apps_apps_main.h */
+/* apps_main State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZMASTER_APPS_APPS_MAIN_H
+#define ZHEADER_ZMASTER_APPS_APPS_MAIN_H
+
+/*State management variable access define*/
+#define ZMASTER_APPS_APPS_MAIN ( 0U )
+#define ZMASTER_APPS_APPS_MAINS0F ( 1U )
+#define ZMASTER_APPS_APPS_MAINS1F ( 2U )
+#define ZMASTER_APPS_APPS_MAINS0 ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPS0 ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPS1 ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPS2 ( 2U )
+#define ZMASTER_APPS_APPS_CAR_STOPS3 ( 3U )
+#define ZMASTER_APPS_APPS_CAR_STOPS4 ( 4U )
+#define ZMASTER_APPS_APPS_CAR_STOPS5 ( 5U )
+#define ZMASTER_APPS_APPS_MAINS1 ( 1U )
+#define ZMASTER_APPS_APPS_CAR_RUNS0 ( 0U )
+#define ZMASTER_APPS_APPS_CAR_RUNS1 ( 1U )
+#define ZMASTER_APPS_APPS_MAINSTATENOMAX ( 3U )
+
+/*End state define*/
+#define ZMASTER_APPS_APPS_MAINEND ( 6U )
+/*Terminate state define*/
+#define ZMASTER_APPS_APPS_MAINTERMINATE ( ZMASTER_APPS_APPS_MAINEND + 1U )
+
+/*State no define*/
+#define ZMASTER_APPS_APPS_MAINS0STATENO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPS0STATENO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPS1STATENO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPS2STATENO ( 2U )
+#define ZMASTER_APPS_APPS_CAR_STOPS3STATENO ( 3U )
+#define ZMASTER_APPS_APPS_CAR_STOPS4STATENO ( 4U )
+#define ZMASTER_APPS_APPS_CAR_STOPS5STATENO ( 5U )
+#define ZMASTER_APPS_APPS_MAINS1STATENO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_RUNS0STATENO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_RUNS1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZMASTER_APPS_APPS_MAINS0STATESERIALNO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPS0STATESERIALNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPS1STATESERIALNO ( 2U )
+#define ZMASTER_APPS_APPS_CAR_STOPS2STATESERIALNO ( 3U )
+#define ZMASTER_APPS_APPS_CAR_STOPS3STATESERIALNO ( 4U )
+#define ZMASTER_APPS_APPS_CAR_STOPS4STATESERIALNO ( 5U )
+#define ZMASTER_APPS_APPS_CAR_STOPS5STATESERIALNO ( 6U )
+#define ZMASTER_APPS_APPS_MAINS1STATESERIALNO ( 7U )
+#define ZMASTER_APPS_APPS_CAR_RUNS0STATESERIALNO ( 8U )
+#define ZMASTER_APPS_APPS_CAR_RUNS1STATESERIALNO ( 9U )
+
+/*Event no define*/
+#define ZMASTER_APPS_APPS_MAINE0EVENTNO ( 0U )
+#define ZMASTER_APPS_APPS_MAINE1EVENTNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPE0EVENTNO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPE1EVENTNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPE2EVENTNO ( 2U )
+#define ZMASTER_APPS_APPS_CAR_STOPE3EVENTNO ( 3U )
+#define ZMASTER_APPS_APPS_CAR_STOPE4EVENTNO ( 4U )
+#define ZMASTER_APPS_APPS_CAR_STOPE5EVENTNO ( 5U )
+#define ZMASTER_APPS_APPS_CAR_STOPE6EVENTNO ( 6U )
+#define ZMASTER_APPS_APPS_CAR_STOPE7EVENTNO ( 7U )
+#define ZMASTER_APPS_APPS_CAR_STOPE8EVENTNO ( 8U )
+#define ZMASTER_APPS_APPS_CAR_STOPE9EVENTNO ( 9U )
+#define ZMASTER_APPS_APPS_CAR_STOPE10EVENTNO ( 10U )
+#define ZMASTER_APPS_APPS_CAR_STOPE11EVENTNO ( 11U )
+#define ZMASTER_APPS_APPS_CAR_STOPE12EVENTNO ( 12U )
+#define ZMASTER_APPS_APPS_CAR_STOPE13EVENTNO ( 13U )
+#define ZMASTER_APPS_APPS_CAR_STOPE14EVENTNO ( 14U )
+#define ZMASTER_APPS_APPS_CAR_STOPE15EVENTNO ( 15U )
+#define ZMASTER_APPS_APPS_CAR_STOPE16EVENTNO ( 16U )
+#define ZMASTER_APPS_APPS_CAR_RUNE0EVENTNO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_RUNE1EVENTNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_RUNE2EVENTNO ( 2U )
+#define ZMASTER_APPS_APPS_CAR_RUNE3EVENTNO ( 3U )
+#define ZMASTER_APPS_APPS_CAR_RUNE4EVENTNO ( 4U )
+
+/*Event serial no define*/
+#define ZMASTER_APPS_APPS_MAINE0EVENTSERIALNO ( 0U )
+#define ZMASTER_APPS_APPS_MAINE1EVENTSERIALNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPE0EVENTNO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_STOPE1EVENTNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_STOPE2EVENTNO ( 2U )
+#define ZMASTER_APPS_APPS_CAR_STOPE3EVENTNO ( 3U )
+#define ZMASTER_APPS_APPS_CAR_STOPE4EVENTNO ( 4U )
+#define ZMASTER_APPS_APPS_CAR_STOPE5EVENTNO ( 5U )
+#define ZMASTER_APPS_APPS_CAR_STOPE6EVENTNO ( 6U )
+#define ZMASTER_APPS_APPS_CAR_STOPE7EVENTNO ( 7U )
+#define ZMASTER_APPS_APPS_CAR_STOPE8EVENTNO ( 8U )
+#define ZMASTER_APPS_APPS_CAR_STOPE9EVENTNO ( 9U )
+#define ZMASTER_APPS_APPS_CAR_STOPE10EVENTNO ( 10U )
+#define ZMASTER_APPS_APPS_CAR_STOPE11EVENTNO ( 11U )
+#define ZMASTER_APPS_APPS_CAR_STOPE12EVENTNO ( 12U )
+#define ZMASTER_APPS_APPS_CAR_STOPE13EVENTNO ( 13U )
+#define ZMASTER_APPS_APPS_CAR_STOPE14EVENTNO ( 14U )
+#define ZMASTER_APPS_APPS_CAR_STOPE15EVENTNO ( 15U )
+#define ZMASTER_APPS_APPS_CAR_STOPE16EVENTNO ( 16U )
+#define ZMASTER_APPS_APPS_CAR_RUNE0EVENTNO ( 0U )
+#define ZMASTER_APPS_APPS_CAR_RUNE1EVENTNO ( 1U )
+#define ZMASTER_APPS_APPS_CAR_RUNE2EVENTNO ( 2U )
+#define ZMASTER_APPS_APPS_CAR_RUNE3EVENTNO ( 3U )
+#define ZMASTER_APPS_APPS_CAR_RUNE4EVENTNO ( 4U )
+
+/*Extern function*/
+extern void stm_master_apl_event_call( void );
+extern void stm_master_apl_initialize( void );
+extern void Zmaster_apps_apps_mainTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_master_apps_def.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_master_apps_def.h
new file mode 100644
index 0000000..5c22ae6
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/apps/Zmaster_apps_master_apps_def.h
@@ -0,0 +1,15 @@
+/************************************************************/
+/* Zmaster_apps_master_apps_def.h */
+/* Define header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZMASTER_APPS_MASTER_APPS_DEF_H
+#define ZHEADER_ZMASTER_APPS_MASTER_APPS_DEF_H
+
+/*************************************************************
+ Define definition
+*************************************************************/
+
+#include "../../../../stm_master_apps.h"
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_master_remote_def.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_master_remote_def.h
new file mode 100644
index 0000000..7cd92cd
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_master_remote_def.h
@@ -0,0 +1,15 @@
+/************************************************************/
+/* Zmaster_remote_master_remote_def.h */
+/* Define header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZMASTER_REMOTE_MASTER_REMOTE_DEF_H
+#define ZHEADER_ZMASTER_REMOTE_MASTER_REMOTE_DEF_H
+
+/*************************************************************
+ Define definition
+*************************************************************/
+
+#include "../../../../stm_master_remote.h"
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.c
new file mode 100644
index 0000000..53ceafa
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.c
@@ -0,0 +1,206 @@
+/************************************************************/
+/* Zmaster_remote_remote.c */
+/* remote State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../../../ZST_include.h"
+
+/* State management variable */
+static uint8_t Zmaster_remote_remoteState[ZMASTER_REMOTE_REMOTESTATENOMAX];
+
+static void Zmaster_remote_remotes0e0( void );
+static void Zmaster_remote_remotes0e2( void );
+static void Zmaster_remote_remotes1e1( void );
+static void Zmaster_remote_remotes1e3( void );
+static void Zmaster_remote_remotes0Event( void );
+static void Zmaster_remote_remotes1Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : remote */
+/* State : none( No 0 ) */
+/* Event : ara_master_split_sub( No 0 ) */
+/****************************************/
+static void Zmaster_remote_remotes0e0( void )
+{
+ Zmaster_remote_remoteState[ZMASTER_REMOTE_REMOTE] = ( uint8_t )ZMASTER_REMOTE_REMOTES1;
+ stm_mst_rmt_start_activity_tbt();
+}
+
+/****************************************/
+/* Action function */
+/* STM : remote */
+/* State : none( No 0 ) */
+/* Event : stt_prv_layer_remote_none( No 2 ) */
+/****************************************/
+static void Zmaster_remote_remotes0e2( void )
+{
+ stm_mst_rmt_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : remote */
+/* State : tbt( No 1 ) */
+/* Event : ctg_tbt( No 1 ) */
+/****************************************/
+static void Zmaster_remote_remotes1e1( void )
+{
+ Zmaster_remote_remoteState[ZMASTER_REMOTE_REMOTE] = ( uint8_t )ZMASTER_REMOTE_REMOTES0;
+ stm_mst_rmt_start_activity_none();
+}
+
+/****************************************/
+/* Action function */
+/* STM : remote */
+/* State : tbt( No 1 ) */
+/* Event : stt_prv_layer_remote_tbt( No 3 ) */
+/****************************************/
+static void Zmaster_remote_remotes1e3( void )
+{
+ stm_mst_rmt_start_activity_tbt();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : remote */
+/* State : none( No 0 ) */
+/****************************************/
+static void Zmaster_remote_remotes0Event( void )
+{
+ /*evt_activate*/
+ if( g_stm_event == StmEvtNoActivate )
+ {
+ /*ctg_tbt*/
+ if( g_stm_category == StmCtgNoTbt )
+ {
+ /*ara_master_split_sub*/
+ if( g_stm_area == StmAreaNoMasterSplitSub )
+ {
+ Zmaster_remote_remotes0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_remote_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRemote].state == StmLayoutNoNone )
+ {
+ Zmaster_remote_remotes0e2();
+ }
+ /*stt_prv_layer_remote_tbt*/
+ else if( g_stm_prv_state.layer[StmLayerNoRemote].state == StmLayoutNoRmtTbt )
+ {
+ Zmaster_remote_remotes0e0();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : remote */
+/* State : tbt( No 1 ) */
+/****************************************/
+static void Zmaster_remote_remotes1Event( void )
+{
+ /*evt_deactivate*/
+ if( g_stm_event == StmEvtNoDeactivate )
+ {
+ /*ctg_tbt*/
+ if( g_stm_category == StmCtgNoTbt )
+ {
+ Zmaster_remote_remotes1e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ /*evt_undo*/
+ else if( g_stm_event == StmEvtNoUndo )
+ {
+ /*stt_prv_layer_remote_none*/
+ if( g_stm_prv_state.layer[StmLayerNoRemote].state == StmLayoutNoNone )
+ {
+ Zmaster_remote_remotes1e1();
+ }
+ /*stt_prv_layer_remote_tbt*/
+ else if( g_stm_prv_state.layer[StmLayerNoRemote].state == StmLayoutNoRmtTbt )
+ {
+ Zmaster_remote_remotes1e3();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : remote */
+/****************************************/
+void stm_mst_rmt_event_call( void )
+{
+ stm_mst_rmt_start_stm();
+ switch( Zmaster_remote_remoteState[ZMASTER_REMOTE_REMOTE] )
+ {
+ case ZMASTER_REMOTE_REMOTES0:
+ Zmaster_remote_remotes0Event();
+ break;
+ case ZMASTER_REMOTE_REMOTES1:
+ Zmaster_remote_remotes1Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : remote */
+/****************************************/
+void stm_mst_rmt_initialize( void )
+{
+ Zmaster_remote_remoteState[ZMASTER_REMOTE_REMOTE] = ( uint8_t )ZMASTER_REMOTE_REMOTES0;
+ stm_mst_rmt_start_activity_none();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : remote */
+/****************************************/
+void Zmaster_remote_remoteTerminate( void )
+{
+ Zmaster_remote_remoteState[ZMASTER_REMOTE_REMOTE] = ( uint8_t )ZMASTER_REMOTE_REMOTETERMINATE;
+}
+
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.h
new file mode 100644
index 0000000..5899b07
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/StateTransitionor/master/layer/remote/Zmaster_remote_remote.h
@@ -0,0 +1,45 @@
+/************************************************************/
+/* Zmaster_remote_remote.h */
+/* remote State transition model header file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#ifndef ZHEADER_ZMASTER_REMOTE_REMOTE_H
+#define ZHEADER_ZMASTER_REMOTE_REMOTE_H
+
+/*State management variable access define*/
+#define ZMASTER_REMOTE_REMOTE ( 0U )
+#define ZMASTER_REMOTE_REMOTES0 ( 0U )
+#define ZMASTER_REMOTE_REMOTES1 ( 1U )
+#define ZMASTER_REMOTE_REMOTESTATENOMAX ( 1U )
+
+/*End state define*/
+#define ZMASTER_REMOTE_REMOTEEND ( 2U )
+/*Terminate state define*/
+#define ZMASTER_REMOTE_REMOTETERMINATE ( ZMASTER_REMOTE_REMOTEEND + 1U )
+
+/*State no define*/
+#define ZMASTER_REMOTE_REMOTES0STATENO ( 0U )
+#define ZMASTER_REMOTE_REMOTES1STATENO ( 1U )
+
+/*State serial no define*/
+#define ZMASTER_REMOTE_REMOTES0STATESERIALNO ( 0U )
+#define ZMASTER_REMOTE_REMOTES1STATESERIALNO ( 1U )
+
+/*Event no define*/
+#define ZMASTER_REMOTE_REMOTEE0EVENTNO ( 0U )
+#define ZMASTER_REMOTE_REMOTEE1EVENTNO ( 1U )
+#define ZMASTER_REMOTE_REMOTEE2EVENTNO ( 2U )
+#define ZMASTER_REMOTE_REMOTEE3EVENTNO ( 3U )
+
+/*Event serial no define*/
+#define ZMASTER_REMOTE_REMOTEE0EVENTSERIALNO ( 0U )
+#define ZMASTER_REMOTE_REMOTEE1EVENTSERIALNO ( 1U )
+#define ZMASTER_REMOTE_REMOTEE2EVENTSERIALNO ( 2U )
+#define ZMASTER_REMOTE_REMOTEE3EVENTSERIALNO ( 3U )
+
+/*Extern function*/
+extern void stm_mst_rmt_event_call( void );
+extern void stm_mst_rmt_initialize( void );
+extern void Zmaster_remote_remoteTerminate( void );
+
+#endif
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_inner.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_inner.h
new file mode 100644
index 0000000..5097fcf
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_inner.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TMCAGLWM_STM_INNER_HPP
+#define TMCAGLWM_STM_INNER_HPP
+
+#include "StateTransitionor/ZST_StateTransitionor_func.h"
+
+#endif // TMCAGLWM_STM_INNER_HPP
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.c
new file mode 100644
index 0000000..a8cc0e2
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.c
@@ -0,0 +1,63 @@
+#include "./StateTransitionor/ZST_include.h"
+
+void stm_mst_apl_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_start_activity_meter_receiver() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMtrRcv;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_start_activity_meter_splitable() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMtrSpl;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_start_activity_splitable_receiver() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoSplRcv;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_start_activity_splitable_split() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoSplSpl;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_start_activity_general() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoGenNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_start_activity_meter() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoMtrNml;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_event_lightstatus_brake_on() {
+ g_stm_crr_state.layer[StmLayerNoApps].state = g_prv_apps_state_car_stop;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_TRUE;
+}
+
+void stm_mst_apl_event_lightstatus_brake_off() {
+ g_prv_apps_state_car_stop = g_stm_prv_state.layer[StmLayerNoApps].state;
+}
+
+void stm_master_apl_initialize_valiable() {
+ g_stm_prv_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoApps].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoApps].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_FALSE;
+}
+
+void stm_mst_apl_start_stm() {
+ if (g_stm_event == StmEvtNoUndo) {
+ // nop
+ }
+ else {
+ g_stm_prv_state.layer[StmLayerNoApps].state = g_stm_crr_state.layer[StmLayerNoApps].state;
+ }
+ g_stm_crr_state.layer[StmLayerNoApps].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.h
new file mode 100644
index 0000000..d10e56b
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_apps.h
@@ -0,0 +1,11 @@
+extern void stm_mst_apl_start_activity_none();
+extern void stm_mst_apl_start_activity_meter_receiver();
+extern void stm_mst_apl_start_activity_meter_splitable();
+extern void stm_mst_apl_start_activity_splitable_receiver();
+extern void stm_mst_apl_start_activity_splitable_split();
+extern void stm_mst_apl_start_activity_general();
+extern void stm_mst_apl_start_activity_meter();
+extern void stm_mst_apl_event_lightstatus_brake_on();
+extern void stm_mst_apl_event_lightstatus_brake_off();
+extern void stm_master_apl_initialize_valiable();
+extern void stm_mst_apl_start_stm();
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.c b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.c
new file mode 100644
index 0000000..d63cba1
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.c
@@ -0,0 +1,29 @@
+#include "./StateTransitionor/ZST_include.h"
+
+void stm_mst_rmt_start_activity_none() {
+ g_stm_crr_state.layer[StmLayerNoRemote].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_TRUE;
+}
+
+void stm_mst_rmt_start_activity_tbt() {
+ g_stm_crr_state.layer[StmLayerNoRemote].state = StmLayoutNoRmtTbt;
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_TRUE;
+}
+
+void stm_mst_rmt_initialize_valiable() {
+ g_stm_prv_state.layer[StmLayerNoRemote].state = StmLayoutNoNone;
+ g_stm_prv_state.layer[StmLayerNoRemote].changed = STM_FALSE;
+
+ g_stm_crr_state.layer[StmLayerNoRemote].state = StmLayoutNoNone;
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_FALSE;
+}
+
+void stm_mst_rmt_start_stm() {
+ if (g_stm_event == StmEvtNoUndo) {
+ // nop
+ }
+ else {
+ g_stm_prv_state.layer[StmLayerNoRemote].state = g_stm_crr_state.layer[StmLayerNoRemote].state;
+ }
+ g_stm_crr_state.layer[StmLayerNoRemote].changed = STM_FALSE;
+}
diff --git a/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.h b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.h
new file mode 100644
index 0000000..45d77c7
--- /dev/null
+++ b/demo3/common/agl-service-windowmanager/policy_manager/stm/zipc/stm_master_remote.h
@@ -0,0 +1,4 @@
+extern void stm_mst_rmt_start_activity_none();
+extern void stm_mst_rmt_start_activity_tbt();
+extern void stm_mst_rmt_initialize_valiable();
+extern void stm_mst_rmt_start_stm();