2 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "window_manager.hpp"
21 #include "json_helper.hpp"
22 #include "applist.hpp"
26 #include <systemd/sd-event.h>
31 using std::unordered_map;
36 static const uint64_t kTimeOut = 3ULL; /* 3s */
38 /* DrawingArea name used by "{layout}.{area}" */
39 const char kNameLayoutNormal[] = "normal";
40 const char kNameLayoutSplit[] = "split";
41 const char kNameAreaFull[] = "full";
42 const char kNameAreaMain[] = "main";
43 const char kNameAreaSub[] = "sub";
45 /* Key for json obejct */
46 const char kKeyDrawingName[] = "drawing_name";
47 const char kKeyDrawingArea[] = "drawing_area";
48 const char kKeyDrawingRect[] = "drawing_rect";
49 const char kKeyX[] = "x";
50 const char kKeyY[] = "y";
51 const char kKeyWidth[] = "width";
52 const char kKeyHeight[] = "height";
53 const char kKeyWidthPixel[] = "width_pixel";
54 const char kKeyHeightPixel[] = "height_pixel";
55 const char kKeyWidthMm[] = "width_mm";
56 const char kKeyHeightMm[] = "height_mm";
57 const char kKeyScale[] = "scale";
58 const char kKeyIds[] = "ids";
60 static const vector<string> kListEventName{
70 static sd_event_source *g_timer_ev_src = nullptr;
71 static AppList g_app_list;
72 static WindowManager *g_context;
73 static vector<string> white_list_area_size_change = {
74 "homescreen", "settings"
80 static int processTimerHandler(sd_event_source *s, uint64_t usec, void *userdata)
82 HMI_NOTICE("Time out occurs because the client replys endDraw slow, so revert the request");
83 reinterpret_cast<wm::WindowManager *>(userdata)->timerHandler();
87 static void onStateTransitioned(vector<WMAction> actions)
89 g_context->startTransitionWrapper(actions);
94 g_context->processError(WMError::LAYOUT_CHANGE_FAIL);
101 WindowManager::WindowManager()
104 const char *path = getenv("AFM_APP_INSTALL_DIR");
107 HMI_ERROR("AFM_APP_INSTALL_DIR is not defined");
111 this->lc = std::make_shared<LayerControl>(root);
113 HMI_DEBUG("Layer Controller initialized");
116 int WindowManager::init()
118 LayerControlCallbacks lmcb;
119 lmcb.surfaceCreated = [&](unsigned pid, unsigned surface){
120 this->surface_created(surface);
122 lmcb.surfaceDestroyed = [&](unsigned surface){
123 this->surface_removed(surface);
126 if(this->lc->init(lmcb) != WMError::SUCCESS)
131 // Store my context for calling callback from PolicyManager
134 // Initialize PMWrapper
135 this->pmw.initialize();
137 // Register callback to PolicyManager
138 this->pmw.registerCallback(onStateTransitioned, onError);
140 // Make afb event for subscriber
141 for (int i = Event_ScreenUpdated; i < Event_Error; i++)
143 map_afb_event[kListEventName[i]] = afb_api_make_event(afbBindingV3root, kListEventName[i].c_str());
146 const struct rect css_bg = this->lc->getAreaSize("fullscreen");
147 Screen screen = this->lc->getScreenInfo();
148 rectangle dp_bg(screen.width(), screen.height());
150 dp_bg.set_aspect(static_cast<double>(css_bg.w) / css_bg.h);
151 dp_bg.fit(screen.width(), screen.height());
152 dp_bg.center(screen.width(), screen.height());
153 HMI_DEBUG("SCALING: CSS BG(%dx%d) -> DDP %dx%d,(%dx%d)",
154 css_bg.w, css_bg.h, dp_bg.left(), dp_bg.top(), dp_bg.width(), dp_bg.height());
156 double scale = static_cast<double>(dp_bg.height()) / css_bg.h;
157 this->lc->setupArea(dp_bg, scale);
162 result<int> WindowManager::api_request_surface(char const *appid, char const *drawing_name)
164 string str_id = appid;
165 string role = drawing_name;
168 if(!g_app_list.contains(str_id))
170 unsigned lid = this->generateLayerForClient(role);
173 return Err<int>("Designated role does not match any role, fallback is disabled");
175 // add client into the db
176 g_app_list.addClient(str_id, lid, role);
180 // This case occurs when an client calls "subscribe" before request_surface.
181 // Then application doesn't have layer and role yet.
182 auto client = g_app_list.lookUpClient(str_id);
183 if(client->layerID() == 0)
185 client->setLayerID(this->generateLayerForClient(role));
187 client->setRole(role);
190 // generate surface ID for ivi-shell application
191 auto rname = this->id_alloc.lookup(role);
194 // name does not exist yet, allocate surface id...
195 auto id = int(this->id_alloc.generate_id(role));
196 this->tmp_surface2app[id] = {str_id, lid};
198 auto client = g_app_list.lookUpClient(str_id);
199 client->registerSurface(id);
204 // Check currently registered drawing names if it is already there.
205 return Err<int>("Surface already present");
208 char const *WindowManager::api_request_surface(char const *appid, char const *drawing_name,
211 string str_id = appid;
212 string role = drawing_name;
214 unsigned sid = std::stol(ivi_id);
215 HMI_DEBUG("This API(requestSurfaceXDG) is for XDG Application using runXDG");
217 * IVI-shell doesn't send surface_size event via ivi-wm protocol
218 * if the application is using XDG surface.
219 * So WM has to set surface size with original size here
221 WMError ret = this->lc->setXDGSurfaceOriginSize(sid);
224 HMI_ERROR("%s", errorDescription(ret));
225 HMI_WARNING("The main user of this API is runXDG");
229 if(!g_app_list.contains(str_id))
231 unsigned l_id = this->generateLayerForClient(role);
234 return "Designated role does not match any role, fallback is disabled";
236 // add client into the db
237 g_app_list.addClient(str_id, l_id, role);
241 // This case occurs when an client calls "subscribe" before request_surface.
242 // Then application doesn't have layer and role yet.
243 auto client = g_app_list.lookUpClient(str_id);
244 if(client->layerID() == 0)
246 client->setLayerID(this->generateLayerForClient(role));
248 client->setRole(role);
251 auto rname = this->id_alloc.lookup(role);
255 return "Surface already present";
258 // register pair drawing_name and ivi_id
259 this->id_alloc.register_name_id(role, sid);
261 auto client = g_app_list.lookUpClient(str_id);
262 client->addSurface(sid);
267 void WindowManager::api_activate_window(char const *appid, char const *drawing_name,
268 char const *drawing_area, const reply_func &reply)
271 string role = drawing_name;
272 string area = drawing_area;
274 if(!g_app_list.contains(id))
276 reply("app doesn't request 'requestSurface' or 'setRole' yet");
279 auto client = g_app_list.lookUpClient(id);
281 Task task = Task::TASK_ALLOCATE;
282 unsigned req_num = 0;
283 WMError ret = WMError::UNKNOWN;
285 ret = this->setRequest(id, role, area, task, &req_num);
287 if(ret != WMError::SUCCESS)
289 HMI_ERROR(errorDescription(ret));
290 reply("Failed to set request");
295 if (req_num != g_app_list.currentRequestNumber())
297 // Add request, then invoked after the previous task is finished
298 HMI_SEQ_DEBUG(req_num, "request is accepted");
303 ret = this->checkPolicy(req_num);
305 if (ret != WMError::SUCCESS)
308 HMI_SEQ_ERROR(req_num, errorDescription(ret));
309 g_app_list.removeRequest(req_num);
310 this->processNextRequest();
314 void WindowManager::api_deactivate_window(char const *appid, char const *drawing_name,
315 const reply_func &reply)
319 string role = drawing_name;
320 string area = ""; //drawing_area;
321 Task task = Task::TASK_RELEASE;
322 unsigned req_num = 0;
323 WMError ret = WMError::UNKNOWN;
325 ret = this->setRequest(id, role, area, task, &req_num);
327 if (ret != WMError::SUCCESS)
329 HMI_ERROR(errorDescription(ret));
330 reply("Failed to set request");
335 if (req_num != g_app_list.currentRequestNumber())
337 // Add request, then invoked after the previous task is finished
338 HMI_SEQ_DEBUG(req_num, "request is accepted");
343 ret = this->checkPolicy(req_num);
345 if (ret != WMError::SUCCESS)
348 HMI_SEQ_ERROR(req_num, errorDescription(ret));
349 g_app_list.removeRequest(req_num);
350 this->processNextRequest();
354 void WindowManager::api_enddraw(char const *appid, char const *drawing_name)
357 string role = drawing_name;
358 unsigned current_req = g_app_list.currentRequestNumber();
359 bool result = g_app_list.setEndDrawFinished(current_req, id, role);
363 HMI_ERROR("%s is not in transition state", id.c_str());
367 if (g_app_list.endDrawFullfilled(current_req))
369 // do task for endDraw
371 WMError ret = this->doEndDraw(current_req);
373 if(ret != WMError::SUCCESS)
375 //this->emit_error();
377 // Undo state of PolicyManager
378 this->pmw.undoState();
379 this->lc->undoUpdate();
381 this->emitScreenUpdated(current_req);
382 HMI_SEQ_INFO(current_req, "Finish request status: %s", errorDescription(ret));
384 g_app_list.removeRequest(current_req);
386 this->processNextRequest();
390 HMI_SEQ_INFO(current_req, "Wait other App call endDraw");
395 json_object* WindowManager::api_get_area_list()
397 json_object* ret = json_object_new_object();
398 json_object* jarray = json_object_new_array();
399 unordered_map<string, struct rect> area2size = this->lc->getAreaList();
400 for(const auto& area : area2size)
402 json_object* j = json_object_new_object();
403 json_object_object_add(j, "name", json_object_new_string(area.first.c_str()));
404 json_object* jrect = json_object_new_object();
405 json_object_object_add(jrect, "x", json_object_new_int(area.second.x));
406 json_object_object_add(jrect, "y", json_object_new_int(area.second.y));
407 json_object_object_add(jrect, "w", json_object_new_int(area.second.w));
408 json_object_object_add(jrect, "h", json_object_new_int(area.second.h));
409 json_object_object_add(j, "rect", jrect);
410 json_object_array_add(jarray, j);
412 json_object_object_add(ret, "areas", jarray);
413 HMI_DEBUG("area_list: %s", json_object_get_string(ret));
417 void WindowManager::api_change_area_size(ChangeAreaReq &areas)
421 auto client = g_app_list.lookUpClient(areas.appname);
423 if(client == nullptr)
425 HMI_ERROR("Call register your role with setRole or requestSurface");
428 if(std::find(white_list_area_size_change.begin(),
429 white_list_area_size_change.end(), client->role()) == white_list_area_size_change.end())
431 HMI_ERROR("Application %s which has the role %s is not allowed to change area size", client->appID().c_str(), client->role().c_str());
436 ret = this->lc->updateAreaList(areas);
437 if(ret != WMError::SUCCESS)
439 HMI_ERROR("%d : %s", ret, errorDescription(ret));
442 ret = this->lc->getUpdateAreaList(&areas);
444 if(ret != WMError::SUCCESS)
446 HMI_ERROR("%d : %s", ret, errorDescription(ret));
453 ret = this->setRequest(client->appID(), client->role(), "-", Task::TASK_CHANGE_AREA, &req_num); // area is null
454 if(ret != WMError::SUCCESS)
456 HMI_SEQ_ERROR(req_num, "%d : %s", ret, errorDescription(ret));
459 for(const auto &update: areas.update_app2area)
462 auto client = g_app_list.lookUpClient(update.first);
463 if(client == nullptr)
465 HMI_SEQ_ERROR(req_num, "%s : %s", update.first.c_str(), errorDescription(ret));
466 g_app_list.removeRequest(req_num);
467 this->processNextRequest();
470 ret = g_app_list.setAction(req_num, client, client->role(), update.second, TaskVisible::VISIBLE);
471 if(ret != WMError::SUCCESS)
473 HMI_SEQ_ERROR(req_num, "Failed to set request");
477 HMI_SEQ_INFO(req_num, "Area change request");
478 g_app_list.reqDump();
480 // Request change size to applications
481 for(const auto &action : g_app_list.getActions(req_num, &found))
483 struct rect r = this->lc->getAreaSize(action.area);
484 action.client->emitSyncDraw(action.area, r);
488 bool WindowManager::api_subscribe(afb_req_t req, EventType event_id)
491 char* appid = afb_req_get_application_id(req);
492 if(event_id < Event_Val_Min || event_id > Event_Val_Max)
494 HMI_ERROR("not defined in Window Manager", event_id);
497 HMI_INFO("%s subscribe %s : %d", appid, kListEventName[event_id].c_str(), event_id);
498 if(event_id == Event_ScreenUpdated)
500 // Event_ScreenUpdated should be emitted to subscriber
501 afb_event_t event = this->map_afb_event[kListEventName[event_id]];
502 int rc = afb_req_subscribe(req, event);
512 if(!g_app_list.contains(id))
514 g_app_list.addClient(id);
516 g_app_list.lookUpClient(id)->subscribe(req, kListEventName[event_id]);
520 HMI_ERROR("appid is not set");
525 result<json_object *> WindowManager::api_get_display_info()
527 Screen screen = this->lc->getScreenInfo();
529 json_object *object = json_object_new_object();
530 json_object_object_add(object, kKeyWidthPixel, json_object_new_int(screen.width()));
531 json_object_object_add(object, kKeyHeightPixel, json_object_new_int(screen.height()));
533 json_object_object_add(object, kKeyWidthMm, json_object_new_int(0));
534 json_object_object_add(object, kKeyHeightMm, json_object_new_int(0));
535 json_object_object_add(object, kKeyScale, json_object_new_double(this->lc->scale()));
537 return Ok<json_object *>(object);
540 result<json_object *> WindowManager::api_get_area_info(char const *drawing_name)
544 string role = drawing_name;
546 // Check drawing name, surface/layer id
547 auto const &surface_id = this->id_alloc.lookup(role);
550 return Err<json_object *>("Surface does not exist");
553 // Set area rectangle
554 struct rect area_info = this->area_info[*surface_id];
555 json_object *object = json_object_new_object();
556 json_object_object_add(object, kKeyX, json_object_new_int(area_info.x));
557 json_object_object_add(object, kKeyY, json_object_new_int(area_info.y));
558 json_object_object_add(object, kKeyWidth, json_object_new_int(area_info.w));
559 json_object_object_add(object, kKeyHeight, json_object_new_int(area_info.h));
561 return Ok<json_object *>(object);
567 void WindowManager::surface_created(unsigned surface_id)
570 if(this->tmp_surface2app.count(surface_id) != 0)
572 string appid = this->tmp_surface2app[surface_id].appid;
573 auto client = g_app_list.lookUpClient(appid);
574 if(client != nullptr)
576 WMError ret = client->addSurface(surface_id);
577 HMI_INFO("Add surface %d to \"%s\"", surface_id, appid.c_str());
578 if(ret != WMError::SUCCESS)
580 HMI_ERROR("Failed to add surface to client %s", client->appID().c_str());
583 this->tmp_surface2app.erase(surface_id);
587 void WindowManager::surface_removed(unsigned surface_id)
589 HMI_DEBUG("Delete surface_id %u", surface_id);
590 this->id_alloc.remove_id(surface_id);
591 g_app_list.removeSurface(surface_id);
594 void WindowManager::removeClient(const string &appid)
596 HMI_DEBUG("Remove clinet %s from list", appid.c_str());
597 auto client = g_app_list.lookUpClient(appid);
598 this->lc->appTerminated(client);
599 g_app_list.removeClient(appid);
602 void WindowManager::exceptionProcessForTransition()
604 unsigned req_num = g_app_list.currentRequestNumber();
605 HMI_SEQ_NOTICE(req_num, "Process exception handling for request. Remove current request %d", req_num);
606 g_app_list.removeRequest(req_num);
607 HMI_SEQ_NOTICE(g_app_list.currentRequestNumber(), "Process next request if exists");
608 this->processNextRequest();
611 void WindowManager::timerHandler()
613 unsigned req_num = g_app_list.currentRequestNumber();
614 HMI_SEQ_DEBUG(req_num, "Timer expired remove Request");
615 g_app_list.reqDump();
616 g_app_list.removeRequest(req_num);
617 this->processNextRequest();
620 void WindowManager::startTransitionWrapper(vector<WMAction> &actions)
623 unsigned req_num = g_app_list.currentRequestNumber();
627 if (g_app_list.haveRequest())
629 HMI_SEQ_DEBUG(req_num, "There is no WMAction for this request");
630 goto proc_remove_request;
634 HMI_SEQ_DEBUG(req_num, "There is no request");
639 for (auto &act : actions)
644 auto const &surface_id = this->id_alloc.lookup(act.role);
645 if(surface_id == nullopt)
647 goto proc_remove_request;
649 string appid = g_app_list.getAppID(*surface_id, &found);
652 if (TaskVisible::INVISIBLE == act.visible)
654 // App is killed, so do not set this action
659 HMI_SEQ_ERROR(req_num, "appid which is visible is not found");
664 auto client = g_app_list.lookUpClient(appid);
665 act.req_num = req_num;
669 ret = g_app_list.setAction(req_num, act);
670 if (ret != WMError::SUCCESS)
672 HMI_SEQ_ERROR(req_num, "Setting action is failed");
677 HMI_SEQ_DEBUG(req_num, "Start transition.");
678 ret = this->startTransition(req_num);
679 if (ret != WMError::SUCCESS)
681 if (ret == WMError::NO_LAYOUT_CHANGE)
683 goto proc_remove_request;
687 HMI_SEQ_ERROR(req_num, "Transition state is failed");
696 HMI_SEQ_ERROR(req_num, errorDescription(ret));
697 this->pmw.undoState();
700 g_app_list.removeRequest(req_num);
701 this->processNextRequest();
704 void WindowManager::processError(WMError error)
706 unsigned req_num = g_app_list.currentRequestNumber();
709 HMI_SEQ_ERROR(req_num, errorDescription(error));
710 g_app_list.removeRequest(req_num);
711 this->processNextRequest();
714 unsigned WindowManager::generateLayerForClient(const string& role)
716 unsigned lid = this->lc->getNewLayerID(role);
719 // register drawing_name as fallback and make it displayed.
720 lid = this->lc->getNewLayerID(string("fallback"));
721 HMI_DEBUG("%s is not registered in layers.json, then fallback as normal app", role.c_str());
727 this->lc->createNewLayer(lid);
728 // add client into the db
732 WMError WindowManager::setRequest(const string& appid, const string &role, const string &area,
733 Task task, unsigned* req_num)
735 if (!g_app_list.contains(appid))
737 return WMError::NOT_REGISTERED;
740 auto client = g_app_list.lookUpClient(appid);
745 unsigned current = g_app_list.currentRequestNumber();
746 unsigned requested_num = g_app_list.getRequestNumber(appid);
747 if (requested_num != 0)
749 HMI_SEQ_INFO(requested_num,
750 "%s %s %s request is already queued", appid.c_str(), role.c_str(), area.c_str());
754 WMRequest req = WMRequest(appid, role, area, task);
755 unsigned new_req = g_app_list.addRequest(req);
757 g_app_list.reqDump();
759 HMI_SEQ_DEBUG(current, "%s start sequence with %s, %s", appid.c_str(), role.c_str(), area.c_str());
761 return WMError::SUCCESS;
764 WMError WindowManager::checkPolicy(unsigned req_num)
769 // get current trigger
771 WMError ret = WMError::LAYOUT_CHANGE_FAIL;
772 auto trigger = g_app_list.getRequest(req_num, &found);
775 ret = WMError::NO_ENTRY;
778 string req_area = trigger.area;
780 // Input event data to PolicyManager
781 if (0 > this->pmw.setInputEventData(trigger.task, trigger.role, trigger.area))
783 HMI_SEQ_ERROR(req_num, "Failed to set input event data to PolicyManager");
787 // Execute state transition of PolicyManager
788 if (0 > this->pmw.executeStateTransition())
790 HMI_SEQ_ERROR(req_num, "Failed to execute state transition of PolicyManager");
794 ret = WMError::SUCCESS;
796 g_app_list.reqDump();
801 WMError WindowManager::startTransition(unsigned req_num)
803 bool sync_draw_happen = false;
805 WMError ret = WMError::SUCCESS;
806 auto actions = g_app_list.getActions(req_num, &found);
809 ret = WMError::NO_ENTRY;
810 HMI_SEQ_ERROR(req_num,
811 "Window Manager bug :%s : Action is not set", errorDescription(ret));
815 g_app_list.reqDump();
816 for (const auto &action : actions)
818 if (action.visible == TaskVisible::VISIBLE)
820 sync_draw_happen = true;
821 struct rect r = this->lc->getAreaSize(action.area);
822 action.client->emitSyncDraw(action.area, r);
826 if (sync_draw_happen)
832 // deactivate only, no syncDraw
833 // Make it deactivate here
834 for (const auto &x : actions)
836 this->lc->visibilityChange(x);
837 x.client->emitVisible(false);
839 this->lc->renderLayers();
840 ret = WMError::NO_LAYOUT_CHANGE;
845 WMError WindowManager::doEndDraw(unsigned req_num)
849 auto actions = g_app_list.getActions(req_num, &found);
850 WMError ret = WMError::SUCCESS;
853 ret = WMError::NO_ENTRY;
857 HMI_SEQ_INFO(req_num, "do endDraw");
859 // layout change and make it visible
860 for (const auto &act : actions)
862 if(act.visible != TaskVisible::NO_CHANGE)
865 ret = this->lc->layoutChange(act);
866 if(ret != WMError::SUCCESS)
868 HMI_SEQ_WARNING(req_num,
869 "Failed to manipulate surfaces while state change : %s", errorDescription(ret));
872 ret = this->lc->visibilityChange(act);
873 act.client->emitVisible((act.visible == VISIBLE));
875 if (ret != WMError::SUCCESS)
877 HMI_SEQ_WARNING(req_num,
878 "Failed to manipulate surfaces while state change : %s", errorDescription(ret));
881 HMI_SEQ_DEBUG(req_num, "visible %s", act.role.c_str());
884 this->lc->renderLayers();
886 HMI_SEQ_INFO(req_num, "emit flushDraw");
888 for(const auto &act_flush : actions)
890 if(act_flush.visible == TaskVisible::VISIBLE)
892 act_flush.client->emitFlushDraw();
899 void WindowManager::emitScreenUpdated(unsigned req_num)
902 HMI_SEQ_DEBUG(req_num, "emit screen updated");
904 auto actions = g_app_list.getActions(req_num, &found);
907 HMI_SEQ_ERROR(req_num,
908 "Window Manager bug :%s : Action is not set",
909 errorDescription(WMError::NO_ENTRY));
913 // create json object
914 json_object *j = json_object_new_object();
915 json_object *jarray = json_object_new_array();
917 for(const auto& action: actions)
919 if(action.visible != TaskVisible::INVISIBLE)
921 json_object_array_add(jarray, json_object_new_string(action.client->appID().c_str()));
924 json_object_object_add(j, kKeyIds, jarray);
925 HMI_SEQ_INFO(req_num, "Visible app: %s", json_object_get_string(j));
927 int ret = afb_event_push(
928 this->map_afb_event[kListEventName[Event_ScreenUpdated]], j);
931 HMI_DEBUG("afb_event_push failed: %m");
935 void WindowManager::setTimer()
938 if (clock_gettime(CLOCK_BOOTTIME, &ts) != 0) {
939 HMI_ERROR("Could't set time (clock_gettime() returns with error");
943 HMI_SEQ_DEBUG(g_app_list.currentRequestNumber(), "Timer set activate");
944 if (g_timer_ev_src == nullptr)
946 // firsttime set into sd_event
947 int ret = sd_event_add_time(afb_api_get_event_loop(afbBindingV3root), &g_timer_ev_src,
948 CLOCK_BOOTTIME, (uint64_t)(ts.tv_sec + kTimeOut) * 1000000ULL, 1, processTimerHandler, this);
951 HMI_ERROR("Could't set timer");
956 // update timer limitation after second time
957 sd_event_source_set_time(g_timer_ev_src, (uint64_t)(ts.tv_sec + kTimeOut) * 1000000ULL);
958 sd_event_source_set_enabled(g_timer_ev_src, SD_EVENT_ONESHOT);
962 void WindowManager::stopTimer()
964 unsigned req_num = g_app_list.currentRequestNumber();
965 HMI_SEQ_DEBUG(req_num, "Timer stop");
966 int rc = sd_event_source_set_enabled(g_timer_ev_src, SD_EVENT_OFF);
969 HMI_SEQ_ERROR(req_num, "Timer stop failed");
973 void WindowManager::processNextRequest()
976 g_app_list.reqDump();
977 unsigned req_num = g_app_list.currentRequestNumber();
978 if (g_app_list.haveRequest())
980 HMI_SEQ_DEBUG(req_num, "Process next request");
981 WMError rc = checkPolicy(req_num);
982 if (rc != WMError::SUCCESS)
984 HMI_SEQ_ERROR(req_num, errorDescription(rc));
989 HMI_SEQ_DEBUG(req_num, "Nothing Request. Waiting Request");