Use pkg name as per profile when using badge interface 35/148635/1
authorsinikang <sinikang@samsung.com>
Fri, 8 Sep 2017 07:41:38 +0000 (16:41 +0900)
committersinikang <sinikang@samsung.com>
Fri, 8 Sep 2017 07:41:38 +0000 (16:41 +0900)
Change-Id: Ic5e76f94a7f0bb4ed08618b4d4c8ec8a165eb4ef

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

index 7ea4a26d39ec836ff3281603c69856ef7effd223..e15235757adca72e89159d766c1c36df0c510eaa 100644 (file)
 #include "callmgr-vconf.h"
 #include "callmgr-log.h"
 
-#define CONTACTS_PKG   "org.tizen.contacts"
-#define DIALER_PKG             "org.tizen.phone"
-#define CLOUD_PKG              "/usr/bin/cloud-pdm-server"
-
 #define NOTIFY_MISSED_CALL_ICON                        tzplatform_mkpath(TZ_SYS_RO_APP, "org.tizen.quickpanel/shared/res/noti_icons/Contact/noti_contact_default.png")
 #define NOTIFY_MISSED_CALL_IND_ICON            tzplatform_mkpath(TZ_SYS_RO_APP, "org.tizen.quickpanel/shared/res/noti_icons/Lock screen/noti_missed_call.png")
 #define NOTIFY_MISSED_CALL_ICON_SUB            tzplatform_mkpath(TZ_SYS_RO_APP, "org.tizen.quickpanel/shared/res/noti_icons/Contact/noti_icon_missed.png")
@@ -546,20 +542,47 @@ static void __callmgr_ct_update_dialer_badge(int missed_cnt)
 {
        bool bbadge_exist = FALSE;
        badge_error_e err = BADGE_ERROR_NONE;
+       const char w_badge[] = "org.tizen.w-phone,/usr/bin/cloud-pdm-server,org.tizen.w-contacts";
+       const char m_badge[] = "org.tizen.phone,/usr/bin/cloud-pdm-server,org.tizen.contacts";
+       char *profile = NULL, *phone_pkg_name = NULL;
 
        dbg("__callmgr_ct_update_dialer_badge: missed_cnt(%d)", missed_cnt);
 
-       err = badge_is_existing(DIALER_PKG, &bbadge_exist);
+       /* To support wearable Call UI also since Tizen 4.0 version, should get pkg name base on profile */
+       _callmgr_util_get_profile(&profile);
+       if (!profile) {
+               err("profile is NULL");
+               return;
+       }
+
+       _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_PHONE, &phone_pkg_name);
+       if (!phone_pkg_name) {
+               err("pkg_name is NULL");
+               g_free(profile);
+               return;
+       }
+
+       err = badge_is_existing(phone_pkg_name, &bbadge_exist);
        if (err == BADGE_ERROR_NONE && bbadge_exist == FALSE) {
-               err = badge_create(DIALER_PKG, DIALER_PKG","CLOUD_PKG","CONTACTS_PKG);
+               if (!g_strcmp0(profile, "wearable"))
+                       err = badge_create(phone_pkg_name, w_badge);
+               else
+                       err = badge_create(phone_pkg_name, m_badge);
+
                if (err != BADGE_ERROR_NONE) {
                        err("badge_create failed: err(%d)", err);
 
+                       g_free(profile);
+                       g_free(phone_pkg_name);
                        return;
                }
        }
 
-       badge_set_count(DIALER_PKG, missed_cnt);
+       badge_set_count(phone_pkg_name, missed_cnt);
+
+       g_free(profile);
+       g_free(phone_pkg_name);
+
 }
 
 static int __callmgr_ct_get_missed_call_count(void)
index 05d7e09e85527336ff0117464ec2a9fb29aec010..16394073ff73fc1d90c9a6076826194359d25cda 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 2
-%define patchlevel 34
+%define patchlevel 35
 %define ext_feature 0
 
 Name:           call-manager