Add to getter profile info when callmgr is initialized 36/146136/2
authorsinikang <sinikang@samsung.com>
Fri, 25 Aug 2017 05:57:11 +0000 (14:57 +0900)
committersinikang <sinikang@samsung.com>
Fri, 25 Aug 2017 06:31:04 +0000 (15:31 +0900)
Change-Id: I8b3e377e395297461f56882f7fe0b95aed26a7af

common/include/callmgr-util.h
common/src/callmgr-util.c
packaging/call-manager.spec
service/include/callmgr-core.h
service/src/callmgr-core.c

index 47be3eb..e6179aa 100644 (file)
@@ -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__
 
index 4344a7b..ca68b09 100644 (file)
@@ -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);
+}
index 1a527af..d92c93f 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 2
-%define patchlevel 25
+%define patchlevel 26
 %define ext_feature 0
 
 Name:           call-manager
index a6057bd..0ac8519 100644 (file)
@@ -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);
index ce68874..c2969c9 100644 (file)
@@ -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;
 }