power: remove power lock auto release feature with TV profile 26/82826/1 accepted/tizen/common/20160808.121143 accepted/tizen/ivi/20160809.011521 accepted/tizen/mobile/20160809.011442 accepted/tizen/tv/20160809.011450 accepted/tizen/wearable/20160809.011506 submit/tizen/20160808.034410
authortaeyoung <ty317.kim@samsung.com>
Mon, 8 Aug 2016 02:54:36 +0000 (11:54 +0900)
committertaeyoung <ty317.kim@samsung.com>
Mon, 8 Aug 2016 02:57:19 +0000 (11:57 +0900)
- TV profile does not have the libtracker, and build problems
  can be occurred with TV. Thus power lock auto release feature
  which is related with libtracker is disabled with TV.

Change-Id: I7c71ed715728dae214299651fd6bff7ef0d5a308
Signed-off-by: taeyoung <ty317.kim@samsung.com>
CMakeLists.txt
packaging/capi-system-device.spec
src/power.c

index 9b56a58..a6a39f9 100755 (executable)
@@ -10,15 +10,23 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED
+SET(PKG_MODULES
                dlog
                vconf
                capi-base-common
                capi-system-info
                gio-2.0
+)
+
+IF("${TIZEN_FEATURE_TRACKER}" STREQUAL "on")
+SET(PKG_MODULES ${PKG_MODULES}
                tracker
 )
+ADD_DEFINITIONS("-DTIZEN_FEATURE_TRACKER")
+ENDIF("${TIZEN_FEATURE_TRACKER}" STREQUAL "on")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${PKG_MODULES})
 FOREACH(flag ${${fw_name}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
index ca2d14d..cc57d41 100644 (file)
@@ -1,3 +1,9 @@
+%define TIZEN_FEATURE_TRACKER on
+
+%if "%{?profile}" == "tv"
+%define TIZEN_FEATURE_TRACKER off
+%endif
+
 Name:       capi-system-device
 Summary:    A Device library in TIZEN C API
 Version:    0.1.0
@@ -12,7 +18,9 @@ BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(gio-2.0)
+%if %{?TIZEN_FEATURE_TRACKER} == "on"
 BuildRequires:  pkgconfig(tracker)
+%endif
 
 %description
 A Device library in TIZEN C API package.
@@ -32,7 +40,10 @@ A Device library in TIZEN C API (Development) package.
 %build
 cp %{SOURCE1} .
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} \
+                -DMAJORVER=${MAJORVER} \
+                -DTIZEN_FEATURE_TRACKER=%{TIZEN_FEATURE_TRACKER}
+
 %__make %{?jobs:-j%jobs}
 
 %install
index 647c9a2..9087fc3 100644 (file)
 #include <stdlib.h>
 #include <stdbool.h>
 #include <errno.h>
+
+#ifdef TIZEN_FEATURE_TRACKER
 #include <tracker.h>
+#endif /* TIZEN_FEATURE_TRACKER */
 
 #include "power.h"
 #include "display.h"
@@ -83,6 +86,7 @@ static char *get_state_str(display_state_e state)
        return NULL;
 }
 
+#ifdef TIZEN_FEATURE_TRACKER
 static void remove_off_lock_timeout(void)
 {
        if (off_lock_timeout) {
@@ -202,6 +206,11 @@ static void add_off_lock_timeout(void)
        else
                _E("Failed to add Power Lock timeout handler");
 }
+#else
+#define add_off_lock_timeout()    do {} while (0)
+#define remove_off_lock_timeout() do {} while (0)
+#define remove_padding_timeout()  do {} while (0)
+#endif /* TIZEN_FEATURE_TRACKER */
 
 static void lock_cb(void *data, GVariant *result, GError *err)
 {