+ // layer manager task
+ bool sync_draw_happen = false;
+ for (const auto &y : app_list.getActions(req_num))
+ {
+ /*
+ do_task(y);
+ */
+ /* TODO
+ but current we can't do do_task,
+ so divide the processing into lm_layout_change and lm_release
+ */
+ if (y.visible)
+ {
+ sync_draw_happen = true;
+ ret = lm_layout_change(y);
+ if (ret != WMError::SUCCESS)
+ {
+ HMI_SEQ_ERROR(req_num, "%s: appid: %s, role: %s, area: %s",
+ errorDescription(ret), y.appid.c_str(), y.role.c_str(), y.area.c_str());
+ app_list.removeRequest(req_num);
+ break;
+ // TODO: if transition fails, what should we do?
+ }
+ /* app_list.lookUpClient(y.appid)->emit_syncdraw(y.role, y.area); */
+ }
+ else
+ {
+ ret = lm_release(y);
+ if (!ret)
+ {
+ HMI_SEQ_ERROR(req_num, "Failed release resource: %s", y.appid.c_str());
+ app_list.removeRequest(req_num);
+ break;
+ // TODO: if transition fails, what should we do?
+ }
+ /* app_list.lookUpClient(y.appid)->emit_invisible(y.role, y.area); */
+ }
+ }