BuildRequires: pkgconfig(dukgenerator)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(heynoti)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(eina)
BuildRequires: pkgconfig(evas)
ecore
glib-2.0
haptic
- heynoti
badge
icu-i18n
iniparser
}
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;
#include <aul.h>
#include <bundle.h>
#include <appsvc/appsvc.h>
-#include <heynoti.h>
+#include <vconf.h>
#include <FBaseObject.h>
#include <FBaseString.h>
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.");
ret = heynoti_attach_handler(heyFd);
SysTryReturnResult(NID_APP, ret >= 0, E_SYSTEM, "heynoti_attach_handler failed.");
+#endif
return E_SUCCESS;
}
#ifndef _FAPP_INTERNAL_APP_IMPL_H_
#define _FAPP_INTERNAL_APP_IMPL_H_
+#include <vconf.h>
+
#include <FAppApp.h>
#include <FSysBattery.h>
#include <FBaseRtIEventListener.h>
struct service_s;
-
namespace Tizen { namespace Base { namespace Runtime
{
class IEventListener;
bool IsForcedTermination(void);
- static void OnPowerOffNotiReceived(void* pData);
+ static void OnPowerOffNotiReceived(_keynode_t* node, void* pData);
private:
/**
#define _FAPP_INTERNAL_AUL_H_
#include <appsvc/appsvc.h>
+#include <vconf.h>
#include <FOspConfig.h>
#include <FAppTypes.h>
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);
chromium
dukgenerator
glib-2.0
- heynoti
pkgmgr-info
)
#include <aul.h>
#include <bundle.h>
#include <appsvc/appsvc.h>
-#include <heynoti.h>
#include <FBaseObject.h>
#include <FBaseString.h>
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)
{
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);