summaryrefslogtreecommitdiffstats
path: root/src/app.cpp
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-03-26 23:56:09 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2018-03-26 23:56:09 +0000
commit33ee7d8a99c540749dd9691362f109c5b884e588 (patch)
treebc7635634ba2ef2c20850ebd687ad9634d48b69e /src/app.cpp
parenta0a00ddd1a5d01566ffd145765a813814e20ae20 (diff)
parentf4226050e1c02c9f792e74b35b56bb7727d0f26d (diff)
Merge "Enable fallback, then display applications" into eeleel_5.0.2eel/5.0.25.0.2
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 8806850..e9d79f5 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -712,8 +712,14 @@ void App::emit_visible(char const *label) { return emit_visible(label, true); }
result<int> App::api_request_surface(char const *drawing_name) {
auto lid = this->layers.get_layer_id(std::string(drawing_name));
if (!lid) {
- // TODO: Do we need to put these applications on the App layer?
- return Err<int>("Drawing name does not match any role");
+ /**
+ * register drawing_name as fallback and make it displayed.
+ */
+ lid = this->layers.get_layer_id(std::string("Fallback"));
+ HMI_DEBUG("wm", "%s is not registered in layers.json, then fallback as normal app", drawing_name);
+ if(!lid){
+ return Err<int>("Drawing name does not match any role, Fallback is disabled");
+ }
}
auto rname = this->lookup_id(drawing_name);
@@ -744,7 +750,14 @@ char const *App::api_request_surface(char const *drawing_name,
unsigned sid = std::stol(ivi_id);
if (!lid) {
- return "Drawing name does not match any role";
+ /**
+ * register drawing_name as fallback and make it displayed.
+ */
+ lid = this->layers.get_layer_id(std::string("Fallback"));
+ HMI_DEBUG("wm", "%s is not registered in layers.json, then fallback as normal app", drawing_name);
+ if(!lid){
+ return "Drawing name does not match any role, Fallback is disabled";
+ }
}
auto rname = this->lookup_id(drawing_name);