return E_SUCCESS;
}
-
result
_AppImpl::Execute(_IAppImpl* pIAppImpl)
{
return __isTerminationRequested;
}
+typedef void (*cbForVconf)(keynode_t* node, void *pData);
+
void
-_AppImpl::OnPowerOffNotiReceived(void* user_data)
+_AppImpl::OnPowerOffNotiReceived(void* 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, (cbForVconf)_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;