Enable fallback, then display applications 93/13593/3 5.99.1 flounder/5.99.1 flounder_5.99.1
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Fri, 9 Mar 2018 04:45:36 +0000 (13:45 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Fri, 9 Mar 2018 05:49:24 +0000 (14:49 +0900)
This patch enables the app to show if it is not registered in layers.json.
The original installed app was not shown because the role of app is not
registered in WM as default.

[Patch set2]
Add the same process into requestSurface for RunXDG

Bug-AGL : SPEC-1331

Change-Id: Ie99b971023a95a1924795b1ffc7311a630940b1d
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
layers.json
layers.json.split
src/app.cpp

index 8a04d7b..cf7ed34 100644 (file)
@@ -22,7 +22,7 @@
          "comment": "Single layer map for the HomeScreen"
       },
       {
-         "role": "Music|Video|WebBrowser|MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer",
+         "role": "Music|Video|WebBrowser|MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer|Fallback",
          "name": "apps",
          "layer_id": 1001,
          "area": { "type": "rect", "rect": { "x": 0, "y": 218, "width": -1, "height": -433 } },
index 91e563d..ec20b33 100644 (file)
@@ -22,7 +22,7 @@
          "comment": "Single layer map for the HomeScreen"
       },
       {
-         "role": "Music|Video|WebBrowser|MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer",
+         "role": "Music|Video|WebBrowser|MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer|Fallback",
          "name": "apps",
          "layer_id": 1001,
          "area": { "type": "rect", "rect": { "x": 0, "y": 218, "width": -1, "height": -433 } },
index b966172..846684b 100644 (file)
@@ -701,8 +701,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);
@@ -733,7 +739,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);