diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-29 09:57:59 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-29 09:58:33 +0900 |
commit | 110754381795eec069eafc36db8617b0017e2f1e (patch) | |
tree | c3bab237e9d96bf437a731c2d674addcc41e8f04 /src | |
parent | 2cb77378b47dfda8032f13f1c0c66d4f389d628c (diff) |
Add request for deactivate surface
Change-Id: Ia19de946314a25fc5c71400add67c77de04d7c9d
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r-- | src/app.cpp | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp index 9e27ea8..c09081e 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -700,7 +700,8 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char bool ret = this->do_allocate_window_resource(new_req); // layer manager task - const char* msg = this->check_surface_exist(new_req, drawing_name); // this function will be integrated in do_allocate_window_resource() + // this function will be integrated in do_allocate_window_resource() + const char* msg = this->check_surface_exist(new_req, drawing_name); if(msg){ HMI_SEQ_DEBUG(new_req,"surface doesn't exist"); @@ -708,7 +709,8 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char app_list.removeRequest(new_req); return; } - this->lm_layout_change(new_req, drawing_name); // this function will be integrated in do_allocate_window_resource() + // this function will be integrated in do_allocate_window_resource() + this->lm_layout_change(new_req, drawing_name); reply(nullptr); } @@ -716,9 +718,13 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char void App::api_deactivate_surface(char const *appid, char const *drawing_name, const reply_func &reply) { ST(); - auto const &surface_id = this->lookup_id(drawing_name); + /* + * Check Phase + */ std::string id = appid; + std::string role = drawing_name; + std::string area = ""; //drawing_area; if(!app_list.contains(id)){ reply("app doesn't request 'requestSurface' yet"); @@ -726,6 +732,38 @@ void App::api_deactivate_surface(char const *appid, char const *drawing_name, co } auto client = app_list.lookUpClient(id); + /* + * Queueing Phase + */ + unsigned current = app_list.currentSequenceNumber(); + unsigned requested_num = app_list.getSequenceNumber(id); + if (requested_num != 0) + { + HMI_SEQ_INFO(requested_num, "%s %s %s request is already queued", id.c_str(), role.c_str(), area.c_str()); + reply("already requested"); + return; + } + + WMRequest req = WMRequest(id, role, area, Task::TASK_RELEASE); + unsigned new_req = app_list.addAllocateRequest(req); + app_list.req_dump(); + + HMI_SEQ_DEBUG(current, "%s start sequence with %s, %s", id.c_str(), role.c_str(), area.c_str()); + + if (new_req != current) + { + // Add request, then invoked after the previous task is finished + HMI_SEQ_DEBUG(new_req, "request is accepted"); + reply(nullptr); + return; + } + + /* + * Do allocate tasks + */ + //bool ret = this->do_allocate_window_resource(new_req); + + auto const &surface_id = this->lookup_id(drawing_name); if (!surface_id) { reply("Surface does not exist"); |