aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 0d727b6..a117848 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -338,7 +338,6 @@ void App::allocateWindowResource(char const *event, char const *drawing_name,
// Check Policy
json_object* json_in = json_object_new_object();
- json_object* json_out = json_object_new_object();
json_object_object_add(json_in, "event", json_object_new_string(event));
if (nullptr != new_role) {
@@ -348,17 +347,10 @@ void App::allocateWindowResource(char const *event, char const *drawing_name,
json_object_object_add(json_in, "area", json_object_new_string(new_area));
}
- int ret = this->pm_.checkPolicy(json_in, &json_out);
- if (0 > ret) {
- reply("Error checkPolicy()");
- return;
- }
- else {
- HMI_DEBUG("wm", "result: %s", json_object_get_string(json_out));
- }
-
- // Release json_object
- json_object_put(json_in);
+ // Input event to PolicyManager
+ this->pm_.inputEvent(json_in,
+ [this, new_role, reply] (json_object* json_out) {
+ HMI_DEBUG("wm", "role:%s", new_role);
// Check parking brake state
json_object* json_parking_brake;
@@ -517,9 +509,10 @@ void App::allocateWindowResource(char const *event, char const *drawing_name,
else {
HMI_DEBUG("wm", "All layer is NOT changed!!");
}
+});
// Release json_object
- json_object_put(json_out);
+ json_object_put(json_in);
return;
}