2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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.
18 * @author Janusz Kozerski (j.kozerski@samsung.com)
19 * Kyungwook Tak (k.tak@samsung.com)
21 * @brief Popup service main
26 #include <Elementary.h>
32 #include "common/audit/logger.h"
33 #include "popup-service.h"
37 void updateLanguage(void)
39 char *lang = vconf_get_str(VCONFKEY_LANGSET);
40 if (lang == nullptr) {
41 WARN("Cannot get language_set.");
45 ::setenv("LANG", lang, 1);
46 ::setenv("LC_MESSAGES", lang, 1);
47 ::setlocale(LC_ALL, "");
53 ElmRaii(int argc, char **argv)
61 DEBUG("elm_shutdown()");
63 * shutdown generates segmentation fault by unknown reason.
69 } // namespace anonymous
71 int main(int argc, char **argv)
73 #ifdef TIZEN_TEST_GCOV
74 ::setenv("GCOV_PREFIX", "/tmp", 1);
77 Csr::Audit::Logger::setTag("CSR_POPUP");
79 INFO("CSR popup service start!");
81 /* init/shutdown elm automatically */
82 ElmRaii elmRaii(argc, argv);
84 std::signal(SIGTERM, [](int signal) {
85 WARN("Popup is terminated by signal[" << strsignal(signal) << "]");
86 /* cleanup and close up stuff here */
92 Csr::Ui::PopupService service;
94 // If timeout time is too small and popup service wakes up repeatedly too quickly,
95 // it can be kept out to start by systemd.
96 service.start(POPUP_SERVICE_IDLE_TIMEOUT_TIME);
99 } catch (const std::exception &e) {
100 ERROR("std exception: " << e.what());
103 ERROR("Unhandled exception occured!");