Remove legacy code for supporting Tizen 2.x 89/89889/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 27 Sep 2016 09:48:11 +0000 (18:48 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 27 Sep 2016 09:48:11 +0000 (18:48 +0900)
Change-Id: I72de805a528a52dfae1efc60f4a6680c59be3d27
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
CMakeLists.txt
packaging/context.spec
src/context_trigger.cpp

index fd8c38f69e2507eafdfa4cc7c09722e116ba8326..cc56dabcd96f21b590ec9afd51aba12a401b73e5 100644 (file)
@@ -12,10 +12,6 @@ MESSAGE("Sources: ${SRCS}")
 # Dependencies
 SET(DEPS "gio-2.0 context-common aul bundle capi-appfw-app-control pkgmgr-info")
 
-IF(${SYSTEM_SERVICE})
-       ADD_DEFINITIONS(-DSYSTEM_SERVICE)
-ENDIF(${SYSTEM_SERVICE})
-
 # Common Options
 INCLUDE(FindPkgConfig)
 INCLUDE_DIRECTORIES(
@@ -24,10 +20,6 @@ INCLUDE_DIRECTORIES(
 ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden)
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
 
-IF(${LEGACY_APPFW})
-       ADD_DEFINITIONS(-DLEGACY_APPFW)
-ENDIF(${LEGACY_APPFW})
-
 # Building Library
 pkg_check_modules(api_pkg REQUIRED ${DEPS})
 
index ed1d1ddf90a5847b67b8427f237e369e71a22cc4..ed7deab8d1c6762364f923584e7fcdcc340de4e7 100644 (file)
@@ -6,9 +6,6 @@ Group:      Service/Context
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 
-%define SYSTEM_SERVICE 0
-%define LEGACY_APPFW   0
-
 BuildRequires: cmake
 BuildRequires: pkgconfig(gio-2.0)
 BuildRequires: pkgconfig(context-common)
@@ -42,22 +39,13 @@ export CXXFLAGS+=" -std=c++0x"
 #export   CFLAGS+=" -Wcast-qual"
 #export CXXFLAGS+=" -Wcast-qual"
 
-#export   CFLAGS+=" -DTIZEN_ENGINEER_MODE"
-#export CXXFLAGS+=" -DTIZEN_ENGINEER_MODE"
-#export   FFLAGS+=" -DTIZEN_ENGINEER_MODE"
-
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
-                                                          -DSYSTEM_SERVICE=%{SYSTEM_SERVICE} \
-                                                          -DLEGACY_APPFW=%{LEGACY_APPFW}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
 make %{?jobs:-j%jobs}
 
 %install
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE %{buildroot}/usr/share/license/%{name}
-
 %post
 /sbin/ldconfig
 
@@ -68,7 +56,7 @@ cp LICENSE %{buildroot}/usr/share/license/%{name}
 %manifest packaging/%{name}.manifest
 %defattr(-,root,root,-)
 %{_libdir}/*.so*
-/usr/share/license/%{name}
+%license LICENSE
 
 %package devel
 Summary:    Tizen Context Framework Native API (Development)
index ba1deccd4b66cbb423c780cd2fca0b176d89deb6..6836145eb02a8472496adafbadbf8819b1dbfee6 100644 (file)
 #include <DBusClient.h>
 #include <app_control_internal.h>
 #include <bundle.h>
-
-#ifndef LEGACY_APPFW
 #include <bundle_internal.h>
-#endif
 
 #include <context_trigger.h>
 #include <context_trigger_internal.h>
@@ -384,15 +381,11 @@ SO_EXPORT int context_trigger_rule_set_action_app_control(context_trigger_rule_h
        IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "Failed to get app id");
 
        pkgmgrinfo_appinfo_h app_info;
-#ifdef LEGACY_APPFW
-       error = pkgmgrinfo_appinfo_get_appinfo(app_id, &app_info);
-#else
        error = pkgmgrinfo_appinfo_get_usr_appinfo(app_id, getuid(), &app_info);
-#endif
        g_free(app_id);
        IF_FAIL_RETURN_TAG(error == PMINFO_R_OK, CONTEXT_TRIGGER_ERROR_INVALID_RULE, _E, "No such app");
 
-#ifndef _ALLOW_SERVICE_APP_TRIGGER_
+       // Service apps are not allowed to be launched (Mobile & Wearable)
        char *app_type = NULL;
        pkgmgrinfo_appinfo_get_component_type(app_info, &app_type);
        if (!strcmp(app_type, "svcapp")) {
@@ -400,7 +393,6 @@ SO_EXPORT int context_trigger_rule_set_action_app_control(context_trigger_rule_h
                pkgmgrinfo_appinfo_destroy_appinfo(app_info);
                return CONTEXT_TRIGGER_ERROR_INVALID_RULE;
        }
-#endif
        pkgmgrinfo_appinfo_destroy_appinfo(app_info);
 
        // Set action type
@@ -446,11 +438,7 @@ SO_EXPORT int context_trigger_rule_set_action_notification(context_trigger_rule_
                IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "Failed to get app id");
 
                pkgmgrinfo_appinfo_h app_info;
-#ifdef LEGACY_APPFW
-               error = pkgmgrinfo_appinfo_get_appinfo(app_id, &app_info);
-#else
                error = pkgmgrinfo_appinfo_get_usr_appinfo(app_id, getuid(), &app_info);
-#endif
                g_free(app_id);
                IF_FAIL_RETURN_TAG(error == PMINFO_R_OK, CONTEXT_TRIGGER_ERROR_INVALID_RULE, _E, "No such app");
        }
@@ -558,11 +546,7 @@ SO_EXPORT int context_trigger_rule_custom_event_create(const char* event_item, c
 
        // Err: Invalid provider
        pkgmgrinfo_pkginfo_h pkg_info;
-#ifdef LEGACY_APPFW
-       int error = pkgmgrinfo_pkginfo_get_pkginfo(provider, &pkg_info);
-#else
        int error = pkgmgrinfo_pkginfo_get_usr_pkginfo(provider, getuid(), &pkg_info);
-#endif
        pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_info);
        IF_FAIL_RETURN_TAG(error == PMINFO_R_OK, CONTEXT_TRIGGER_ERROR_INVALID_DATA, _E, "No such package");
 
@@ -639,11 +623,7 @@ SO_EXPORT int context_trigger_rule_custom_condition_create(const char* condition
 
        // Err: Invalid provider
        pkgmgrinfo_pkginfo_h pkg_info;
-#ifdef LEGACY_APPFW
-       int error = pkgmgrinfo_pkginfo_get_pkginfo(provider, &pkg_info);
-#else
        int error = pkgmgrinfo_pkginfo_get_usr_pkginfo(provider, getuid(), &pkg_info);
-#endif
        pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_info);
        IF_FAIL_RETURN_TAG(error == PMINFO_R_OK, CONTEXT_TRIGGER_ERROR_INVALID_DATA, _E, "No such package");