FILE(GLOB DAEMON_SRCS ${DAEMON_SRCS} ../msf_tizen_client/src/*.cpp)
SET(provider_deps "glib-2.0 dlog json-glib-1.0 jsoncpp iotcon capi-appfw-app-manager vconf capi-network-bluetooth capi-appfw-application bundle capi-network-connection cynara-creds-gdbus cynara-client cynara-session capi-appfw-package-manager sqlite3 syspopup-caller")
-SET(provider_deps "${provider_deps} openssl libwebsockets libcurl nsd-dns-sd")
+SET(provider_deps "${provider_deps} openssl libwebsockets libcurl nsd-dns-sd capi-system-info")
#SET(provider_deps "${provider_deps} capi-network-wifi-direct")
# Wearable profile
# TV profile
IF("${PROFILE}" STREQUAL "tv")
ADD_DEFINITIONS("-D_TV_")
- IF(${D2D_INTERNAL_ACL} EQUAL 0)
- SET(provider_deps "${provider_deps} capi-register-device")
- ENDIF(${D2D_INTERNAL_ACL} EQUAL 0)
+ IF(${PRODUCT_TV} EQUAL 1)
+ SET(provider_deps "${provider_deps} capi-register-device deviced")
+ ADD_DEFINITIONS("-DTIZEN_PRODUCT_TV")
+ ENDIF(${PRODUCT_TV} EQUAL 1)
ENDIF("${PROFILE}" STREQUAL "tv")
-IF(${D2D_INTERNAL_ACL} EQUAL 1)
+IF(${PRODUCT_TV} EQUAL 0)
ADD_DEFINITIONS("-D_D2D_INTERNAL_ACL_")
-ENDIF(${D2D_INTERNAL_ACL} EQUAL 1)
+ENDIF(${PRODUCT_TV} EQUAL 0)
pkg_check_modules(daemon_pkgs REQUIRED ${provider_deps})
#include <new>
#include <gio/gio.h>
+#if defined(TIZEN_PRODUCT_TV)
+#include <fstream>
+#include <system_info.h>
+#include <dd-power.h>
+#endif
#include "d2d_conv_manager.h"
#include "Server.h"
static conv::ServiceManager *serviceMgr = NULL;
static conv::RequestHandler *requestMgr = NULL;
+#if defined(TIZEN_PRODUCT_TV)
+static int __device_inactive_cb(device_poweroff_info *info, void *data);
+#endif
+
void conv::initialize()
{
int result;
+#if defined(TIZEN_PRODUCT_TV)
+ bool isFrameTv = false;
+#endif
if (started) {
_D("flowd is started already");
result = dbusHandle->init();
IF_FAIL_CATCH_TAG(result == true, _E, "Initialization Failed");
+#if defined(TIZEN_PRODUCT_TV)
+ if (system_info_get_value_bool(SYSTEM_INFO_KEY_FRAME_TV, &isFrameTv) != SYSTEM_INFO_ERROR_NONE) {
+ _E("failed to get frame tv support option");
+ }
+
+ if (isFrameTv) {
+ if (device_power_subscribe_poweroff_event(__device_inactive_cb, NULL) != 0) {
+ _E("Fail to subscribe power off callback function");
+ }
+ }
+#endif
+
_I("Start main loop");
started = TRUE;
}
}
+#if defined(TIZEN_PRODUCT_TV)
+static int __device_inactive_cb(device_poweroff_info *info, void *data)
+{
+ if (info && info->inactive_mode) {
+ _I("INACTIVE mode");
+ std::ofstream nodeFile;
+ nodeFile.open("/dev/pwsv_mode", std::ios::out);
+ if (!nodeFile.is_open()) {
+ _E("can not open node (/dev/pwsv_mode) for enable inactive mode");
+ return -1;
+ }
+
+ char cmd[256] = {0, };
+ snprintf(cmd, 256, "INACT %ld", (long)getpid());
+ _D("cmd = %s", cmd);
+ nodeFile << cmd;
+ nodeFile.close();
+ }
+
+ return 0;
+}
+#endif
+
int main(int argc, char **argv)
{
static struct sigaction signal_action;
Source1002: lib%{name}.manifest
%define BUILD_PROFILE %{?profile}%{!?profile:%{?tizen_profile_name}}
-%define INTERNAL_ACL %{?TIZEN_PROFILE_TV:0}%{!?TIZEN_PROFILE_TV:1}
+%define PRODUCT_TV %{?TIZEN_PROFILE_TV:1}%{!?TIZEN_PROFILE_TV:0}
BuildRequires: cmake
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: libcurl-devel
%if "%{?BUILD_PROFILE}" == "tv"
-%if %{?INTERNAL_ACL} == 0
+%if %{?PRODUCT_TV} == 1
BuildRequires: pkgconfig(capi-register-device)
+BuildRequires: pkgconfig(deviced)
%endif
%endif
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} -DPROFILE=%{?BUILD_PROFILE} -DD2D_INTERNAL_ACL=%{?INTERNAL_ACL}
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} -DPROFILE=%{?BUILD_PROFILE} -DPRODUCT_TV=%{?PRODUCT_TV}
%install
ln -s ../%{name}.service %{_unitdir_user}/default.target.wants/
/sbin/ldconfig
-%if %{?INTERNAL_ACL} == 1
+%if %{?PRODUCT_TV} == 0
mkdir -p %{TZ_SYS_DB}
if [ ! -f %{TZ_SYS_DB}/.convergence.db ]