r = Integer::Parse(val, __lifeDuration);
if( r == E_SUCCESS )
{
- __lifeDuration = ( __lifeDuration > LIFE_DURATION_MSEC_MAX ) ? LIFE_DURATION_MSEC_MAX : __lifeDuration;
- SysLog(NID_APP, "LifeDuration is (%d)", __lifeDuration);
+ SysLog(NID_APP, "LifeDuration is (%d) millis.", __lifeDuration);
}
}
else
{
__pLifeDurationTimer->Cancel();
- SysLog(NID_APP, "Life duration timer is cancelled.", lifeDuration );
}
if( __pauseLifeDurationTimer == false)
{
- __pLifeDurationTimer->Start(lifeDuration);
- SysLog(NID_APP, "Life duration timer is started with timeout.(%d)", lifeDuration );
+ int timeout = ( __lifeDuration > LIFE_DURATION_MSEC_MAX ) ? LIFE_DURATION_MSEC_MAX : __lifeDuration;
+ __pLifeDurationTimer->Start(timeout);
+ SysLog(NID_APP, "Life duration timer is started (%d millis)", timeout );
}
}
void
_ServiceAppImpl::OnTimerExpired(Timer& timer)
{
- SysLog(NID_APP, "Life duration timer is expired, so terminating the application.");
timer.Cancel();
-
- if( __pAppTerminatingInternalEventListener) //Fixme: Remove this workaround code after all LifeDuration value of pre-loaded apps are fixed.
+ if( __pAppTerminatingInternalEventListener || __lifeDuration != 1800000 ) //Fixme: Remove this workaround code after all LifeDuration value of pre-loaded apps are fixed.
{
+ SysLog(NID_APP, "Life duration timer is expired, so terminating the application.");
App::GetInstance()->Terminate();
}
+ else
+ {
+ SysLog(NID_APP, "Life duration timer is ignored.");
+ }
}
void
_ServiceAppImpl::ResumeLifeDurationTimer(void)
{
__pauseLifeDurationTimer = false;
-// SetLifeDurationTimer(__lifeDuration);
SysLog(NID_APP, "Life duration timer will be resumed." );
}
+void
+_ServiceAppImpl::ResetLifeDurationTimer(void)
+{
+ SetLifeDurationTimer(__lifeDuration);
+}
+
} } //Tizen::App