From 4f735f510c201963b01f428fea1d8f15396ea608 Mon Sep 17 00:00:00 2001 From: sinikang Date: Fri, 25 Aug 2017 14:57:11 +0900 Subject: [PATCH] Add to getter profile info when callmgr is initialized Change-Id: I8b3e377e395297461f56882f7fe0b95aed26a7af --- common/include/callmgr-util.h | 2 ++ common/src/callmgr-util.c | 15 +++++++++++++-- packaging/call-manager.spec | 2 +- service/include/callmgr-core.h | 1 + service/src/callmgr-core.c | 4 ++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/common/include/callmgr-util.h b/common/include/callmgr-util.h index 47be3eb..e6179aa 100644 --- a/common/include/callmgr-util.h +++ b/common/include/callmgr-util.h @@ -154,6 +154,8 @@ int _callmgr_util_service_check_voice_mail(char *phonenumber, int sim_slot, gboo char *_callmgr_util_get_multiuser_path(char *path); void _callmgr_util_get_model_name(char **model_name); +void _callmgr_util_get_profile(char **profile); + #endif //__CALLMGR_UTIL_H__ diff --git a/common/src/callmgr-util.c b/common/src/callmgr-util.c index 4344a7b..ca68b09 100644 --- a/common/src/callmgr-util.c +++ b/common/src/callmgr-util.c @@ -425,8 +425,7 @@ int _callmgr_util_is_callui_running(gboolean *is_callui_running) running = aul_app_is_running_for_uid(CALLUI_PKG_NAME, uid); } else if (!g_strcmp0(profile, "wearable")) { running = aul_app_is_running_for_uid(W_CALLUI_PKG_NAME, uid); - } - else { + } else { err("call app is not supported on this profile"); return 0; } @@ -971,3 +970,15 @@ void _callmgr_util_get_model_name(char **model_name) dbg("model_name: %s", *model_name); } +void _callmgr_util_get_profile(char **profile) +{ + int ret; + + ret = system_info_get_platform_string("tizen.org/feature/profile", profile); + if (ret != SYSTEM_INFO_ERROR_NONE) { + err("system_info_get_platform_string() failed!!! (%d,%s)", ret, get_error_message(ret)); + return; + } + + dbg("profile: %s", *profile); +} diff --git a/packaging/call-manager.spec b/packaging/call-manager.spec index 1a527af..d92c93f 100644 --- a/packaging/call-manager.spec +++ b/packaging/call-manager.spec @@ -1,6 +1,6 @@ %define major 0 %define minor 2 -%define patchlevel 25 +%define patchlevel 26 %define ext_feature 0 Name: call-manager diff --git a/service/include/callmgr-core.h b/service/include/callmgr-core.h index a6057bd..0ac8519 100644 --- a/service/include/callmgr-core.h +++ b/service/include/callmgr-core.h @@ -199,6 +199,7 @@ typedef struct _callmgr_core_data { guint audio_routing_subs_id; /* Subscribe-Id for audio routing */ char *model_name; + char *profile; } callmgr_core_data_t; int _callmgr_core_init(callmgr_core_data_t **o_core_data); diff --git a/service/src/callmgr-core.c b/service/src/callmgr-core.c index ce68874..c2969c9 100644 --- a/service/src/callmgr-core.c +++ b/service/src/callmgr-core.c @@ -2049,6 +2049,8 @@ int _callmgr_core_init(callmgr_core_data_t **o_core_data) if (!g_strcmp0(core_data->model_name, "TM1")) _callmgr_core_init_dbus_call_routing_status(core_data); + _callmgr_util_get_profile(&core_data->profile); + _callmgr_telephony_init(&core_data->telephony_handle, __callmgr_core_process_telephony_events, core_data); CM_RETURN_VAL_IF_FAIL(core_data->telephony_handle, -1); @@ -2097,6 +2099,8 @@ int _callmgr_core_deinit(callmgr_core_data_t *core_data) if (core_data->model_name) free(core_data->model_name); + if (core_data->profile) + free(core_data->profile); g_free(core_data); return 0; } -- 2.7.4