aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2018-11-14 14:30:15 +0800
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-15 09:10:40 +0900
commita991ebe6fdecfddd0333d473b723c0beda5d77c9 (patch)
tree7704b6fdb8cab6dfdb0ca6a20a1b84ce71616501
parentfa700a537a584778128eac9b77f15c9818ee82dd (diff)
fix restriction issuesandbox/zheng_wenlong/ces2019
Change-Id: I05e9aa5684225921ba4c6869a00e2a203c096170
-rw-r--r--src/homescreen.cpp1
-rw-r--r--src/hs-client.cpp8
-rw-r--r--src/hs-helper.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp
index db739ee..3bcbf2c 100644
--- a/src/homescreen.cpp
+++ b/src/homescreen.cpp
@@ -31,6 +31,7 @@ const char _display_message[] = "display_message";
const char _reply_message[] = "reply_message";
const char _args[] = "args";
const char _parameter[] = "parameter";
+const char _area[] = "area";
static HS_ClientManager* g_client_manager = HS_ClientManager::instance();
diff --git a/src/hs-client.cpp b/src/hs-client.cpp
index b2f9215..c33144c 100644
--- a/src/hs-client.cpp
+++ b/src/hs-client.cpp
@@ -205,7 +205,9 @@ int HS_Client::allocateRestriction(struct afb_req request, const char* area)
struct json_object* push_obj = json_object_new_object();
hs_add_object_to_json_object_str( push_obj, 4, _application_name, "restriction",
_type, __FUNCTION__);
- json_object_object_add(push_obj, _args, json_tokener_parse(area));
+ struct json_object* area_obj;
+ json_object_object_get_ex(json_tokener_parse(area), _area, &area_obj);
+ json_object_object_add(push_obj, _area, area_obj);
afb_event_push(my_event, push_obj);
return 0;
}
@@ -229,7 +231,9 @@ int HS_Client::releaseRestriction(struct afb_req request, const char* area)
struct json_object* push_obj = json_object_new_object();
hs_add_object_to_json_object_str( push_obj, 4, _application_name, "restriction",
_type, __FUNCTION__);
- json_object_object_add(push_obj, _args, json_tokener_parse(area));
+ struct json_object* area_obj;
+ json_object_object_get_ex(json_tokener_parse(area), _area, &area_obj);
+ json_object_object_add(push_obj, _area, area_obj);
afb_event_push(my_event, push_obj);
return 0;
}
diff --git a/src/hs-helper.h b/src/hs-helper.h
index b2354e0..5cb795d 100644
--- a/src/hs-helper.h
+++ b/src/hs-helper.h
@@ -36,6 +36,7 @@ extern const char _display_message[];
extern const char _reply_message[];
extern const char _args[];
extern const char _parameter[];
+extern const char _area[];
REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id);
REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id);