Use phone/contact pkg name as per profile 20/148220/2
authorsinikang <sinikang@samsung.com>
Thu, 7 Sep 2017 06:44:17 +0000 (15:44 +0900)
committersinikang <sinikang@samsung.com>
Thu, 7 Sep 2017 06:48:52 +0000 (15:48 +0900)
Change-Id: I511b04c6f0b5643c53d9554e71ba5525baf13f74

common/src/callmgr-util.c
module/src/callmgr-contact.c
packaging/call-manager.spec

index a7bf44bb4168232005151e3d09d27256fcf83a75..74c2ef33172775f42dd828e637235c77e5f6f3dc 100644 (file)
@@ -42,8 +42,6 @@
 #include "callmgr-vconf.h"
 #include "callmgr-contact.h"
 
-#define CALLUI_PKG_NAME "org.tizen.call-ui"
-#define W_CALLUI_PKG_NAME "org.tizen.w-call-ui"
 #define SOUND_PATH_SILENT      "silent"
 #define CALLMGR_POPUP_NAME "org.tizen.callmgr-popup"
 #define CALLMGR_CLI_SHOW_ID "*31#"
index 2936d690622944cfb8e085c5c6eebc8fb839bde6..7ea4a26d39ec836ff3281603c69856ef7effd223 100644 (file)
 #define NOTIFY_BLOCKED_CALL_ICON               tzplatform_mkpath(TZ_SYS_RO_APP, "org.tizen.call-ui/res/images/noti_icon_reject_auto.png")
 #define NOTIFY_BLOCKED_CALL_ICON_SUB   tzplatform_mkpath(TZ_SYS_RO_APP, "org.tizen.call-ui/res/images/noti_icon_reject_auto.png")
 
-#define PHONE_ICON             tzplatform_mkpath(TZ_SYS_RO_ICONS, "default/small/org.tizen.phone.png")
-#define INVALID_CT_INDEX -1
-
 #define CALL_MISSED_TAG                "CALL_MISSED"
 #define CALL_REC_REJECTED_TAG          "CALL_REC_REJECTED"
-#define CALL_DEFAULT_CALLER_ID "reserved:default_caller_id"
 
 /* Call-manager only have call_id / person_id matching data.*/
 /* With this person_id, callui will find other information*/
@@ -689,6 +685,7 @@ static void __callmgr_ct_add_notification(int missed_cnt)
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
        app_control_h service = NULL;
        gboolean b_is_single = true;
+       char *phone_pkg_name = NULL, *contact_pkg_name = NULL;
 
        unsigned int projection[] = {
                 _contacts_phone_log.person_id,
@@ -718,13 +715,21 @@ static void __callmgr_ct_add_notification(int missed_cnt)
                warn("Fail to notification_set_text_domain");
        }
 
+
+       /* To support wearable Call UI also since Tizen 4.0 version, should get pkg name base on profile */
+       _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_PHONE, &phone_pkg_name);
+       if (!phone_pkg_name) {
+               err("phone_pkg_name is NULL");
+               return;
+       }
+
        if (APP_CONTROL_ERROR_NONE != app_control_create(&service)) {
                err("Fail to app_control_create");
        } else if (service == NULL) {
                err("Fail to app_control_create");
        } else {
                dbg("Create service");
-               if (app_control_set_app_id(service, DIALER_PKG) != APP_CONTROL_ERROR_NONE) {
+               if (app_control_set_app_id(service, phone_pkg_name) != APP_CONTROL_ERROR_NONE) {
                        err("Fail to app_control_set_app_id");
                } else if (app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT)  != APP_CONTROL_ERROR_NONE) {
                        err("Fail to app_control_set_operation");
@@ -759,6 +764,7 @@ static void __callmgr_ct_add_notification(int missed_cnt)
 
                app_control_destroy(service);
        }
+       g_free(phone_pkg_name);
 
        g_snprintf(str_cnt, sizeof(str_cnt), "%d", missed_cnt);
        info("Notification string :[%s] [%s]", str_buf, str_cnt);
@@ -1018,7 +1024,14 @@ static void __callmgr_ct_add_notification(int missed_cnt)
                }
        }
 
-       noti_err = notification_set_pkgname(noti, CONTACTS_PKG);
+       _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_CONTACTS, &contact_pkg_name);
+       if (!contact_pkg_name) {
+               err("contact_pkg_name is NULL");
+               g_free(disp_img_path);
+               return;
+       }
+
+       noti_err = notification_set_pkgname(noti, contact_pkg_name);
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                err("Fail to notification_set_pkgname : %d", noti_err);
        }
@@ -1034,6 +1047,7 @@ static void __callmgr_ct_add_notification(int missed_cnt)
        }
 
        g_free(disp_img_path);
+       g_free(contact_pkg_name);
 }
 
 int _callmgr_ct_set_missed_call_notification(void)
@@ -1124,6 +1138,7 @@ static void __callmgr_ct_add_rec_reject_notification(char *number, int person_id
 
        int noti_flags = 0;
        char *disp_img_path = NULL;
+       char *phone_pkg_name = NULL, *contact_pkg_name = NULL;
 
        notification_h noti = NULL;
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
@@ -1135,6 +1150,13 @@ static void __callmgr_ct_add_rec_reject_notification(char *number, int person_id
                return;
        }
 
+       /* To support wearable Call UI also since Tizen 4.0 version, should get pkg name base on profile */
+       _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_PHONE, &phone_pkg_name);
+       if (!phone_pkg_name) {
+               err("phone_pkg_name is NULL");
+               return;
+       }
+
        noti_err = notification_set_tag(noti, CALL_REC_REJECTED_TAG);
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                          err("Fail to notification_set_tag : %d", noti_err);
@@ -1151,7 +1173,7 @@ static void __callmgr_ct_add_rec_reject_notification(char *number, int person_id
                err("Fail to app_control_create");
        } else {
                dbg("Create service");
-               if (app_control_set_app_id(service, DIALER_PKG) != APP_CONTROL_ERROR_NONE) {
+               if (app_control_set_app_id(service, phone_pkg_name) != APP_CONTROL_ERROR_NONE) {
                        err("Fail to app_control_set_app_id");
                } else if (app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT)  != APP_CONTROL_ERROR_NONE) {
                        err("Fail to app_control_set_operation");
@@ -1226,6 +1248,8 @@ static void __callmgr_ct_add_rec_reject_notification(char *number, int person_id
                app_control_destroy(service);
        }
 
+       g_free(phone_pkg_name);
+
        noti_err = notification_set_time(noti, time(NULL));
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                err("Fail to notification_set_time : %d", noti_err);
@@ -1279,11 +1303,19 @@ static void __callmgr_ct_add_rec_reject_notification(char *number, int person_id
        g_free(disp_img_path);
        disp_img_path = NULL;
 
-       noti_err = notification_set_pkgname(noti, CONTACTS_PKG);
+       _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_CONTACTS, &contact_pkg_name);
+       if (!contact_pkg_name) {
+               err("contact_pkg_name is NULL");
+               return;
+       }
+
+       noti_err = notification_set_pkgname(noti, contact_pkg_name);
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                err("Fail to notification_set_pkgname : %d", noti_err);
        }
 
+       g_free(contact_pkg_name);
+
        noti_err = notification_insert(noti, NULL);
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                err("Fail to notification_insert");
index 1e570f73860ae313f976102ac4f0223a273990a4..5ae8834cfed395d5b3d4dcca7cb648085c095705 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 2
-%define patchlevel 32
+%define patchlevel 33
 %define ext_feature 0
 
 Name:           call-manager