8 #include <service_app.h>
10 #include <notification_list.h>
11 #include <notification_text_domain.h>
12 #include <notification_internal.h>
14 #include <call-manager.h>
18 #include "msg_storage.h"
20 #include "msg-manager-contact.h"
21 #include "msg-manager-debug.h"
22 #include "msg-manager-notification.h"
23 #include "msg-manager-sound.h"
24 #include "msg-manager-util.h"
26 /* below defines will be removed */
27 #define EVENT_KEY_OUT_MSG_TYPE "msg_type"
28 #define EVENT_KEY_OUT_MSG_ID "msg_id"
30 msg_handle_t msg_handle = NULL;
31 cm_client_h cm_handle = NULL;
34 static int job_cnt = 0;
35 static bool terminated = false;
37 static int _service_app_exit(void *data)
39 MSG_MGR_INFO("kill msg-manager");
45 static int _check_app_terminate(void *data)
47 pthread_mutex_lock(&mx);
50 MSG_MGR_DEBUG("job_cnt [%d]", job_cnt);
53 g_idle_add(_service_app_exit, NULL);
56 pthread_mutex_unlock(&mx);
61 bool service_app_create(void *data)
63 MSG_MGR_INFO("app_create");
65 int msg_server_ready = 0;
66 for (int i = 0; i < 100; i++) {
67 vconf_get_bool(VCONFKEY_MSG_SERVER_READY, &msg_server_ready);
68 if (msg_server_ready == 1) {
69 int msg_err = msg_open_msg_handle(&msg_handle);
70 if (msg_err != MSG_SUCCESS)
71 MSG_MGR_DEBUG("msg_open_msg_handle() failed [%d]", msg_err);
73 MSG_MGR_DEBUG("msg_open_msg_handle() success");
77 MSG_MGR_DEBUG("msg-server is not ready.");
83 initMsgMgrSoundPlayer();
89 void service_app_terminate(void *data)
91 MSG_MGR_INFO("app_terminate");
94 MsgMgrCloseContactSvc();
95 msg_close_msg_handle(&msg_handle);
100 void _incoming_msg_func(app_control_h app_control)
105 char *rcv_msg_type = NULL;
106 char *rcv_msg_id = NULL;
108 ret = app_control_get_extra_data(app_control, EVENT_KEY_MSG_ID, &rcv_msg_id);
109 if (ret != APP_CONTROL_ERROR_NONE || rcv_msg_id == NULL) {
110 MSG_MGR_ERR("app_control_get_extra_data failed");
114 ret = app_control_get_extra_data(app_control, EVENT_KEY_MSG_TYPE, &rcv_msg_type);
115 if (ret != APP_CONTROL_ERROR_NONE || rcv_msg_type == NULL) {
116 MSG_MGR_ERR("app_control_get_extra_data failed");
121 MSG_MGR_INFO("rcv_msg_type(%s), rcv_msg_id(%s)", rcv_msg_type, rcv_msg_id);
123 int msg_err = MSG_SUCCESS;
124 msg_message_id_t msg_id = atoi(rcv_msg_id);
125 msg_struct_t msg = NULL;
126 msg_struct_t opt = NULL;
127 contactInfo contact_info = {0,};
128 contact_info.msgId = msg_id;
130 msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
131 opt = msg_create_struct(MSG_STRUCT_SENDOPT);
132 msg_err = msg_get_message(msg_handle, msg_id, msg, opt);
133 if (msg_err != MSG_SUCCESS) {
134 MSG_MGR_ERR("msg_get_message() failed [%d]", msg_err);
138 msg_get_int_value(msg, MSG_MESSAGE_TYPE_INT, &contact_info.msgType);
139 msg_get_int_value(msg, MSG_MESSAGE_FOLDER_ID_INT, &contact_info.folderId);
140 msg_get_int_value(msg, MSG_MESSAGE_SIM_INDEX_INT, &contact_info.simIndex);
141 msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_HND, (void **)&contact_info.addrList);
142 msg_get_str_value(msg, MSG_MESSAGE_SUBJECT_STR, contact_info.subject, MAX_CONTACT_TEXT_LEN);
144 msg_get_int_value(msg, MSG_MESSAGE_DATA_SIZE_INT, &msgSize);
146 msg_get_str_value(msg, MSG_MESSAGE_SMS_DATA_STR, contact_info.msgText, MAX_CONTACT_TEXT_LEN);
148 if ((contact_info.folderId == MSG_INBOX_ID || contact_info.folderId == MSG_SPAMBOX_ID)) {
149 MsgMgrAddPhoneLog(&contact_info);
152 msg_release_struct(&msg);
153 msg_release_struct(&opt);
156 g_free(rcv_msg_type);
161 void _outgoing_msg_func(app_control_h app_control)
166 char *sent_msg_type = NULL;
167 char *sent_msg_id = NULL;
169 ret = app_control_get_extra_data(app_control, EVENT_KEY_OUT_MSG_ID, &sent_msg_id);
170 if (ret != APP_CONTROL_ERROR_NONE || sent_msg_id == NULL) {
171 MSG_MGR_ERR("app_control_get_extra_data failed");
175 ret = app_control_get_extra_data(app_control, EVENT_KEY_OUT_MSG_TYPE, &sent_msg_type);
176 if (ret != APP_CONTROL_ERROR_NONE || sent_msg_type == NULL) {
177 MSG_MGR_ERR("app_control_get_extra_data failed");
182 MSG_MGR_INFO("sent_msg_type(%s) sent_msg_id(%s)", sent_msg_type, sent_msg_id);
184 int msg_err = MSG_SUCCESS;
185 msg_message_id_t msg_id = atoi(sent_msg_id);
186 msg_struct_t msg = NULL;
187 msg_struct_t opt = NULL;
188 contactInfo contact_info = {0,};
189 contact_info.msgId = msg_id;
191 msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
192 opt = msg_create_struct(MSG_STRUCT_SENDOPT);
193 msg_err = msg_get_message(msg_handle, msg_id, msg, opt);
194 if (msg_err != MSG_SUCCESS) {
195 MSG_MGR_ERR("msg_get_message() failed [%d]", msg_err);
199 msg_get_int_value(msg, MSG_MESSAGE_TYPE_INT, &contact_info.msgType);
200 msg_get_int_value(msg, MSG_MESSAGE_FOLDER_ID_INT, &contact_info.folderId);
201 msg_get_int_value(msg, MSG_MESSAGE_SIM_INDEX_INT, &contact_info.simIndex);
202 msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_HND, (void **)&contact_info.addrList);
203 msg_get_str_value(msg, MSG_MESSAGE_SUBJECT_STR, contact_info.subject, 100);
205 msg_get_int_value(msg, MSG_MESSAGE_DATA_SIZE_INT, &msgSize);
207 msg_get_str_value(msg, MSG_MESSAGE_SMS_DATA_STR, contact_info.msgText, 100);
209 MsgMgrAddPhoneLog(&contact_info);
211 msg_release_struct(&msg);
212 msg_release_struct(&opt);
215 g_free(sent_msg_type);
220 void _refresh_noti_func(app_control_h app_control)
223 char *feedback = NULL;
224 char *active_type = NULL;
225 msg_mgr_notification_type_t noti_type = MSG_MGR_NOTI_TYPE_NORMAL;
226 bool bFeedback = true;
227 msg_mgr_active_notification_type_t active_noti_type = MSG_MGR_ACTIVE_NOTI_TYPE_NONE;
229 int ret = app_control_get_extra_data(app_control, "type", &type);
230 if (ret == APP_CONTROL_ERROR_NONE && type) {
231 MSG_MGR_DEBUG("type [%s]", type);
232 if (g_strcmp0(type, "normal") == 0)
233 noti_type = MSG_MGR_NOTI_TYPE_NORMAL;
237 MSG_MGR_ERR("app_control_get_extra_data failed");
241 ret = app_control_get_extra_data(app_control, "feedback", &feedback);
242 if (ret == APP_CONTROL_ERROR_NONE && feedback) {
243 MSG_MGR_DEBUG("feedback [%s]", feedback);
244 if (g_strcmp0(feedback, "false") == 0)
246 else if (g_strcmp0(feedback, "true") == 0)
252 ret = app_control_get_extra_data(app_control, "active_type", &active_type);
253 if (ret == APP_CONTROL_ERROR_NONE && active_type) {
254 MSG_MGR_DEBUG("active_type [%s]", active_type);
255 if (g_strcmp0(active_type, "none") == 0)
256 active_noti_type = MSG_MGR_ACTIVE_NOTI_TYPE_NONE;
257 else if (g_strcmp0(active_type, "active") == 0)
258 active_noti_type = MSG_MGR_ACTIVE_NOTI_TYPE_ACTIVE;
259 else if (g_strcmp0(active_type, "instant") == 0)
260 active_noti_type = MSG_MGR_ACTIVE_NOTI_TYPE_INSTANT;
265 MsgMgrRefreshNotification(noti_type, bFeedback, active_noti_type);
268 void _add_noti_func(app_control_h app_control)
271 msg_mgr_notification_type_t noti_type = MSG_MGR_NOTI_TYPE_ALL;
273 int ret = app_control_get_extra_data(app_control, "type", &type);
274 if (ret == APP_CONTROL_ERROR_NONE && type) {
275 if (g_strcmp0(type, "voice1") == 0) {
276 noti_type = MSG_MGR_NOTI_TYPE_VOICE_1;
277 } else if (g_strcmp0(type, "voice2") == 0) {
278 noti_type = MSG_MGR_NOTI_TYPE_VOICE_2;
279 } else if (g_strcmp0(type, "mwi") == 0) {
280 noti_type = MSG_MGR_NOTI_TYPE_MWI;
281 } else if (g_strcmp0(type, "class0") == 0) {
282 noti_type = MSG_MGR_NOTI_TYPE_CLASS0;
287 MSG_MGR_ERR("app_control_get_extra_data failed");
292 ret = app_control_get_extra_data(app_control, "msg_id", &msgId);
293 if (ret != APP_CONTROL_ERROR_NONE || msgId == NULL) {
294 MSG_MGR_ERR("app_control_get_extra_data failed");
298 int msg_err = MSG_SUCCESS;
299 msg_message_id_t msg_id = atoi(msgId);
300 msg_struct_t msg = NULL;
301 msg_struct_t opt = NULL;
302 msg_list_handle_t addr_list = NULL;
303 MSG_MGR_MESSAGE_INFO_S msg_info = {0,};
304 msg_info.msgId = msg_id;
306 msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
307 opt = msg_create_struct(MSG_STRUCT_SENDOPT);
308 msg_err = msg_get_message(msg_handle, msg_id, msg, opt);
309 if (msg_err != MSG_SUCCESS) {
310 MSG_MGR_ERR("msg_get_message() failed [%d]", msg_err);
314 msg_get_int_value(msg, MSG_MESSAGE_SIM_INDEX_INT, &msg_info.sim_idx);
315 msg_get_int_value(msg, MSG_MESSAGE_DISPLAY_TIME_INT, (int *)&msg_info.displayTime);
316 msg_get_int_value(msg, MSG_MESSAGE_NETWORK_STATUS_INT, (int *)&msg_info.networkStatus);
317 msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
319 msg_struct_t addr_data = msg_list_nth_data(addr_list, 0);
320 msg_get_str_value(addr_data, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, msg_info.addressVal, MAX_ADDRESS_VAL_LEN);
321 msg_get_str_value(addr_data, MSG_ADDRESS_INFO_DISPLAYNAME_STR, msg_info.displayName, MAX_DISPLAY_NAME_LEN);
323 if (noti_type == MSG_MGR_NOTI_TYPE_MWI || noti_type == MSG_MGR_NOTI_TYPE_CLASS0) {
325 msg_get_int_value(msg, MSG_MESSAGE_DATA_SIZE_INT, &msg_size);
327 msg_get_str_value(msg, MSG_MESSAGE_SMS_DATA_STR, msg_info.msgText, MAX_MSG_TEXT_LEN);
330 msg_release_struct(&msg);
331 msg_release_struct(&opt);
335 MsgMgrAddNotification(noti_type, &msg_info);
338 void _del_noti_func(app_control_h app_control)
341 msg_mgr_notification_type_t noti_type = MSG_MGR_NOTI_TYPE_ALL;
343 int ret = app_control_get_extra_data(app_control, "type", &type);
344 if (ret == APP_CONTROL_ERROR_NONE && type) {
345 if (g_strcmp0(type, "all") == 0) {
346 noti_type = MSG_MGR_NOTI_TYPE_ALL;
347 } else if (g_strcmp0(type, "normal") == 0) {
348 noti_type = MSG_MGR_NOTI_TYPE_NORMAL;
349 } else if (g_strcmp0(type, "sim") == 0) {
350 noti_type = MSG_MGR_NOTI_TYPE_SIM;
351 } else if (g_strcmp0(type, "voice1") == 0) {
352 noti_type = MSG_MGR_NOTI_TYPE_VOICE_1;
353 } else if (g_strcmp0(type, "voice2") == 0) {
354 noti_type = MSG_MGR_NOTI_TYPE_VOICE_2;
359 MSG_MGR_ERR("app_control_get_extra_data failed");
363 char *simIndex = NULL;
364 ret = app_control_get_extra_data(app_control, "sim_index", &simIndex);
365 if (ret != APP_CONTROL_ERROR_NONE || simIndex == NULL) {
366 MSG_MGR_ERR("app_control_get_extra_data failed");
370 int sim_index = atoi(simIndex);
372 MsgMgrDeleteNoti(noti_type, sim_index);
377 void _add_report_noti_func(app_control_h app_control)
380 msg_mgr_notification_type_t noti_type = MSG_MGR_NOTI_TYPE_ALL;
382 int ret = app_control_get_extra_data(app_control, "type", &type);
383 if (ret == APP_CONTROL_ERROR_NONE && type) {
384 if (g_strcmp0(type, "sms_delivery") == 0) {
385 noti_type = MSG_MGR_NOTI_TYPE_SMS_DELIVERY_REPORT;
386 } else if (g_strcmp0(type, "mms_delivery") == 0) {
387 noti_type = MSG_MGR_NOTI_TYPE_MMS_DELIVERY_REPORT;
388 } else if (g_strcmp0(type, "mms_read") == 0) {
389 noti_type = MSG_MGR_NOTI_TYPE_MMS_READ_REPORT;
394 MSG_MGR_ERR("app_control_get_extra_data failed");
399 ret = app_control_get_extra_data(app_control, "msg_id", &msgId);
400 if (ret != APP_CONTROL_ERROR_NONE || msgId == NULL) {
401 MSG_MGR_ERR("app_control_get_extra_data failed");
405 int msg_err = MSG_SUCCESS;
406 msg_message_id_t msg_id = atoi(msgId);
407 msg_struct_t msg = NULL;
408 msg_struct_t opt = NULL;
409 msg_list_handle_t addr_list = NULL;
410 MSG_MGR_MESSAGE_INFO_S msg_info = {0,};
411 msg_info.msgId = msg_id;
413 msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
414 opt = msg_create_struct(MSG_STRUCT_SENDOPT);
415 msg_err = msg_get_message(msg_handle, msg_id, msg, opt);
416 if (msg_err != MSG_SUCCESS) {
417 MSG_MGR_ERR("msg_get_message() failed [%d]", msg_err);
421 msg_get_int_value(msg, MSG_MESSAGE_SIM_INDEX_INT, &msg_info.sim_idx);
422 msg_get_int_value(msg, MSG_MESSAGE_DISPLAY_TIME_INT, (int *)&msg_info.displayTime);
423 msg_get_int_value(msg, MSG_MESSAGE_NETWORK_STATUS_INT, (int *)&msg_info.networkStatus);
424 msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
426 msg_struct_t addr_data = msg_list_nth_data(addr_list, 0);
427 msg_get_str_value(addr_data, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, msg_info.addressVal, MAX_ADDRESS_VAL_LEN);
428 msg_get_str_value(addr_data, MSG_ADDRESS_INFO_DISPLAYNAME_STR, msg_info.displayName, MAX_DISPLAY_NAME_LEN);
430 msg_release_struct(&msg);
431 msg_release_struct(&opt);
435 MsgMgrAddReportNotification(noti_type, &msg_info);
438 void _del_report_noti_func(app_control_h app_control)
441 int ret = app_control_get_extra_data(app_control, "address", &addr);
442 if (ret != APP_CONTROL_ERROR_NONE || addr == NULL) {
443 MSG_MGR_ERR("app_control_get_extra_data failed");
447 MsgMgrDeleteReportNotification(addr);
452 void _insert_only_active_noti_func(app_control_h app_control)
455 msg_mgr_notification_type_t noti_type = MSG_MGR_NOTI_TYPE_ALL;
457 int ret = app_control_get_extra_data(app_control, "type", &type);
458 if (ret == APP_CONTROL_ERROR_NONE && type) {
459 if (g_strcmp0(type, "normal") == 0) {
460 noti_type = MSG_MGR_NOTI_TYPE_NORMAL;
461 } else if (g_strcmp0(type, "class0") == 0) {
462 noti_type = MSG_MGR_NOTI_TYPE_CLASS0;
467 MSG_MGR_ERR("app_control_get_extra_data failed");
472 ret = app_control_get_extra_data(app_control, "msg_id", &msgId);
473 if (ret != APP_CONTROL_ERROR_NONE || msgId == NULL) {
474 MSG_MGR_ERR("app_control_get_extra_data failed");
478 int msg_err = MSG_SUCCESS;
479 msg_message_id_t msg_id = atoi(msgId);
480 msg_struct_t msg = NULL;
481 msg_struct_t opt = NULL;
482 msg_list_handle_t addr_list = NULL;
483 MSG_MGR_MESSAGE_INFO_S msg_info = {0,};
484 msg_info.msgId = msg_id;
486 msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
487 opt = msg_create_struct(MSG_STRUCT_SENDOPT);
488 msg_err = msg_get_message(msg_handle, msg_id, msg, opt);
489 if (msg_err != MSG_SUCCESS) {
490 MSG_MGR_ERR("msg_get_message() failed [%d]", msg_err);
494 msg_get_int_value(msg, MSG_MESSAGE_SIM_INDEX_INT, &msg_info.sim_idx);
496 if (noti_type == MSG_MGR_NOTI_TYPE_CLASS0) {
497 msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
499 msg_struct_t addr_data = msg_list_nth_data(addr_list, 0);
500 msg_get_str_value(addr_data, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, msg_info.addressVal, MAX_ADDRESS_VAL_LEN);
501 msg_get_str_value(addr_data, MSG_ADDRESS_INFO_DISPLAYNAME_STR, msg_info.displayName, MAX_DISPLAY_NAME_LEN);
504 msg_get_int_value(msg, MSG_MESSAGE_DATA_SIZE_INT, &msg_size);
506 msg_get_str_value(msg, MSG_MESSAGE_SMS_DATA_STR, msg_info.msgText, MAX_MSG_TEXT_LEN);
509 msg_release_struct(&msg);
510 msg_release_struct(&opt);
514 MsgMgrInsertOnlyActiveNotification(noti_type, &msg_info);
517 void _insert_ticker_func(app_control_h app_control)
519 char *ticker_msg = NULL;
520 char *locale_ticker_msg = NULL;
521 char *feedback_str = NULL;
522 bool feedback = false;
523 char *msg_id_str = NULL;
526 int ret = app_control_get_extra_data(app_control, "ticker_msg", &ticker_msg);
527 if (ret != APP_CONTROL_ERROR_NONE || ticker_msg == NULL) {
528 MSG_MGR_ERR("app_control_get_extra_data failed [%d]", ret);
529 goto _END_OF_INSERT_TICKER;
532 ret = app_control_get_extra_data(app_control, "locale_ticker_msg", &locale_ticker_msg);
533 if (ret != APP_CONTROL_ERROR_NONE || locale_ticker_msg == NULL) {
534 MSG_MGR_ERR("app_control_get_extra_data failed [%d]", ret);
535 goto _END_OF_INSERT_TICKER;
538 ret = app_control_get_extra_data(app_control, "feedback", &feedback_str);
539 if (ret != APP_CONTROL_ERROR_NONE || feedback_str == NULL) {
540 MSG_MGR_ERR("app_control_get_extra_data failed [%d]", ret);
541 goto _END_OF_INSERT_TICKER;
543 if (g_strcmp0(feedback_str, "true") == 0)
549 ret = app_control_get_extra_data(app_control, "msg_id", &msg_id_str);
550 if (ret != APP_CONTROL_ERROR_NONE || msg_id_str == NULL) {
551 MSG_MGR_ERR("app_control_get_extra_data failed [%d]", ret);
552 goto _END_OF_INSERT_TICKER;
554 msg_id = atoi(msg_id_str);
557 ret = MsgMgrInsertTicker(ticker_msg, locale_ticker_msg, feedback, msg_id);
559 MSG_MGR_ERR("MsgMgrInsertTicker failed [%d]", ret);
561 _END_OF_INSERT_TICKER:
565 if (locale_ticker_msg)
566 g_free(locale_ticker_msg);
569 g_free(feedback_str);
575 void _sound_play_start_func(app_control_h app_control)
578 MSG_MGR_SOUND_TYPE_T sound_type = MSG_MGR_SOUND_PLAY_DEFAULT;
580 int ret = app_control_get_extra_data(app_control, "type", &type);
581 if (ret == APP_CONTROL_ERROR_NONE && type) {
582 if (g_strcmp0(type, "default") == 0) {
583 sound_type = MSG_MGR_SOUND_PLAY_DEFAULT;
584 } else if (g_strcmp0(type, "user") == 0) {
585 sound_type = MSG_MGR_SOUND_PLAY_USER;
586 } else if (g_strcmp0(type, "emergency") == 0) {
587 sound_type = MSG_MGR_SOUND_PLAY_EMERGENCY;
588 } else if (g_strcmp0(type, "voicemail") == 0) {
589 sound_type = MSG_MGR_SOUND_PLAY_VOICEMAIL;
594 MSG_MGR_ERR("app_control_get_extra_data failed");
599 ret = app_control_get_extra_data(app_control, "address", &addr);
602 MSG_MGR_ADDRESS_INFO_S addr_info = {0,};
603 snprintf(addr_info.addressVal, MAX_ADDRESS_VAL_LEN, "%s", addr);
605 MsgMgrSoundPlayStart(&addr_info, sound_type);
609 MsgMgrSoundPlayStart(NULL, sound_type);
613 void _change_pm_state_func(app_control_h app_control)
615 MsgMgrChangePmState();
618 void service_app_control(app_control_h app_control, void *data)
620 MSG_MGR_INFO("service_app_control called");
622 pthread_mutex_lock(&mx);
624 pthread_mutex_unlock(&mx);
627 char *operation = NULL;
630 ret = app_control_get_operation(app_control, &operation);
631 if (ret == APP_CONTROL_ERROR_NONE && operation) {
632 if (g_strcmp0(operation, APP_CONTROL_OPERATION_DEFAULT) == 0) {
633 ret = app_control_get_extra_data(app_control, "cmd", &cmd);
634 if (ret == APP_CONTROL_ERROR_NONE && cmd) {
635 MSG_MGR_DEBUG("cmd [%s]", cmd);
637 if (g_strcmp0(cmd, "incoming_msg") == 0) {
638 _incoming_msg_func(app_control);
639 } else if (g_strcmp0(cmd, "outgoing_msg") == 0) {
640 _outgoing_msg_func(app_control);
641 } else if (g_strcmp0(cmd, "refresh_noti") == 0) {
642 _refresh_noti_func(app_control);
643 } else if (g_strcmp0(cmd, "add_noti") == 0) {
644 _add_noti_func(app_control);
645 } else if (g_strcmp0(cmd, "del_noti") == 0) {
646 _del_noti_func(app_control);
647 } else if (g_strcmp0(cmd, "add_report_noti") == 0) {
648 _add_report_noti_func(app_control);
649 } else if (g_strcmp0(cmd, "del_report_noti") == 0) {
650 _del_report_noti_func(app_control);
651 } else if (g_strcmp0(cmd, "insert_only_active_noti") == 0) {
652 _insert_only_active_noti_func(app_control);
653 } else if (g_strcmp0(cmd, "insert_ticker") == 0) {
654 _insert_ticker_func(app_control);
655 } else if (g_strcmp0(cmd, "sound_play_start") == 0) {
656 _sound_play_start_func(app_control);
657 } else if (g_strcmp0(cmd, "change_pm_state") == 0) {
658 _change_pm_state_func(app_control);
667 pthread_mutex_lock(&mx);
669 g_timeout_add_seconds(60, _check_app_terminate, NULL);
670 pthread_mutex_unlock(&mx);
675 int main(int argc, char* argv[])
677 service_app_lifecycle_callback_s event_callback = {0,};
679 event_callback.create = service_app_create;
680 event_callback.terminate = service_app_terminate;
681 event_callback.app_control = service_app_control;
683 return service_app_main(argc, argv, &event_callback, NULL);