Fix a bug when package id of notification can not be found 94/103994/1 accepted/tizen/3.0/common/20161213.163501 accepted/tizen/3.0/ivi/20161213.023945 accepted/tizen/3.0/mobile/20161213.023903 accepted/tizen/3.0/tv/20161213.023914 accepted/tizen/3.0/wearable/20161213.023935 accepted/tizen/common/20161212.185527 accepted/tizen/ivi/20161213.002815 accepted/tizen/mobile/20161213.002740 accepted/tizen/tv/20161213.002759 accepted/tizen/wearable/20161213.002806 submit/tizen/20161212.053618 submit/tizen_3.0/20161212.020133
authorSungbae Yoo <sungbae.yoo@samsung.com>
Mon, 12 Dec 2016 05:10:18 +0000 (14:10 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Mon, 12 Dec 2016 05:10:18 +0000 (14:10 +0900)
Change-Id: Iac68eef4333f13228709a0a755162fd9e7ddadb9
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
data/default_icon.png [new file with mode: 0755]
packaging/krate.spec
server/CMakeLists.txt
server/manager.cpp

diff --git a/data/default_icon.png b/data/default_icon.png
new file mode 100755 (executable)
index 0000000..9765b1b
Binary files /dev/null and b/data/default_icon.png differ
index fa9ee49..1050b89 100644 (file)
@@ -38,6 +38,7 @@ krates.
 %attr(700,root,root) %{_sbindir}/krate-volume-manager
 %{_unitdir}/krate.service
 %{_unitdir}/multi-user.target.wants/krate.service
+%attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/default_icon.png
 %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/shortcut_icon.png
 %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/indicator_icon.png
 %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/notification_sub_icon.png
index 91bc477..0cdaa7e 100644 (file)
@@ -64,6 +64,7 @@ CONFIGURE_FILE(systemd/krate.service.in systemd/krate.service)
 INSTALL(TARGETS ${SERVER_NAME} DESTINATION ${BIN_DIR})
 INSTALL(FILES systemd/krate.service DESTINATION ${SYSTEMD_UNIT_DIR})
 
+INSTALL(FILES ${KRATE_DATA}/default_icon.png DESTINATION ${ICON_DIR})
 INSTALL(FILES ${KRATE_DATA}/indicator_icon.png DESTINATION ${ICON_DIR})
 INSTALL(FILES ${KRATE_DATA}/notification_sub_icon.png DESTINATION ${ICON_DIR})
 INSTALL(FILES ${KRATE_DATA}/shortcut_icon.png DESTINATION ${ICON_DIR})
index c96e877..1acd6d9 100644 (file)
@@ -42,6 +42,7 @@
 #include "rmi/manager.h"
 
 #define KRATE_DELEGATOR_APP  "org.tizen.keyguard"
+#define DEFAULT_ICON_PATH  ICON_PATH "/default_icon.png"
 #define NOTIFICATION_SUB_ICON_PATH  ICON_PATH "/notification_sub_icon.png"
 
 namespace Krate {
@@ -344,8 +345,13 @@ void notiProxyInsert(const runtime::User& owner, const runtime::User& user, int
        notification_clone(noti, &newNoti);
 
        notification_get_pkgname(noti, &pkgId);
-       PackageInfo pkg(pkgId, user.getUid());
-       notification_set_image(newNoti, NOTIFICATION_IMAGE_TYPE_ICON, pkg.getIcon().c_str());
+       try {
+               PackageInfo pkg(pkgId, user.getUid());
+               notification_set_image(newNoti, NOTIFICATION_IMAGE_TYPE_ICON, pkg.getIcon().c_str());
+       } catch (runtime::Exception &e) {
+               notification_set_image(newNoti, NOTIFICATION_IMAGE_TYPE_ICON, DEFAULT_ICON_PATH);
+       }
+
        notification_set_image(newNoti, NOTIFICATION_IMAGE_TYPE_ICON_SUB, NOTIFICATION_SUB_ICON_PATH);
 
        notification_get_launch_option(newNoti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)&appControl);