Remove unnecessary dependencies 40/126540/2
authorMyungki Lee <mk5004.lee@samsung.com>
Mon, 24 Apr 2017 07:26:36 +0000 (16:26 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Mon, 24 Apr 2017 07:26:36 +0000 (16:26 +0900)
- Removed unnecessary dependencies
- Test app will not be built by default

Change-Id: Ib030275208154df38208179757691ef07743575d
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
CMakeLists.txt
include/notification.h
packaging/notification.spec
src/notification.c
src/notification_internal.c
test-app/CMakeLists.txt

index 5282bad7d44cf94bd1b2438d296c2c9be2c533bd..612825e14ba5158231dd8c76187cb77456eb9bd8 100755 (executable)
@@ -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
index 71555d8dae451b7b55d8d570045e3fbaeb77e345..8b459e2c22327e3f08f4071254d45d0cc897eb56 100755 (executable)
@@ -21,7 +21,7 @@
 
 #include <time.h>
 #include <bundle.h>
-#include <app.h>
+#include <app_control.h>
 
 
 #include <notification_error.h>
index ec8e03981af407e4a919a2f806960a4a039d4e0e..10db520aba41e20490714eab2d5b054b3c430bb9 100755 (executable)
@@ -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)
index 1326dd72717dd34d624d0f560d1a6bea75120cd2..6b135cb9d4002006943fbf00ca03735b752a71bb 100755 (executable)
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
-#include <app.h>
-#include <app_internal.h>
-#include <app_manager.h>
+#include <app_control.h>
 #include <app_control_internal.h>
 #include <package_manager.h>
 #include <aul.h>
-#include <appsvc.h>
 #include <tizen.h>
 #include <vconf-keys.h>
 #include <vconf.h>
@@ -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;
                }
index fa1ab720b8a6bb2364050362f69fb24b9c94bcbe..33a9e93f62a7254bbd0fe04eac6c4ff6d2f25e8a 100755 (executable)
 #include <dbus/dbus-glib-lowlevel.h>
 #include <gio/gio.h>
 
-#include <app.h>
+#include <app_control.h>
 #include <app_control_internal.h>
 #include <aul.h>
-#include <appsvc.h>
 #include <tizen.h>
 #include <vconf-keys.h>
 #include <vconf.h>
index f99b4094bea48a4bb408879c1fdcc41300ff8afb..458ad386f43d8f790a101455509908a7d1541d77 100644 (file)
@@ -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}")