aboutsummaryrefslogtreecommitdiffstats
path: root/src/layout_manager
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-10 13:10:28 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-10 13:10:28 +0900
commit2ea71aa957634ce69681ae34abace0566d52b744 (patch)
treeb9d9ee097a78d3d21ee07d85193a2e2e6862fce6 /src/layout_manager
parent0dcb9ae1f99cffcafac62a324f8f054cc212a880 (diff)
Modify for restriction role
- Add policy for restriction to dummy stm. - Add the function which inputs json file because json_object_from_file can not allows up to only 4KB file. - Bug fix in json files. - Delete unexpected characters. - Delete description because it does not follow the format of json array. Change-Id: I2f8fba1d1001cf244e2531fe3a1a738d5a48091b Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/layout_manager')
-rw-r--r--src/layout_manager/db/layout.db4
-rw-r--r--src/layout_manager/layout.cpp11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/layout_manager/db/layout.db b/src/layout_manager/db/layout.db
index 0de262f..02139e6 100644
--- a/src/layout_manager/db/layout.db
+++ b/src/layout_manager/db/layout.db
@@ -1,6 +1,5 @@
{
"layouts": [
- "description": "The layout is what roles the layer has in the areas.",
{
"name": "pu",
"layer": "on_screen",
@@ -169,7 +168,7 @@
},
{
"name": "split.sub",
- "role", "general"
+ "role": "general"
}
]
},
@@ -195,7 +194,6 @@
}
],
"areas": [
- "description": "The area is in the layer. The layout attaches areas to the layer"
{
"name": "fullscreen",
"rect": {
diff --git a/src/layout_manager/layout.cpp b/src/layout_manager/layout.cpp
index 3f4013e..faab316 100644
--- a/src/layout_manager/layout.cpp
+++ b/src/layout_manager/layout.cpp
@@ -104,7 +104,7 @@ bool LayoutManager::updateLayout(json_object* obj,
json_object_object_foreach(json_tmp, key, val) {
layer = key;
json_layer = val;
- HMI_DEBUG("wm:lm", "Update %s layer state", layer);
+ HMI_DEBUG("wm:lm", "Try to update %s layer state", layer);
}
// Store previous state
@@ -253,6 +253,7 @@ bool LayoutManager::isLayoutChanged(const char* layer) {
return this->is_layout_changed_[layer];
}
+
extern const char* kDefaultLayoutDb;
int LayoutManager::loadLayoutDb() {
HMI_DEBUG("wm:lm", "Call");
@@ -270,10 +271,10 @@ int LayoutManager::loadLayoutDb() {
}
// Load layout.db
- HMI_DEBUG("wm:lm", "file_name:%s", file_name.c_str());
- json_object* json_obj = json_object_from_file(file_name.c_str());
- if (nullptr == json_obj) {
- HMI_ERROR("wm:lm", "Could not open layout.db, so use default role information");
+ json_object* json_obj;
+ int ret = jh::inputJsonFilie(file_name.c_str(), &json_obj);
+ if (0 > ret) {
+ HMI_DEBUG("wm:lm", "Could not open layout.db, so use default layout information");
json_obj = json_tokener_parse(kDefaultLayoutDb);
}
HMI_DEBUG("wm:lm", "json_obj dump:%s", json_object_get_string(json_obj));