From: Myungki Lee Date: Mon, 24 Apr 2017 07:26:36 +0000 (+0900) Subject: Remove unnecessary dependencies X-Git-Tag: submit/tizen/20170427.055106~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b59d0a394a835393aa508dba0a1293be589a514;p=platform%2Fcore%2Fapi%2Fnotification.git Remove unnecessary dependencies - Removed unnecessary dependencies - Test app will not be built by default Change-Id: Ib030275208154df38208179757691ef07743575d Signed-off-by: Myungki Lee --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5282bad7..612825e1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ SET(EXEC_PREFIX "\${prefix}") SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") -ADD_SUBDIRECTORY(test-app) +#ADD_SUBDIRECTORY(test-app) SET(INIT-SRCS ./src/notification_init.c @@ -54,12 +54,9 @@ pkg_check_modules(pkgs REQUIRED bundle dlog aul - appsvc dbus-1 dbus-glib-1 - appcore-common - capi-appfw-application - capi-appfw-app-manager + capi-appfw-app-control capi-appfw-package-manager pkgmgr-info libtzplatform-config diff --git a/include/notification.h b/include/notification.h index 71555d8d..8b459e2c 100755 --- a/include/notification.h +++ b/include/notification.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include diff --git a/packaging/notification.spec b/packaging/notification.spec index ec8e0398..10db520a 100755 --- a/packaging/notification.spec +++ b/packaging/notification.spec @@ -13,11 +13,8 @@ BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(aul) -BuildRequires: pkgconfig(appsvc) BuildRequires: pkgconfig(dbus-glib-1) -BuildRequires: pkgconfig(appcore-common) -BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(capi-appfw-app-control) BuildRequires: pkgconfig(capi-appfw-package-manager) BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(libtzplatform-config) diff --git a/src/notification.c b/src/notification.c index 1326dd72..6b135cb9 100755 --- a/src/notification.c +++ b/src/notification.c @@ -23,13 +23,10 @@ #include #include -#include -#include -#include +#include #include #include #include -#include #include #include #include @@ -1392,6 +1389,27 @@ EXPORT_API int notification_delete(notification_h noti) return notification_delete_for_uid(noti, getuid()); } +static int _notification_get_app_name(const char *appid, char **name) +{ + char *name_token = NULL; + + if (appid == NULL) + return -1; + + /* com.vendor.name -> name */ + name_token = strrchr(appid, '.'); + if (name_token == NULL) + return -1; + + name_token++; + + *name = strdup(name_token); + if (*name == NULL) + return -1; + + return 0; +} + static notification_h _notification_create(notification_type_e type) { notification_h noti = NULL; @@ -1452,9 +1470,9 @@ static notification_h _notification_create(notification_type_e type) goto out; } - err = app_get_package_app_name(pkgid, &domain_name); - if (err != APP_ERROR_NONE || domain_name == NULL) { - NOTIFICATION_WARN("app_get_package_app_name failed err[%d] domain_name[%p]", + err = _notification_get_app_name(pkgid, &domain_name); + if (err != 0 || domain_name == NULL) { + NOTIFICATION_WARN("_notification_get_app_name failed err[%d] domain_name[%p]", err, domain_name); goto out; } diff --git a/src/notification_internal.c b/src/notification_internal.c index fa1ab720..33a9e93f 100755 --- a/src/notification_internal.c +++ b/src/notification_internal.c @@ -24,10 +24,9 @@ #include #include -#include +#include #include #include -#include #include #include #include diff --git a/test-app/CMakeLists.txt b/test-app/CMakeLists.txt index f99b4094..458ad386 100644 --- a/test-app/CMakeLists.txt +++ b/test-app/CMakeLists.txt @@ -28,7 +28,7 @@ INCLUDE_DIRECTORIES( ) INCLUDE(FindPkgConfig) -pkg_check_modules(test_app_pkgs REQUIRED glib-2.0 gthread-2.0 vconf appsvc capi-appfw-application libtzplatform-config) +pkg_check_modules(test_app_pkgs REQUIRED glib-2.0 gthread-2.0 vconf capi-appfw-app-control libtzplatform-config) FOREACH(flag ${test_app_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")