eliminate heynoti
authorYong Song <yong.song@samsung.com>
Tue, 3 Sep 2013 01:54:02 +0000 (10:54 +0900)
committerYong Song <yong.song@samsung.com>
Tue, 3 Sep 2013 01:54:02 +0000 (10:54 +0900)
Change-Id: Idcfe9645dcdbb0fad038bcbdc190a03a040f553e

packaging/osp-appfw.spec
src/CMakeLists.txt
src/app/FApp_AppImpl.cpp
src/app/FApp_Aul.cpp
src/app/inc/FApp_AppImpl.h
src/app/inc/FApp_Aul.h
src/server/CMakeLists.txt
src/server/app/FApp_AulServer.cpp
src/server/inc/FApp_AulServer.h

index 5fb14d9..b388b54 100644 (file)
@@ -39,7 +39,6 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(dukgenerator)
 BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(heynoti)
 BuildRequires: pkgconfig(elementary)
 BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(evas)
index de9d75c..8224bd4 100644 (file)
@@ -15,7 +15,6 @@ pkg_check_modules(pkgs REQUIRED
        ecore
        glib-2.0
        haptic
-       heynoti
        badge
        icu-i18n
        iniparser
index 79b0799..edf7e4d 100644 (file)
@@ -1388,20 +1388,32 @@ _AppImpl::IsTerminationRequested(void)
 }
 
 void
-_AppImpl::OnPowerOffNotiReceived(void* user_data)
+_AppImpl::OnPowerOffNotiReceived(keynode_t* node, void* user_data)
 {
-       SysLog(NID_APP, "Application is being terminated by power off.");
-
-       _AppImpl* pAppImpl = _AppImpl::GetInstance();
-       if (pAppImpl != null)
+       int value = -1;
+       if (!vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &value))
        {
-               pAppImpl->__forcedTermination = true;
+               if (value == VCONFKEY_SYSMAN_POWER_OFF_DIRECT || value == VCONFKEY_SYSMAN_POWER_OFF_RESTART)
+               {
+                       SysLog(NID_APP, "Application is being terminated by power off.");
+
+                       if (vconf_ignore_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, _AppImpl::OnPowerOffNotiReceived))
+                       {
+                               SysLog(NID_APP, "Fail to ignore vconf for key(%s)", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
+                       }
+
+                       _AppImpl* pAppImpl = _AppImpl::GetInstance();
+                       if (pAppImpl != null)
+                       {
+                               pAppImpl->__forcedTermination = true;
+                       }
+
+                       app_efl_exit();
+               }
        }
-       
-       app_efl_exit();
 }
 
-bool 
+bool
 _AppImpl::IsForcedTermination(void)
 {
        return __forcedTermination;
index 391773c..6846198 100644 (file)
@@ -29,7 +29,7 @@
 #include <aul.h>
 #include <bundle.h>
 #include <appsvc/appsvc.h>
-#include <heynoti.h>
+#include <vconf.h>
 
 #include <FBaseObject.h>
 #include <FBaseString.h>
@@ -203,9 +203,15 @@ _Aul::SetOomAdj(int pid, int adj)
        return r;
 }
 
+
 result
-_Aul::SetPowerOffNotiListener( void (*powerOffCb)(void *pData), void *pData)
+_Aul::SetPowerOffNotiListener( void (*powerOffCb)(keynode_t* node, void *pData), void *pData)
 {
+
+#if 1
+       int ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, powerOffCb, pData);
+       SysTryReturnResult(NID_SYS, ret == 0, E_SYSTEM, "It failed to set power off");
+#else
        int heyFd = heynoti_init();
        SysTryReturnResult(NID_APP, heyFd >= 0, E_SYSTEM, "heynoti_init failed.");
 
@@ -214,6 +220,7 @@ _Aul::SetPowerOffNotiListener( void (*powerOffCb)(void *pData), void *pData)
 
        ret = heynoti_attach_handler(heyFd);
        SysTryReturnResult(NID_APP, ret >= 0, E_SYSTEM, "heynoti_attach_handler failed.");
+#endif
 
        return E_SUCCESS;
 }
index 3867fca..1b83c5e 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef _FAPP_INTERNAL_APP_IMPL_H_
 #define _FAPP_INTERNAL_APP_IMPL_H_
 
+#include <vconf.h>
+
 #include <FAppApp.h>
 #include <FSysBattery.h>
 #include <FBaseRtIEventListener.h>
@@ -32,7 +34,6 @@
 
 struct service_s;
 
-
 namespace Tizen { namespace Base { namespace Runtime
 {
 class IEventListener;
@@ -247,7 +248,7 @@ public:
 
        bool IsForcedTermination(void);
 
-       static void OnPowerOffNotiReceived(void* pData);
+       static void OnPowerOffNotiReceived(_keynode_t* node, void* pData);
 
 private:
        /**
index 7774bb6..9fdcde2 100644 (file)
@@ -23,6 +23,7 @@
 #define _FAPP_INTERNAL_AUL_H_
 
 #include <appsvc/appsvc.h>
+#include <vconf.h>
 #include <FOspConfig.h>
 #include <FAppTypes.h>
 
@@ -54,7 +55,7 @@ public:
 
        static result SetOomAdj(int pid, int adj);
 
-       static result SetPowerOffNotiListener(void (*powerOffCb)(void *pData), void *pData);
+       static result SetPowerOffNotiListener(void (*powerOffCb)(keynode_t* node, void *pData), void *pData);
 
        static int GetAppType(const Tizen::Base::String& category);
 
index 362a2e7..5ce6135 100644 (file)
@@ -27,7 +27,6 @@ pkg_check_modules(server_pkgs REQUIRED
        chromium
        dukgenerator
        glib-2.0
-       heynoti
        pkgmgr-info
 )
 
index 91aff1a..fd37fc9 100755 (executable)
@@ -29,7 +29,6 @@
 #include <aul.h>
 #include <bundle.h>
 #include <appsvc/appsvc.h>
-#include <heynoti.h>
 
 #include <FBaseObject.h>
 #include <FBaseString.h>
@@ -217,21 +216,6 @@ _AulServer::SetOomAdj(int pid, int adj)
        return r;
 }
 
-result
-_AulServer::SetPowerOffNotiListener( void (*powerOffCb)(void *pData), void *pData)
-{
-       int heyFd = heynoti_init();
-       SysTryReturnResult(NID_APP, heyFd >= 0, E_SYSTEM, "heynoti_init failed.");
-
-       int ret = heynoti_subscribe(heyFd, "power_off_start", powerOffCb, pData);
-       SysTryReturnResult(NID_APP, ret >= 0, E_SYSTEM, "heynoti_subscribe failed.");
-
-       ret = heynoti_attach_handler(heyFd);
-       SysTryReturnResult(NID_APP, ret >= 0, E_SYSTEM, "heynoti_attach_handler failed.");
-
-       return E_SUCCESS;
-}
-
 int
 _AulServer::GetAppType(const String& category)
 {
index ab22aea..22c34dc 100755 (executable)
@@ -53,8 +53,6 @@ public:
 
        static result SetOomAdj(int pid, int adj);
 
-       static result SetPowerOffNotiListener(void (*powerOffCb)(void *pData), void *pData);
-
        static int GetAppType(const Tizen::Base::String& category);
 
        static bool IsInstalled(const AppId& appId);