aboutsummaryrefslogtreecommitdiffstats
path: root/src/policy_manager/policy_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/policy_manager/policy_manager.cpp')
-rw-r--r--src/policy_manager/policy_manager.cpp70
1 files changed, 36 insertions, 34 deletions
diff --git a/src/policy_manager/policy_manager.cpp b/src/policy_manager/policy_manager.cpp
index a40bb48..b790794 100644
--- a/src/policy_manager/policy_manager.cpp
+++ b/src/policy_manager/policy_manager.cpp
@@ -185,38 +185,25 @@ int PolicyManager::checkPolicy(json_object* json_in, json_object** json_out) {
json_out);
// "layers": [
- // {
- // "on_screen": {
- // "is_changed": <bool>,
- // "state": <const char*>
- // }
- // },
json_object* json_layer = json_object_new_array();
- json_object* json_tmp = json_object_new_object();
- HMI_DEBUG("wm", "on_screen state (is_changed:%d state:%d:%s)",
- crr_state.layer.on_screen.is_changed,
- crr_state.layer.on_screen.state,
- stm::gStmLayoutNo2Name[crr_state.layer.on_screen.state]);
- this->addStateToJson("on_screen",
- crr_state.layer.on_screen.is_changed,
- stm::gStmLayoutNo2Name[crr_state.layer.on_screen.state],
- &json_tmp);
- json_object_array_add(json_layer, json_tmp);
+ json_object* json_tmp;
// {
- // "restriction": {
+ // "homescreen": {
// "is_changed": <bool>,
// "state": <const char*>
// }
// },
- HMI_DEBUG("wm", "restriction state (is_changed:%d state:%d:%s)",
- crr_state.layer.restriction.is_changed,
- crr_state.layer.restriction.state,
- stm::gStmLayoutNo2Name[crr_state.layer.restriction.state]);
+ // ]
+ // }
+ HMI_DEBUG("wm", "homescreen state (is_changed:%d state:%d:%s)",
+ crr_state.layer.homescreen.is_changed,
+ crr_state.layer.homescreen.state,
+ stm::gStmLayoutNo2Name[crr_state.layer.homescreen.state]);
json_tmp = json_object_new_object();
- this->addStateToJson("restriction",
- crr_state.layer.restriction.is_changed,
- stm::gStmLayoutNo2Name[crr_state.layer.restriction.state],
+ this->addStateToJson("homescreen",
+ crr_state.layer.homescreen.is_changed,
+ stm::gStmLayoutNo2Name[crr_state.layer.homescreen.state],
&json_tmp);
json_object_array_add(json_layer, json_tmp);
@@ -238,21 +225,36 @@ int PolicyManager::checkPolicy(json_object* json_in, json_object** json_out) {
json_object_array_add(json_layer, json_tmp);
// {
- // "homescreen": {
+ // "restriction": {
// "is_changed": <bool>,
// "state": <const char*>
// }
// },
- // ]
- // }
- HMI_DEBUG("wm", "homescreen state (is_changed:%d state:%d:%s)",
- crr_state.layer.homescreen.is_changed,
- crr_state.layer.homescreen.state,
- stm::gStmLayoutNo2Name[crr_state.layer.homescreen.state]);
+ HMI_DEBUG("wm", "restriction state (is_changed:%d state:%d:%s)",
+ crr_state.layer.restriction.is_changed,
+ crr_state.layer.restriction.state,
+ stm::gStmLayoutNo2Name[crr_state.layer.restriction.state]);
json_tmp = json_object_new_object();
- this->addStateToJson("homescreen",
- crr_state.layer.homescreen.is_changed,
- stm::gStmLayoutNo2Name[crr_state.layer.homescreen.state],
+ this->addStateToJson("restriction",
+ crr_state.layer.restriction.is_changed,
+ stm::gStmLayoutNo2Name[crr_state.layer.restriction.state],
+ &json_tmp);
+ json_object_array_add(json_layer, json_tmp);
+
+ // {
+ // "on_screen": {
+ // "is_changed": <bool>,
+ // "state": <const char*>
+ // }
+ // },
+ HMI_DEBUG("wm", "on_screen state (is_changed:%d state:%d:%s)",
+ crr_state.layer.on_screen.is_changed,
+ crr_state.layer.on_screen.state,
+ stm::gStmLayoutNo2Name[crr_state.layer.on_screen.state]);
+ json_tmp = json_object_new_object();
+ this->addStateToJson("on_screen",
+ crr_state.layer.on_screen.is_changed,
+ stm::gStmLayoutNo2Name[crr_state.layer.on_screen.state],
&json_tmp);
json_object_array_add(json_layer, json_tmp);