Change function according to e9376b
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Sun, 10 Jun 2018 14:48:46 +0000 (23:48 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Mon, 11 Jun 2018 00:01:10 +0000 (09:01 +0900)
Change-Id: I56204f42b6b083cd2e180a4b336f876704e287aa
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/app.cpp

index 64a1835..1422750 100644 (file)
@@ -574,8 +574,15 @@ WMError App::do_transition(unsigned req_num)
     * Check Policy
     */
     // get current trigger
-    auto trigger = app_list->getRequest(req_num);
+    bool found;
     bool is_activate = true;
+    auto trigger = app_list->getRequest(req_num, &found);
+    if(!found)
+    {
+        WMError err = WMError::NO_ENTRY;
+        HMI_SEQ_ERROR(req_num, errorDescription(err));
+        return err;
+    }
 
     /*  get new status from Policy Manager
 
@@ -608,8 +615,14 @@ WMError App::do_transition(unsigned req_num)
 
     // layer manager task
     bool sync_draw_happen = false;
-    for (const auto &y : app_list->getActions(req_num))
+    for (const auto &y : app_list->getActions(req_num, &found))
     {
+        if (!found)
+        {
+            WMError err = WMError::NO_ENTRY;
+            HMI_SEQ_ERROR(req_num, "%s : Action is not set", errorDescription(err));
+            return err;
+        }
         /*
         do_task(y);
         */
@@ -873,10 +886,13 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char
     auto client = app_list->lookUpClient(id);
 
     unsigned srfc = client->surfaceID(role);
-    if(srfc != INVALID_SURFACE_ID){
-        // remove floating surface
-        app_list->removeFloatingSurface(client->surfaceID(role));
+    if(srfc == INVALID_SURFACE_ID){
+        HMI_ERROR("wm", "role should be set with surface");
+        reply("role should be set with surface");
+        return;
     }
+    app_list->removeFloatingSurface(client->surfaceID(role));
+
     /*
    * Queueing Phase
    */
@@ -1013,7 +1029,15 @@ void App::lm_enddraw(const char *drawing_name)
 void App::do_enddraw(unsigned req_num)
 {
     // get actions
-    auto actions = app_list->getActions(req_num);
+    bool found;
+    auto actions = app_list->getActions(req_num, &found);
+    if (!found)
+    {
+        WMError err = WMError::NO_ENTRY;
+        HMI_SEQ_ERROR(req_num, errorDescription(err));
+        return;
+    }
+
     HMI_SEQ_INFO(req_num, "do endDraw");
 
     for (const auto &act : actions)