Move process for deciding area when correct area is not set
authorYuta Doi <yuta-d@witz-inc.co.jp>
Fri, 22 Jun 2018 08:27:56 +0000 (17:27 +0900)
committerYuta Doi <yuta-d@witz-inc.co.jp>
Fri, 22 Jun 2018 08:27:56 +0000 (17:27 +0900)
Change-Id: I6ca3751e0a02ba62a66e770572e86da321ce2e5d
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
src/app.cpp
src/policy_manager/policy_manager.cpp
src/policy_manager/zipc/dummy_stm.c

index d7ec53d..18e722b 100644 (file)
@@ -509,39 +509,6 @@ void App::allocateWindowResource(char const *event, char const *drawing_name,
         HMI_DEBUG("wm", "new_role: %s", new_role);
     }
 
-    if (0 == strcmp("activate", event)) {
-        // TODO:
-        // This process will be removed
-        // because the area "normal.full" and "normalfull" will be prohibited
-        {
-            if (0 == strcmp("restriction", new_role)) {
-                new_area = drawing_area;
-            }
-            else {
-                if (nullptr == drawing_area) {
-                    new_area = "normal";
-                }
-                else if (0 == strcmp("normal.full", drawing_area)) {
-                    new_area = "normal";
-                }
-                else if (0 == strcmp("restriction.split.sub", drawing_area)) {
-                    new_area = "restriction.split.sub";
-                }
-                else if (0 == strcmp("homescreen", new_role)) {
-                    // Now homescreen specifies "normalfull"
-                    new_area = "fullscreen";
-                }
-                else {
-                    new_area = "normal";
-                }
-            }
-            HMI_DEBUG("wm", "drawing_area:%s, new_area: %s", drawing_area, new_area);
-        }
-    }
-    else if (0 == strcmp("deactivate", event)) {
-        new_area = "";
-    }
-
     // TODO:
     // Check role
 
index 62b73e9..ebc45a9 100644 (file)
@@ -770,13 +770,13 @@ int PolicyManager::setInputEventData(json_object* json_in) {
             area_no = this->areaname2no[area];
             HMI_DEBUG("wm:pm", "area(%s:%d)", area, area_no);
         }
-        else {
-            HMI_ERROR("wm:pm", "Invalid area name!!");
-        }
     }
-    else if (0 != strcmp("", role)) {
-        area_no = this->areaname2no[this->role2defaultarea[role]];
-        HMI_DEBUG("wm:pm", "area(%s:%d)", this->role2defaultarea[role].c_str(), area_no);
+
+    // If role is set and area is not set, use default area
+    if ((nullptr == area) && (0 != strcmp("", role))) {
+        std::string def_area = this->role2defaultarea[role];
+        area_no = this->areaname2no[def_area];
+        HMI_DEBUG("wm:pm", "area(%s:%d)", def_area.c_str(), area_no);
     }
 
     // Set event info to the queue
index c3fb1c4..83c6a6f 100644 (file)
@@ -605,6 +605,10 @@ int stmTransitionState(int event, stm_state_t* state) {
                             g_crr_state.layer[gStmLayerNoRestriction].state = gStmLayoutNoRstNml;
                             g_crr_state.layer[gStmLayerNoRestriction].changed = STM_TRUE;
                         }
+                        else if (g_crr_state.layer[gStmLayerNoApps].state == gStmLayoutNoMapSpl) {
+                            g_crr_state.layer[gStmLayerNoRestriction].state = gStmLayoutNoRstSplSub;
+                            g_crr_state.layer[gStmLayerNoRestriction].changed = STM_TRUE;
+                        }
                         break;
                     default:
                         // nop