From 16dc5ed68bdae07e073db79e00a15e56ad71da8a Mon Sep 17 00:00:00 2001 From: Yong Song Date: Tue, 3 Sep 2013 10:54:02 +0900 Subject: [PATCH] eliminate heynoti Change-Id: Idcfe9645dcdbb0fad038bcbdc190a03a040f553e --- packaging/osp-appfw.spec | 1 - src/CMakeLists.txt | 1 - src/app/FApp_AppImpl.cpp | 30 +++++++++++++++++++++--------- src/app/FApp_Aul.cpp | 11 +++++++++-- src/app/inc/FApp_AppImpl.h | 5 +++-- src/app/inc/FApp_Aul.h | 3 ++- src/server/CMakeLists.txt | 1 - src/server/app/FApp_AulServer.cpp | 16 ---------------- src/server/inc/FApp_AulServer.h | 2 -- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packaging/osp-appfw.spec b/packaging/osp-appfw.spec index ddb8d4c..08c03b8 100644 --- a/packaging/osp-appfw.spec +++ b/packaging/osp-appfw.spec @@ -36,7 +36,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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e11d4b5..beaeca7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,6 @@ pkg_check_modules(pkgs REQUIRED ecore glib-2.0 haptic - heynoti badge icu-i18n iniparser diff --git a/src/app/FApp_AppImpl.cpp b/src/app/FApp_AppImpl.cpp index 79b0799..edf7e4d 100644 --- a/src/app/FApp_AppImpl.cpp +++ b/src/app/FApp_AppImpl.cpp @@ -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; diff --git a/src/app/FApp_Aul.cpp b/src/app/FApp_Aul.cpp index 391773c..6846198 100644 --- a/src/app/FApp_Aul.cpp +++ b/src/app/FApp_Aul.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -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; } diff --git a/src/app/inc/FApp_AppImpl.h b/src/app/inc/FApp_AppImpl.h index 3867fca..1b83c5e 100644 --- a/src/app/inc/FApp_AppImpl.h +++ b/src/app/inc/FApp_AppImpl.h @@ -22,6 +22,8 @@ #ifndef _FAPP_INTERNAL_APP_IMPL_H_ #define _FAPP_INTERNAL_APP_IMPL_H_ +#include + #include #include #include @@ -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: /** diff --git a/src/app/inc/FApp_Aul.h b/src/app/inc/FApp_Aul.h index 7774bb6..9fdcde2 100644 --- a/src/app/inc/FApp_Aul.h +++ b/src/app/inc/FApp_Aul.h @@ -23,6 +23,7 @@ #define _FAPP_INTERNAL_AUL_H_ #include +#include #include #include @@ -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); diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 4b9f465..4d5daff 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -27,7 +27,6 @@ pkg_check_modules(server_pkgs REQUIRED chromium dukgenerator glib-2.0 - heynoti pkgmgr-info ) diff --git a/src/server/app/FApp_AulServer.cpp b/src/server/app/FApp_AulServer.cpp index 91aff1a..fd37fc9 100755 --- a/src/server/app/FApp_AulServer.cpp +++ b/src/server/app/FApp_AulServer.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -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) { diff --git a/src/server/inc/FApp_AulServer.h b/src/server/inc/FApp_AulServer.h index ab22aea..22c34dc 100755 --- a/src/server/inc/FApp_AulServer.h +++ b/src/server/inc/FApp_AulServer.h @@ -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); -- 2.7.4