diff options
Diffstat (limited to 'src/applist.cpp')
-rw-r--r-- | src/applist.cpp | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/applist.cpp b/src/applist.cpp index 473d687..8ef08dd 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -82,27 +82,6 @@ void AppList::addClient(const string &appid, unsigned layer, const string &role) } /** - * Add Client to the list - * - * This function is overload function. - * But this function just register application. - * So an application does not have role, surface, layer. - * Client need to register role and layer afterward. - * - * @param string[in] Application id. This will be the key to withdraw the information. - * @return None - * @attention This function should be called once for the app - * Caller should take care not to be called more than once. - */ -void AppList::addClient(const string &appid) -{ - std::lock_guard<std::mutex> lock(this->mtx); - shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, 0, ""); - this->app2client[appid] = client; - this->clientDump(); -} - -/** * Remove WMClient from the list * * @param string[in] Application id. This will be the key to withdraw the information. @@ -332,8 +311,8 @@ const vector<struct WMAction> &AppList::getActions(unsigned req_num, bool* found } HMI_SEQ_ERROR(req_num, "Couldn't get action with the request : %d", req_num); { - static vector<struct WMAction> empty; - return empty; + static vector<struct WMAction> empty; + return empty; } } @@ -402,7 +381,7 @@ WMError AppList::setAction(unsigned req_num, shared_ptr<WMClient> client, const } // If visible task is not invisible, redraw is required -> true bool edraw_f = (visible != TaskVisible::INVISIBLE) ? false : true; - WMAction action{req_num, client, role, area, visible, edraw_f}; + WMAction action{req_num, client, role, area, visible, edraw_f, TaskCarState::NO_TASK}; x.sync_draw_req.push_back(action); result = WMError::SUCCESS; @@ -438,11 +417,23 @@ bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const st { for (auto &y : x.sync_draw_req) { - if (y.client->appID() == appid && y.role == role) + if (nullptr != y.client) + { + if (y.client->appID() == appid && y.role == role) + { + HMI_SEQ_INFO(req_num, "Role %s finish redraw", y.role.c_str()); + y.end_draw_finished = true; + result = true; + } + } + else { - HMI_SEQ_INFO(req_num, "Role %s finish redraw", y.role.c_str()); - y.end_draw_finished = true; - result = true; + if (y.role == role) + { + HMI_SEQ_INFO(req_num, "Role %s finish redraw", y.role.c_str()); + y.end_draw_finished = true; + result = true; + } } } } @@ -553,7 +544,7 @@ void AppList::reqDump() { DUMP( "Action : (APPID :%s, ROLE :%s, AREA :%s, VISIBLE : %s, END_DRAW_FINISHED: %d)", - y.client->appID().c_str(), + (y.client) ? y.client->appID().c_str() : "-", y.role.c_str(), y.area.c_str(), (y.visible == TaskVisible::INVISIBLE) ? "invisible" : "visible", |